question stringlengths 0 30.2k | answer stringlengths 55 2.44k |
|---|---|
<line-2></line-2>
<line-3>for _ in range(n):</line-3>
<line-4> a, b, c = list(map(int, input().split()))</line-4>
<line-5></line-5>
<line-6> print(min((a+b+c)//2, a+b, a+c, b+c))</line-6> | {"code": "<line-1>n = int(input())</line-1>", "lines": [1]}
#### 0 |
<line-1>import os</line-1>
<line-3></line-3>
<line-4># input = BytesIO(os.read(0, os.fstat(0).st_size)).readline</line-4>
<line-5>for i in range(int(input())):</line-5>
<line-6> a, b, c, r = list(map(int, input().split()))</line-6>
<line-7> a, b = min(a, b), max(a, b)</line-7>
<line-8> left = max(c - r, a)</li... | {"code": "<line-2>from io import BytesIO</line-2>\n<line-12> else:</line-12>", "lines": [2, 12]}
#### 0 |
<line-1>s = []</line-1>
<line-3> k = 0</line-3>
<line-4> for l in range(1, 10):</line-4>
<line-5> k *= 10</line-5>
<line-6> k += i</line-6>
<line-7> s.append(k)</line-7>
<line-8>s.sort()</line-8>
<line-9>q = int(input())</line-9>
<line-10>while q:</line-10>
<line-11> n = int(input())</line... | {"code": "<line-2>for i in range(1, 10):</line-2>\n<line-20> print(r)</line-20>", "lines": [2, 20]}
#### 0 |
<line-1>t = int(input())</line-1>
<line-2></line-2>
<line-4> n, m = [int(x) for x in input().split()]</line-4>
<line-5> grid = [[int(x) for x in input().split()] for _ in range(n)]</line-5>
<line-6></line-6>
<line-7> rows = sum(1 for x in grid if all(y == 0 for y in x))</line-7>
<line-8> cols = sum(1 for j ... | {"code": "<line-3>for _ in range(t):</line-3>\n<line-10> res = min(rows, cols)</line-10>", "lines": [3, 10]}
#### 0 |
<line-1>from sys import stdin</line-1>
<line-3>q = int(input())</line-3>
<line-4>for rwerew in range(q):</line-4>
<line-5> n = int(input())</line-5>
<line-6> p = list(map(int,input().split()))</line-6>
<line-7> c = list(map(int,input().split()))</line-7>
<line-8> for i in range(n):</line-8>
<line-9> p[i] -= 1</line-9>... | {"code": "<line-2>input = stdin.readline</line-2>\n<line-57>\t\t\t\t\tmini = min(mini, dzielnik)</line-57>", "lines": [2, 57]}
#### 0 |
<line-1>import math</line-1>
<line-3>for test in range(t):</line-3>
<line-4> n,k = map(int,input().split())</line-4>
<line-5> A = list(map(int,input().split()))</line-5>
<line-6> A.sort()</line-6>
<line-7> ans = 0</line-7>
<line-8> for i in range(1,n):</line-8>
<line-9> if(A[i]>k):</line-9>
<line-... | {"code": "<line-2>t = int(input())</line-2>\n<line-13> ans+=rem//A[0]</line-13>", "lines": [2, 13]}
#### 0 |
<line-1>t = int(input())</line-1>
<line-2></line-2>
<line-4> n = int(input())</line-4>
<line-5></line-5>
<line-6> lri = [None for _ in range(n)]</line-6>
<line-7></line-7>
<line-8> for _ in range(n):</line-8>
<line-9> li, ri = list(map(int, input().split()))</line-9>
<line-10> lri[_] = (li, ri, _)</line-10>
<line-11>... | {"code": "<line-3>for ti in range(t):</line-3>\n<line-29>\telse:</line-29>", "lines": [3, 29]}
#### 0 |
<line-1>t = int(input())</line-1>
<line-3> a, b, c, d = [int(i) for i in input().split(" ")]</line-3>
<line-4> sgn = (a+b)%2</line-4>
<line-5> small = False</line-5>
<line-6> large = False</line-6>
<line-7> if a == 0 and d == 0:</line-7>
<line-8> small = True</line-8>
<line-9> if b == 0 and c == 0:</line-9>
<l... | {"code": "<line-2>for _ in range(t):</line-2>\n<line-23> okay[2] = False</line-23>", "lines": [2, 23]}
#### 0 |
<line-1>for _ in range(int(input())):</line-1>
<line-3> li=list(map(int,input().split()))</line-3>
<line-4> ans=0</line-4>
<line-5> for i in range(n):</line-5>
<line-6> if li[i]>=i:</line-6>
<line-7> ans+=1</line-7>
<line-8> else:</line-8>
<line-9> break</line-9>
<line-10> ... | {"code": "<line-2> n=int(input())</line-2>\n<line-17> else:</line-17>", "lines": [2, 17]}
#### 0 |
<line-1>import sys</line-1>
<line-3>from collections import defaultdict</line-3>
<line-4>from collections import deque</line-4>
<line-5>from itertools import combinations</line-5>
<line-6>from itertools import permutations</line-6>
<line-7>input = lambda : sys.stdin.readline().rstrip()</line-7>
<line-8>read = lambda : ... | {"code": "<line-2>import math</line-2>\n<line-69> print(e)</line-69>", "lines": [2, 69]}
#### 0 |
<line-1>for _ in range(int(input())):</line-1>
<line-3> arr = list(map(int, input().split()))</line-3>
<line-4></line-4>
<line-5> peaks = [0 for i in range(n)]</line-5>
<line-6> for i in range(1, n - 1):</line-6>
<line-7> if arr[i] > arr[i - 1] and arr[i] > arr[i + 1]:</line-7>
<line-8> peaks... | {"code": "<line-2> n, k = tuple(map(int, input().split()))</line-2>\n<line-23> answer = i - k + 2</line-23>", "lines": [2, 23]}
#### 0 |
<line-1>#!/usr/bin/env python</line-1>
<line-3># Copyright (C) dirlt</line-3>
<line-4></line-4>
<line-5>from sys import stdin</line-5>
<line-6></line-6>
<line-7></line-7>
<line-8>def run(n, m, pixels):</line-8>
<line-9> ans = 1 << 30</line-9>
<line-10></line-10>
<line-11> acc = [[0] * (m + 1) for _ in range(n + 1... | {"code": "<line-2># coding:utf-8</line-2>\n<line-47> main()</line-47>", "lines": [2, 47]}
#### 0 |
<line-1>import math</line-1>
<line-2></line-2>
<line-4> if a[0] != b[0]:</line-4>
<line-5> return -1 if a[0] < b[0] else 1</line-5>
<line-6> if a[1] != b[1]:</line-6>
<line-7> return -1 if a[1] < b[1] else 1</line-7>
<line-8> return 0</line-8>
<line-9></line-9>
<line-10>def turn(a, b, c):</line-1... | {"code": "<line-3>def lexComp(a, b):</line-3>\n<line-60> break</line-60>", "lines": [3, 60]}
#### 0 |
<line-1>import math</line-1>
<line-3>import heapq</line-3>
<line-4>from collections import deque</line-4>
<line-5>def na():</line-5>
<line-6> n = int(input())</line-6>
<line-7> b = [int(x) for x in input().split()]</line-7>
<line-8> return n,b</line-8>
<line-9> </line-9>
<line-10> </line-10>
<line-11>def nab():</line-1... | {"code": "<line-2>from decimal import Decimal</line-2>\n<line-91>\t\td -= k2 * 2</line-91>", "lines": [2, 91]}
#### 0 |
<line-1>import sys</line-1>
<line-3>import bisect</line-3>
<line-4></line-4>
<line-5>t=int(input())</line-5>
<line-6></line-6>
<line-7>for testcases in range(t):</line-7>
<line-8> n=int(input())</line-8>
<line-9> A=list(map(int,input().split()))</line-9>
<line-10> m=int(input())</line-10>
<line-11> PS=[tupl... | {"code": "<line-2>input = sys.stdin.readline</line-2>\n<line-42> else:</line-42>", "lines": [2, 42]}
#### 0 |
<line-1>class BIT():</line-1>
<line-3> self.BIT=[0]*(n+1)</line-3>
<line-4> self.num=n</line-4>
<line-5></line-5>
<line-6> def query(self,idx):</line-6>
<line-7> res_sum = 0</line-7>
<line-8> while idx > 0:</line-8>
<line-9> res_sum += self.BIT[idx]</line-9>
<line-10> ... | {"code": "<line-2> def __init__(self,n):</line-2>\n<line-100> heapq.heappop(Xmax)</line-100>", "lines": [2, 100]}
#### 0 |
<line-1>for nt in range(int(input())):</line-1>
<line-3> l=list(map(int,input().split()))</line-3>
<line-4> s=sum(l)</line-4>
<line-5> e=l[0]</line-5>
<line-6> for i in range(1,n):</line-6>
<line-7> e=e^l[i]</line-7>
<line-8> if s==2*e:</line-8>
<line-9> print(0)</line-9>
<line-10> print ()</line-10>
<line-11> else:... | {"code": "<line-2>\tn=int(input())</line-2>\n<line-12>\t\tprint(2)</line-12>", "lines": [2, 12]}
#### 0 |
<line-1>from sys import stdin</line-1>
<line-3></line-3>
<line-4>tests = int(input())</line-4>
<line-5>for test in range(tests):</line-5>
<line-6> n, m = list(map(int, input().split()))</line-6>
<line-7> a = [[0] * m for _ in range(n)]</line-7>
<line-8> r = [[int(i) for i in input().split()] for _ in range(n)]... | {"code": "<line-2>input = stdin.readline</line-2>\n<line-22> for i in a:</line-22>", "lines": [2, 22]}
#### 0 |
<line-1>__MULTITEST = True</line-1>
<line-2></line-2>
<line-4>def solve():</line-4>
<line-5> n, x = map(int, input().split())</line-5>
<line-6> a = list(map(int, input().split()))</line-6>
<line-7> a.sort()</line-7>
<line-8></line-8>
<line-9> group = 0</line-9>
<line-10> ptr = n-1</line-10>
<line-11> ... | {"code": "<line-3>## solve</line-3>\n<line-31> solve();</line-31>", "lines": [3, 31]}
#### 0 |
<line-1>import sys</line-1>
<line-3>t = int(input())</line-3>
<line-4>for _ in range(t):</line-4>
<line-5> n = int(input())</line-5>
<line-6> ab = [list(map(int,input().split())) for i in range(n-1)]</line-6>
<line-7> graph = [[] for i in range(n+1)]</line-7>
<line-8> deg = [0]*(n+1)</line-8>
<line-9> for a,b in a... | {"code": "<line-2>input = sys.stdin.readline</line-2>\n<line-35> stack.append(y)</line-35>", "lines": [2, 35]}
#### 0 |
<line-1>import sys</line-1>
<line-3></line-3>
<line-4>t=int(input())</line-4>
<line-5></line-5>
<line-6>def calc(x):</line-6>
<line-7> return x*(x+1)//2</line-7>
<line-8></line-8>
<line-9>for test in range(t):</line-9>
<line-10> n,m=list(map(int,input().split()))</line-10>
<line-11></line-11>
<line-12> ANS=cal... | {"code": "<line-2>input = sys.stdin.readline</line-2>\n<line-17> ANS-=calc(q+1)*mod+calc(q)*(m+1-mod)</line-17>", "lines": [2, 17]}
#### 0 |
<line-1>for _ in range(int(input())):</line-1>
<line-3> ar = list(map(int, input().split()))</line-3>
<line-5> print(abs(ar[n] - ar[n - 1]))</line-5> | {"code": "<line-2> n = int(input())</line-2>\n<line-4> ar.sort()</line-4>", "lines": [2, 4]}
#### 0 |
<line-1>from heapq import heapify, heappush, heappop</line-1>
<line-3>input = sys.stdin.readline</line-3>
<line-4></line-4>
<line-5>def solve():</line-5>
<line-6> N, Q = list(map(int, input().split()))</line-6>
<line-7> events = []</line-7>
<line-8> for i in range(N):</line-8>
<line-9> S, T, X = list(ma... | {"code": "<line-2>import sys</line-2>\n<line-34> print(('\\n'.join(map(str, anss))))</line-34>", "lines": [2, 34]}
#### 0 |
<line-1>import sys</line-1>
<line-3></line-3>
<line-4>class UnionFind():</line-4>
<line-5> def __init__(self, n):</line-5>
<line-6> self.n = n</line-6>
<line-7> self.parents = [-1] * n</line-7>
<line-8></line-8>
<line-9> def find(self, x):</line-9>
<line-10> if self.parents[x] < 0:</line-10>
... | {"code": "<line-2>sys.setrecursionlimit(10**6)</line-2>\n<line-85>ans = [a for a in ans]</line-85>", "lines": [2, 85]}
#### 0 |
<line-1>n = int(input())</line-1>
<line-3>s = [ord(i)-97 for i in s]</line-3>
<line-4></line-4>
<line-5>dic = {}</line-5>
<line-6>for i in range(26):</line-6>
<line-7> dic[i] = []</line-7>
<line-8></line-8>
<line-9>for i in range(n):</line-9>
<line-10> dic[s[i]].append(i)</line-10>
<line-11></line-11>
<line-12>fo... | {"code": "<line-2>s = list(input())</line-2>\n<line-31> res += 1</line-31>", "lines": [2, 31]}
#### 0 |
<line-1>n=int(input())</line-1>
<line-3></line-3>
<line-4>X=[]</line-4>
<line-5>b=a[0]</line-5>
<line-6>for i in range(1,n) :</line-6>
<line-7> b^=a[i]</line-7>
<line-8></line-8>
<line-9>for i in range(n) :</line-9>
<line-10> x=b^a[i]</line-10>
<line-11> X.append(x)</line-11>
<line-12></line-12>
<line-14> p... | {"code": "<line-2>a=list(map(int,input().split()))</line-2>\n<line-13>for i in X :</line-13>", "lines": [2, 13]}
#### 0 |
<line-1>import sys</line-1>
<line-3>sys.setrecursionlimit(10**5)</line-3>
<line-4></line-4>
<line-5>N, Q = map(int, input().split())</line-5>
<line-6></line-6>
<line-7>path = [[] for _ in range(N)]</line-7>
<line-8></line-8>
<line-9>for _ in range(N-1) :</line-9>
<line-10> a, b, c, d = (int(i) for i in input().split... | {"code": "<line-2>input = sys.stdin.readline</line-2>\n<line-92>for i in range(Q) :</line-92>", "lines": [2, 92]}
#### 0 |
<line-1>import bisect</line-1>
<line-3>sys.setrecursionlimit(10**7)</line-3>
<line-4></line-4>
<line-5>def dfs(v):</line-5>
<line-6> pos=bisect.bisect_left(dp,arr[v])</line-6>
<line-7> changes.append((pos,dp[pos]))</line-7>
<line-8> dp[pos]=arr[v]</line-8>
<line-9> ans[v]=bisect.bisect_left(dp,10**18)</line... | {"code": "<line-2>import sys</line-2>\n<line-31>for i in range(1,n+1):</line-31>", "lines": [2, 31]}
#### 0 |
<line-2>n = int(input())</line-2>
<line-3>print(m-n) if m>n else print(m+n)</line-3> | {"code": "<line-1>m = int(input())</line-1>", "lines": [1]}
#### 0 |
<line-1># cook your dish here</line-1>
<line-3> result = 1</line-3>
<line-4> while exponent > 0:</line-4>
<line-5> if(exponent %2 == 1):</line-5>
<line-6> result = (result * base) % modulus</line-6>
<line-7> exponent = exponent//2</line-7>
<line-8> base = (base * base)%modulus</line-8>
<line-9> return result</line... | {"code": "<line-2>def modular_pow(base, exponent, modulus):</line-2>\n<line-47> break</line-47>", "lines": [2, 47]}
#### 0 |
<line-1># cook your dish here</line-1>
<line-3> sum1=(m*(m+1))//2</line-3>
<line-4> sum2=(m*(m-1))//2</line-4>
<line-5> ct=0</line-5>
<line-6> for i in range(n):</line-6>
<line-7> for j in range(n):</line-7>
<line-8> if i<j and k[i]>k[j]:</line-8>
<line-9> ct+=sum1</line-9>
... | {"code": "<line-2>def count(k,n,m):</line-2>\n<line-17> k=list(map(int,input().split()))</line-17>", "lines": [2, 17]}
#### 0 |
<line-1># cook your dish here</line-1>
<line-3> x = 0</line-3>
<line-4> # print(l)</line-4>
<line-5> for i in range(1, len(l)):</line-5>
<line-6> temp = []</line-6>
<line-7> for j in range(i):</line-7>
<line-8> v = getbig(l[i], l[j], fs)</line-8>
<line-9> if v > 1:</line-9>
... | {"code": "<line-2>def offset(l, flag):</line-2>\n<line-54> # print(fs)</line-54>", "lines": [2, 54]}
#### 0 |
<line-1>for _ in range(int(input())):</line-1>
<line-3> if N%2==0:</line-3>
<line-4> print(N//2+1)</line-4>
<line-6> print((N-1)//2+1)</line-6> | {"code": "<line-2> N=int(input())</line-2>\n<line-5> else:</line-5>", "lines": [2, 5]}
#### 0 |
<line-1># cook your dish here</line-1>
<line-3>n, k1, *l = map(int, input().split())</line-3>
<line-4>v_l, b_l = l[:n], l[n:]</line-4>
<line-5></line-5>
<line-6>b_inv = {key:[] for key in range(2*k1)}</line-6>
<line-7>for i in range(n):</line-7>
<line-8> b_l[i] -= 1</line-8>
<line-9> b_inv[b_l[i]].append(i)</line... | {"code": "<line-2>import bisect</line-2>\n<line-32> dp[j][j+k] = max(dp[j][j+k], v_l[j+k]+v_l[j])</line-32>", "lines": [2, 32]}
#### 0 |
<line-1># cook your dish here</line-1>
<line-3>for i in range(t):</line-3>
<line-4> n=input()</line-4>
<line-5> if(n=='b' or n=='B'):</line-5>
<line-6> print('BattleShip')</line-6>
<line-7> elif(n=='c' or n=='C'):</line-7>
<line-8> print('Cruiser')</line-8>
<line-9> elif(n=='d' or n=='D'):</li... | {"code": "<line-2>t=int(input())</line-2>\n<line-11> else:</line-11>", "lines": [2, 11]}
#### 0 |
<line-1>from math import *</line-1>
<line-3>import sys</line-3>
<line-4>input=sys.stdin.readline</line-4>
<line-5>t=int(input())</line-5>
<line-6>while(t):</line-6>
<line-7> t-=1</line-7>
<line-8> n=int(input())</line-8>
<line-9> a=list(map(int,input().split()))</line-9>
<line-10> p,q=map(int,input().split(... | {"code": "<line-2>from collections import *</line-2>\n<line-41> s+=abs(ex) </line-41>", "lines": [2, 41]}
#### 0 |
<line-1>import sys</line-1>
<line-3>def get_ints(): return list(map(int, sys.stdin.readline().strip().split()))</line-3>
<line-4>def input(): return sys.stdin.readline().strip()</line-4>
<line-5>import sys</line-5>
<line-6>sys.setrecursionlimit(10**9)</line-6>
<line-7>from math import sqrt,ceil,floor</line-7>
<line-8>n... | {"code": "<line-2>def get_array(): return list(map(int , sys.stdin.readline().strip().split()))</line-2>\n<line-14> ans-=1</line-14>", "lines": [2, 14]}
#### 0 |
<line-1>f = 5003*[0]</line-1>
<line-3></line-3>
<line-4></line-4>
<line-5>def qPow(a, b):</line-5>
<line-6> nonlocal modn</line-6>
<line-7> res = 1</line-7>
<line-8> while b > 0:</line-8>
<line-9> if (b & 1) == 1:</line-9>
<line-10> res = res * a % modn</line-10>
<line-11> a = a * a % modn</line-11>
<line-12> b = ... | {"code": "<line-2>modn = 1000000007</line-2>\n<line-41> print(res)</line-41>", "lines": [2, 41]}
#### 0 |
<line-1>arr = list(input())</line-1>
<line-3>ans = list()</line-3>
<line-4>#for i in arr:</line-4>
<line-5> #ans.append(ord(i)-96)</line-5>
<line-6>li = ['b','d','f','h','j','l','n','p','r','t','v','x','z']</line-6>
<line-7>s = set(arr)</line-7>
<line-8>temp = s.intersection(li)</line-8>
<line-9>for _ in range(int(i... | {"code": "<line-2>n = len(arr)</line-2>\n<line-19> break</line-19>", "lines": [2, 19]}
#### 0 |
<line-1># cook your dish here</line-1>
<line-3> a,b,c=map(int,input().split())</line-3>
<line-4> p=(c//a)*a+b</line-4>
<line-5> if p<=c:</line-5>
<line-6> print(p)</line-6>
<line-8> print(((c//a)-1)*a+b)</line-8> | {"code": "<line-2>for t in range(int(input())):</line-2>\n<line-7> else:</line-7>", "lines": [2, 7]}
#### 0 |
<line-1>#include<sdg.h></line-1>
<line-3> s=input()</line-3>
<line-4> n=len(s)</line-4>
<line-5> if n==1:</line-5>
<line-6> if s[0].isalpha(): print("-32")</line-6>
<line-7> else: print(0)</line-7>
<line-8> else:</line-8>
<line-9> num,ch=0,0</line-9>
<line-10> p,q=0,0</line-10>
<... | {"code": "<line-2>for _ in range(int(input())):</line-2>\n<line-35> sol=(n*8)-((num*32)+(ch*8))</line-35>", "lines": [2, 35]}
#### 0 |
<line-1>def update(index, value, bi_tree):</line-1>
<line-3> bi_tree[index] += value</line-3>
<line-4> index += index & -index</line-4>
<line-5></line-5>
<line-6></line-6>
<line-7>def get_sum(index, bi_tree):</line-7>
<line-8> ans = 0</line-8>
<line-9> while index > 0:</line-9>
<line-10> ans += bi_tree[index]</line-... | {"code": "<line-2> while index < len(bi_tree):</line-2>\n<line-63> for j in s:</line-63>", "lines": [2, 63]}
#### 0 |
<line-1># cook your dish here</line-1>
<line-2></line-2>
<line-4>from collections import deque,defaultdict</line-4>
<line-5>from math import ceil,floor,inf,sqrt,factorial,gcd,log</line-5>
<line-6>from copy import deepcopy</line-6>
<line-7>ii1=lambda:int(stdin.readline().strip())</line-7>
<line-8>is1=lambda:stdin.readli... | {"code": "<line-3>from sys import stdin,stdout</line-3>\n<line-19> else:</line-19>", "lines": [3, 19]}
#### 0 |
<line-1>import math</line-1>
<line-3> n=int(input())</line-3>
<line-4> s=int(math.sqrt(n))</line-4>
<line-5> ans=0</line-5>
<line-6> for i in range(1,s+1):</line-6>
<line-7> ans+=(n//i)</line-7>
<line-8> ans=ans*2-(s*s)</line-8>
<line-10> print(str(ans//g)+"/"+str(n*n//g)) </line-10> | {"code": "<line-2>for _ in range(int(input())):</line-2>\n<line-9> g=math.gcd(n*n,ans)</line-9>", "lines": [2, 9]}
#### 0 |
<line-1># cook your dish here</line-1>
<line-3>import numpy as np</line-3>
<line-4>import sys</line-4>
<line-5></line-5>
<line-6>def findSeq(n, s, k, m, M):</line-6>
<line-7> midInd = n // 2</line-7>
<line-8> seqs = []</line-8>
<line-9> for ind in range(midInd + 2, midInd - 3, -1):</line-9>
<line-10> if... | {"code": "<line-2># cook your dish here</line-2>\n<line-89> # print(ans)</line-89>", "lines": [2, 89]}
#### 0 |
<line-1># cook your dish here</line-1>
<line-3>counts=dict()</line-3>
<line-4>z=0</line-4>
<line-5>upper=None</line-5>
<line-6>for i in range(0,n):</line-6>
<line-7> a,h= [int(num) for num in input().split()]</line-7>
<line-8> counts[a]=h</line-8>
<line-9>for key,count in counts.items():</line-9>
<line-10> c=0</line-10... | {"code": "<line-2>n=int(input())</line-2>\n<line-75>else:</line-75>", "lines": [2, 75]}
#### 0 |
<line-1>n=int(input())</line-1>
<line-3>num=[1,1]</line-3>
<line-4>for i in range(2,n+1):</line-4>
<line-6>print(num[n])</line-6> | {"code": "<line-2>modulo=15746</line-2>\n<line-5> num.append((num[i-1]+num[i-2])%modulo)</line-5>", "lines": [2, 5]}
#### 0 |
<line-1># cook your dish here</line-1>
<line-3> m,n=list(map(int,input().split()))</line-3>
<line-4> a=[int(i) for i in input().split()]</line-4>
<line-5> l=-1</line-5>
<line-6> for i in range(n-1,-1,-1):</line-6>
<line-7> if a[i]==m:</line-7>
<line-8> l=i</line-8>
<line-9> brea... | {"code": "<line-2>for _ in range(int(input())):</line-2>\n<line-14> break</line-14>", "lines": [2, 14]}
#### 0 |
<line-1>def detect_triangle(adj): </line-1>
<line-3> for y in adj[x]:</line-3>
<line-4> if not set(adj[x]).isdisjoint(adj[y]):</line-4>
<line-5> return True</line-5>
<line-6></line-6>
<line-7> </line-7>
<line-8>for _ in range(int(input())):</line-8>
<line-9> n,m=list(map(int,input().split()))</line-9>... | {"code": "<line-2> for x in range(len(adj)):</line-2>\n<line-24> continue</line-24>", "lines": [2, 24]}
#### 0 |
<line-1>def C(n):</line-1>
<line-3></line-3>
<line-4></line-4>
<line-5>def sol():</line-5>
<line-6> equal, mini = False, min(N,M)</line-6>
<line-7> total_ways = 2*C(N * M)</line-7>
<line-8> if N==M:</line-8>
<line-9> equal = True</line-9>
<line-10> ways = 0</line-10>
<line-11> if not equal:</line-11>
<line-12> ways =... | {"code": "<line-2> return n*(n-1)//2</line-2>\n<line-58> N, M, X, Y = [int(x) for x in input().split()]</line-58>", "lines": [2, 58]}
#### 0 |
<line-1># cook your dish here</line-1>
<line-3>for i in range(t):</line-3>
<line-5> print(k//n)</line-5> | {"code": "<line-2>t=int(input())</line-2>\n<line-4> (n,k)=tuple(map(int,input().split()))</line-4>", "lines": [2, 4]}
#### 0 |
<line-1>n,k=[int(x) for x in input().split()]</line-1>
<line-3>ans=0</line-3>
<line-4>for i in range(n-1):</line-4>
<line-5> for j in range(i+1,n):</line-5>
<line-6> if(abs(a[i]-a[j])>=k):</line-6>
<line-8>print(ans)</line-8> | {"code": "<line-2>a=[int(x) for x in input().split()]</line-2>\n<line-7> ans+=1</line-7>", "lines": [2, 7]}
#### 0 |
<line-1># cook your dish here</line-1>
<line-3>for i in range(n):</line-3>
<line-4> S, SG, FG, D, T = map(int, input().split())</line-4>
<line-5> speed = (D*180)/T + S</line-5>
<line-6> if abs(SG-speed) == abs(FG-speed):</line-6>
<line-7> print('DRAW')</line-7>
<line-8> elif abs(SG-speed) > abs(FG-sp... | {"code": "<line-2>n=int(input())</line-2>\n<line-10> else:</line-10>", "lines": [2, 10]}
#### 0 |
<line-1># By Prathmesh Maurya</line-1>
<line-3>while(t!=0):</line-3>
<line-4> t-=1</line-4>
<line-5> n=eval(input())</line-5>
<line-6> if n%2 == 0:</line-6>
<line-7> print(n*4)</line-7>
<line-8> elif n%4==3:</line-8>
<line-9> print(n)</line-9>
<line-11> print(n*2)</line-11> | {"code": "<line-2>t=eval(input())</line-2>\n<line-10> else:</line-10>", "lines": [2, 10]}
#### 0 |
<line-1> </line-1>
<line-2>for __ in range(int(input())):</line-2>
<line-4> arr=list(map(int,input().split()))</line-4>
<line-5> s=set(arr)</line-5>
<line-6> mex=-1</line-6>
<line-7> ele=1</line-7>
<line-8> for i in range(1,n+1):</line-8>
<line-9> if i not in s:</line-9>
<line-10> me... | {"code": "<line-3> n,m=map(int,input().split())</line-3>\n<line-17> c=arr.count(m)</line-17>", "lines": [3, 17]}
#### 0 |
<line-1>for i in range(int(input())):</line-1>
<line-3> c = list(map(int, input().split()))</line-3>
<line-4> d = {}</line-4>
<line-5> d[0] = -1</line-5>
<line-6> parity = 0</line-6>
<line-7> ans = 0</line-7>
<line-8> for i in range(n):</line-8>
<line-9> parity ^= 1 << (c[i]-1)</line-9>
<line-10> ... | {"code": "<line-2> n = int(input())</line-2>\n<line-15> d[parity] = i</line-15>", "lines": [2, 15]}
#### 0 |
<line-1># cook your dish here</line-1>
<line-3>import math</line-3>
<line-4></line-4>
<line-5>def main(grid):</line-5>
<line-6> ans=0</line-6>
<line-7> for i in range(len(grid)):</line-7>
<line-8> for j in range(len(grid[0])):</line-8>
<line-9> first_point=grid[i][j]</line-9>
<line-10> ... | {"code": "<line-2>import sys</line-2>\n<line-27> arr.append(list(input()))</line-27>", "lines": [2, 27]}
#### 0 |
<line-1># cook your dish here</line-1>
<line-3> tr=int(input())</line-3>
<line-4> trl=list(map(int,input().split()))</line-4>
<line-5> dr = int(input())</line-5>
<line-6> drl = list(map(int, input().split()))</line-6>
<line-7> ts = int(input())</line-7>
<line-8> tsl = list(map(int, input().split()))</... | {"code": "<line-2>for _ in range(int(input())):</line-2>\n<line-27> else:</line-27>", "lines": [2, 27]}
#### 0 |
<line-1># cook your dish here</line-1>
<line-3> str_2=""</line-3>
<line-4> lst=[]</line-4>
<line-5> for i in range(L//4):</line-5>
<line-6> str_1 = "abcdefghijklmnop"</line-6>
<line-7> S_1=S[(i*4):(4*(i+1))]</line-7>
<line-8> for j in range(4):</line-8>
<line-9> if(S_1[j]=="1"):</line-9>
<line-10> str_1=str_1[l... | {"code": "<line-2>def decode(L,S):</line-2>\n<line-19> S=input()</line-19>", "lines": [2, 19]}
#### 0 |
<line-1>for _ in range(int(input())):</line-1>
<line-3> array = []</line-3>
<line-4> tot = []</line-4>
<line-5> for _ in range(n):</line-5>
<line-6> temp = list(map(int,input().split()))</line-6>
<line-7> aa = temp[0]</line-7>
<line-8> del(temp[0])</line-8>
<line-9> temp.sort()</line-9>
<line-10> temp.insert(0,aa)... | {"code": "<line-2> n,k = list(map(int,input().split()))</line-2>\n<line-34> else:</line-34>", "lines": [2, 34]}
#### 0 |
<line-1># cook your dish here</line-1>
<line-3>for _ in range(test):</line-3>
<line-4> n=int(input())</line-4>
<line-5> n=list(bin(n))</line-5>
<line-7> print(ans-1)</line-7> | {"code": "<line-2>test=int(input())</line-2>\n<line-6> ans=n.count('1')</line-6>", "lines": [2, 6]}
#### 0 |
<line-1>import sys</line-1>
<line-2></line-2>
<line-4></line-4>
<line-5>def g(a,b):</line-5>
<line-6> if (a > b):</line-6>
<line-7> tmp = a</line-7>
<line-8> a = b</line-8>
<line-9> b = tmp</line-9>
<line-10> if (b == a):</line-10>
<line-11> return 0</line-11>
<line-12> if (b % a == 0):</line-12>
<line-13> return ... | {"code": "<line-3>t = int(input())</line-3>\n<line-60> #print(str(g(a,b)) + \" \" + str(g2(a,b)))</line-60>", "lines": [3, 60]}
#### 0 |
<line-1># cook your dish here</line-1>
<line-3> n=int(input())</line-3>
<line-4> p=1</line-4>
<line-5> l=n-1</line-5>
<line-6> for j in range(n):</line-6>
<line-7> for k in range(l):</line-7>
<line-8> print(" ",end='')</line-8>
<line-9> for k in range(p):</line-9>
<line-10> ... | {"code": "<line-2>for i in range(int(input())):</line-2>\n<line-17> p+=2</line-17>", "lines": [2, 17]}
#### 0 |
<line-1>import sys</line-1>
<line-2> </line-2>
<line-4>s=sys.stdin.readline().split()</line-4>
<line-5>sky=list(map(int,s))</line-5>
<line-6>sky.reverse()</line-6>
<line-7>cuts=0</line-7>
<line-8>change=0</line-8>
<line-9>t=False</line-9>
<line-10>i=1</line-10>
<line-11> </line-11>
<line-12>while i<len(sky):</line-12>
... | {"code": "<line-3>num=int(sys.stdin.readline())</line-3>\n<line-41> change=0</line-41>", "lines": [3, 41]}
#### 0 |
<line-1></line-1>
<line-2>def main():</line-2>
<line-4> while (t):</line-4>
<line-5> m, n = map(int, input().split())</line-5>
<line-6> a , b= bin(m)[2:],bin(n)[2:]</line-6>
<line-7> #print(a,b)</line-7>
<line-8> max = m^n</line-8>
<line-9> if len(a)>len(b):</line-9>
<line-10> diff =len(a)-len(b)</line-10>
<line... | {"code": "<line-3> t = int(input())</line-3>\n<line-34> main()</line-34>", "lines": [3, 34]}
#### 0 |
<line-1>t = int(input())</line-1>
<line-2></line-2>
<line-4> s = [x for x in input()]</line-4>
<line-5> </line-5>
<line-6> freq = {}</line-6>
<line-7> </line-7>
<line-8> for i in s:</line-8>
<line-9> if i in freq:</line-9>
<line-10> freq[i] += 1</line-10>
<line-11> else:</line-11>
<line-12> freq[i] = 1</line-12>
... | {"code": "<line-3>for _ in range(t):</line-3>\n<line-23> else:</line-23>", "lines": [3, 23]}
#### 0 |
<line-1>def main():</line-1>
<line-3> for t in range(T):</line-3>
<line-4> N,K = map(int, input().split())</line-4>
<line-5> W = list(map(int, input().split()))</line-5>
<line-6> W.sort()</line-6>
<line-7> if 2*K > N:</line-7>
<line-8> K = N - K</line-8>
<line-9> kid = sum(W[:K])</line-9>
<line-10> dad = sum(W[... | {"code": "<line-2> T = int(input())</line-2>\n<line-18> main()</line-18>", "lines": [2, 18]}
#### 0 |
<line-1>def eq_solve(v0, v1, u0, u1):</line-1>
<line-3> num = u1 - v1</line-3>
<line-4> if den != 0:</line-4>
<line-5> return num / den</line-5>
<line-6> return 1</line-6>
<line-7> </line-7>
<line-8>def solve(p, q, r, a, b, c, rs):</line-8>
<line-9> if p == a and q == b and r == c:</line-9>
<line-10>... | {"code": "<line-2> den = u0 - v0</line-2>\n<line-59> print(z)</line-59>", "lines": [2, 59]}
#### 0 |
<line-1>from math import log10</line-1>
<line-3>def solve(n,k):</line-3>
<line-4> </line-4>
<line-5> mod=10**k</line-5>
<line-6> x=Decimal(n)</line-6>
<line-7> y=x*(x.log10())%1</line-7>
<line-8> p=str(pow(10,y))</line-8>
<line-9> c=0</line-9>
<line-10> first=''</line-10>
<line-11> for v in p:</line-11>
<line-12> if c... | {"code": "<line-2>from decimal import Decimal</line-2>\n<line-24>for n,k in queries:</line-24>", "lines": [2, 24]}
#### 0 |
<line-1>t = eval(input())</line-1>
<line-2></line-2>
<line-4> n = eval(input())</line-4>
<line-5> a = list(map(int, input().split()))</line-5>
<line-6> cnt = 2</line-6>
<line-7> cnt1 = 2</line-7>
<line-8> ll = len(a)</line-8>
<line-9> if ll < 3:</line-9>
<line-10> cnt1 = ll</line-10>
<line-11> else:</line-11>
<line-12... | {"code": "<line-3>for i in range(t):</line-3>\n<line-18> cnt = 2</line-18>", "lines": [3, 18]}
#### 0 |
<line-1></line-1>
<line-2></line-2>
<line-3>z = int(input())</line-3>
<line-5>while i < z:</line-5>
<line-6> n = int(input())</line-6>
<line-7> p = int(n**(0.5))</line-7>
<line-8> if p*(p+1) < n:</line-8>
<line-9> p += 1</line-9>
<line-10> # print("P", p)</line-10>
<line-11> x, y = 0, 0</line-11>
<line-12> q =... | {"code": "<line-4>i = 0</line-4>\n<line-57> print(x, y)</line-57>", "lines": [4, 57]}
#### 0 |
<line-1># cook your dish here</line-1>
<line-3> n,m=[int(x)for x in input().rstrip().split()]</line-3>
<line-4> s=[]</line-4>
<line-5> for p in range(n):</line-5>
<line-6> s.append(10)</line-6>
<line-7> for c in range(m):</line-7>
<line-8> i,j,k=[int(x)for x in input().rstrip().split()]</line-8>
<line-9> for q in ra... | {"code": "<line-2>for t in range(int(input())):</line-2>\n<line-10> s[q]=s[q]*k</line-10>", "lines": [2, 10]}
#### 0 |
<line-1>from queue import PriorityQueue</line-1>
<line-3>rr=[]</line-3>
<line-4>cc=[]</line-4>
<line-5>speed={'S':3,'O':2,'F':1}</line-5>
<line-6>visited=set()</line-6>
<line-7>dp=[]</line-7>
<line-8></line-8>
<line-9>def qwerty(cur,x,y,f):</line-9>
<line-10> if f==0:</line-10>
<line-11> gg=rr[x][1]+y*rr[x][0]</line-1... | {"code": "<line-2>m,n=list(map(int,input().split()))</line-2>\n<line-74>\t\t\t\t\tpq.put((dp[nxx][nyy],nxx,nyy))</line-74>", "lines": [2, 74]}
#### 0 |
<line-1>import math</line-1>
<line-3>try:</line-3>
<line-4> import psyco</line-4>
<line-5> psyco.full()</line-5>
<line-6>except ImportError:</line-6>
<line-7> pass</line-7>
<line-8> </line-8>
<line-9>def isSharp(ang):</line-9>
<line-10> return ang > math.pi/4 + 0.00001</line-10>
<line-11> </line-11>
<line-12>def unitVe... | {"code": "<line-2>import copy</line-2>\n<line-123> else:</line-123>", "lines": [2, 123]}
#### 0 |
<line-1># cook your dish here</line-1>
<line-3> N=int(input())</line-3>
<line-4> ALICE=list(map(int,input().split()))</line-4>
<line-5> BOB=list(map(int,input().split()))</line-5>
<line-6> ALICE[ALICE.index(max(ALICE))]=0</line-6>
<line-7> BOB[BOB.index(max(BOB))]=0</line-7>
<line-8> if sum(ALICE)<sum(BOB):</line-8>
<l... | {"code": "<line-2>for i in range(int(input())):</line-2>\n<line-12> else:</line-12>", "lines": [2, 12]}
#### 0 |
<line-1>def find_combinations(list, sum):</line-1>
<line-3> if sum == 0:</line-3>
<line-4> return [[]]</line-4>
<line-5> return []</line-5>
<line-6> return find_combinations(list[1:], sum) + \</line-6>
<line-7> [[list[0]] + tail for tail in</line-7>
<line-8> find_combinations(list[1:], sum - list[0])]</line-8>
<... | {"code": "<line-2> if not list:</line-2>\n<line-15> else:</line-15>", "lines": [2, 15]}
#### 0 |
<line-1># cook your dish here</line-1>
<line-3>L=[]</line-3>
<line-4>for i in range(n):</line-4>
<line-5> s=input()</line-5>
<line-6> L.append(s)</line-6>
<line-7></line-7>
<line-8>cost=[]</line-8>
<line-9>h2=[0]*(m+1)</line-9>
<line-10>cost.append(h2)</line-10>
<line-11>for i in range(n):</line-11>
<line-12> ... | {"code": "<line-2>n,m=map(int,input().split())</line-2>\n<line-54> qr=min(m*n,q[i])</line-54>", "lines": [2, 54]}
#### 0 |
<line-1># cook your dish here</line-1>
<line-3> N = int(input())</line-3>
<line-4> l = list(map(int, input().split()))</line-4>
<line-5> for j in range(int(input())):</line-5>
<line-6> q1, q2 = map(int, input().split())</line-6>
<line-8> print(sum(temp))</line-8> | {"code": "<line-2>for i in range(int(input())):</line-2>\n<line-7> temp = l[q1 - 1 : q2]</line-7>", "lines": [2, 7]}
#### 0 |
<line-1>for _ in range(int(input())):</line-1>
<line-3> c=list(map(int,input().split()))</line-3>
<line-4> count=1</line-4>
<line-5> for i in range(n):</line-5>
<line-6> if i+1<n:</line-6>
<line-7> if c[i]-c[i+1]>=k or c[i+1]-c[i]>=k:</line-7>
<line-8> continue</line-8>
<line-9> else:</line-9>
<line-10> coun... | {"code": "<line-2> n,k=list(map(int,input().split()))</line-2>\n<line-11> c[i],c[i+1]=c[i+1],c[i]</line-11>", "lines": [2, 11]}
#### 0 |
<line-1>def f(a,y,index,sorted_pos):</line-1>
<line-3> n=len(a)</line-3>
<line-4> low=0</line-4>
<line-5> high=n-1</line-5>
<line-6> L,R=0,0</line-6>
<line-7> l,r=0,0</line-7>
<line-8> while(low<=high):</line-8>
<line-9> mid=(low+high)//2</line-9>
<line-10> #print(low,high,mid)</line-10>
<line-11> if(a[mid]== y):</l... | {"code": "<line-2> #print(a,y,index,sorted_pos)</line-2>\n<line-49> f(arr,y,index,sorted_pos)</line-49>", "lines": [2, 49]}
#### 0 |
<line-1>t=int(input())</line-1>
<line-3> str1=input()</line-3>
<line-4> str2=input()</line-4>
<line-5> res='No'</line-5>
<line-6> for i in str1:</line-6>
<line-7> if i in str2:</line-7>
<line-8> res='Yes'</line-8>
<line-10> print(res)</line-10> | {"code": "<line-2>for _ in range (t):</line-2>\n<line-9> break</line-9>", "lines": [2, 9]}
#### 0 |
<line-1># cook your dish here</line-1>
<line-3>import math</line-3>
<line-4></line-4>
<line-5>def main(arr):</line-5>
<line-6> for i in range(1,len(arr)-1):</line-6>
<line-7> if arr[i]==arr[i-1] and arr[i]==arr[i+1]:</line-7>
<line-8> return "Yes"</line-8>
<line-9> return "No"</line-9>
<line-10>... | {"code": "<line-2>import sys</line-2>\n<line-14> arr=list(map(int,input().split()))</line-14>", "lines": [2, 14]}
#### 0 |
<line-1></line-1>
<line-2>test=int(input())</line-2>
<line-4> n= int(input())</line-4>
<line-5></line-5>
<line-6> adj=[[] for i in range(n+1)]</line-6>
<line-7></line-7>
<line-8> for _ in range(n-1):</line-8>
<line-9> a,b=list(map(int,input().split()))</line-9>
<line-10> adj[a].append(b)</line-10>
<line-11> adj[b].a... | {"code": "<line-3>for t in range(test):</line-3>\n<line-38> else:</line-38>", "lines": [3, 38]}
#### 0 |
<line-1>from math import sqrt</line-1>
<line-2></line-2>
<line-4> n = int(input())</line-4>
<line-5></line-5>
<line-6> x = int(sqrt(2 * n))</line-6>
<line-7></line-7>
<line-8> while x * (x+1) // 2 <= n:</line-8>
<line-9> x += 1</line-9>
<line-10></line-10>
<line-11> while x * (x+1) // 2 > n:</line-11>
<line-12> x -= ... | {"code": "<line-3>for _ in range(int(input())):</line-3>\n<line-14> n -= x * (x+1) // 2</line-14>", "lines": [3, 14]}
#### 0 |
<line-1># cook your dish here</line-1>
<line-3>from math import sqrt, ceil,factorial</line-3>
<line-4>import sys</line-4>
<line-5>import copy</line-5>
<line-6>def get_array(): return list(map(int, sys.stdin.readline().strip().split()))</line-6>
<line-7>def get_ints(): return map(int, sys.stdin.readline().strip().split(... | {"code": "<line-2>from collections import deque, defaultdict</line-2>\n<line-43> continue</line-43>", "lines": [2, 43]}
#### 0 |
<line-1>#! /usr/bin/env python</line-1>
<line-2></line-2>
<line-4>from functools import reduce</line-4>
<line-5></line-5>
<line-6>def gcd(a,b):</line-6>
<line-7> while b!=0:</line-7>
<line-8> a,b=b,a%b</line-8>
<line-9> return a</line-9>
<line-10> </line-10>
<line-11>def gcdl(l):</line-11>
<line-12> return reduce(gcd,... | {"code": "<line-3>from sys import stdin</line-3>\n<line-21>\t\tprint(\" \".join([str(x) for x in numbers]))</line-21>", "lines": [3, 21]}
#### 0 |
<line-1>for _ in range(int(input())):</line-1>
<line-3> while g>0:</line-3>
<line-4> if a<o:</line-4>
<line-5> a+=1</line-5>
<line-6> g-=1</line-6>
<line-7> elif o<a:</line-7>
<line-8> o+=1</line-8>
<line-9> g-=1</line-9>
<line-10> else:</line-10>
<line-12> print(abs(a-o))</line-12> | {"code": "<line-2> a,o,g=map(int,input().split())</line-2>\n<line-11> break</line-11>", "lines": [2, 11]}
#### 0 |
<line-1>for _ in range(int(input())):</line-1>
<line-3> if n==1:</line-3>
<line-4> print(0)</line-4>
<line-5> elif n==2:</line-5>
<line-6> print(m)</line-6>
<line-8> print(m*2+n-3)</line-8> | {"code": "<line-2> n,m=map(int, input().split())</line-2>\n<line-7> else:</line-7>", "lines": [2, 7]}
#### 0 |
<line-1>for t in range(int(input())):</line-1>
<line-3> a=list(map(int,input().split()))</line-3>
<line-4> s=0</line-4>
<line-5> l=[]</line-5>
<line-6> for i in range(n):</line-6>
<line-7> if (a[i]<0):</line-7>
<line-8> e=i</line-8>
<line-9> ss=sum(a[s:e])</line-9>
<line-10> l.append((ss,e-s,n-s))</line-10>
<lin... | {"code": "<line-2> n=int(input())</line-2>\n<line-19> print(a[i], end=' ')</line-19>", "lines": [2, 19]}
#### 0 |
<line-1>for _ in range(int(input())):</line-1>
<line-3> if not len(st):print(1)</line-3>
<line-4> else:</line-4>
<line-5> cu=mx=1</line-5>
<line-6> for j in range(1,len(st)):</line-6>
<line-7> if st[j]==st[j-1]:cu+=1</line-7>
<line-9> print(max(mx+1,cu+1))</line-9> | {"code": "<line-2> st=input().replace(\"=\",\"\")</line-2>\n<line-8> else:mx=max(mx,cu);cu=1</line-8>", "lines": [2, 8]}
#### 0 |
<line-1>for _ in range(int(input())):</line-1>
<line-3> n = len(S)</line-3>
<line-5> print(2 ** n - 2 ** a)</line-5> | {"code": "<line-2> S = input()</line-2>\n<line-4> a = n - S.count('a')</line-4>", "lines": [2, 4]}
#### 0 |
<line-1>knows=input()</line-1>
<line-3>while n!=0:</line-3>
<line-4> n=n-1</line-4>
<line-5> word=input()</line-5>
<line-6> for x in word:</line-6>
<line-7> ctr=0</line-7>
<line-8> for y in knows:</line-8>
<line-9> if x==y:ctr=ctr+1;break</line-9>
<line-11> else: print('Yes')</line-11> | {"code": "<line-2>n=eval(input())</line-2>\n<line-10> if ctr==0:print('No');break</line-10>", "lines": [2, 10]}
#### 0 |
<line-1># cook your dish here</line-1>
<line-3> n,b=map(int,input().split())</line-3>
<line-5> print(ans)</line-5> | {"code": "<line-2>for i in range(int(input())):</line-2>\n<line-4> ans=round(n/(2*b))*(n-b*round((n/(2*b))));</line-4>", "lines": [2, 4]}
#### 0 |
<line-1>t=int(input())</line-1>
<line-3> pref = [0]*n</line-3>
<line-4> pref[0]=a[0]</line-4>
<line-5> suff = [0]*n</line-5>
<line-6> suff[-1]=a[-1]</line-6>
<line-7> for i in range (1,n):</line-7>
<line-8> pref[i] = pref[i-1]|a[i]</line-8>
<line-9> suff[n-i-1] = suff[n-i]|a[n-i-1]</line-9>... | {"code": "<line-2>def check():</line-2>\n<line-46> ans.append((i%n)+1)</line-46>", "lines": [2, 46]}
#### 0 |
<line-1>from sys import stdin, stdout</line-1>
<line-3>from collections import defaultdict as dd, deque</line-3>
<line-4>from heapq import merge, heapify, heappop, heappush, nsmallest</line-4>
<line-5>from bisect import bisect_left as bl, bisect_right as br, bisect</line-5>
<line-6>mod = pow(10, 9) + 7</line-6>
<line-7... | {"code": "<line-2>from math import floor, gcd, fabs, factorial, fmod, sqrt, inf, log</line-2>\n<line-34> print(\" \", end=\"\")</line-34>", "lines": [2, 34]}
#### 0 |
<line-1># your code goes here</line-1>
<line-3>n = int(stdin.readline())</line-3>
<line-4>while n:</line-4>
<line-5> n -= 1</line-5>
<line-6> k, l, e = map(int, stdin.readline().strip().split(' '))</line-6>
<line-7> a = map(int, stdin.readline().strip().split(' '))</line-7>
<line-8> x = float(l) / float(e + sum(a))</li... | {"code": "<line-2>from sys import stdin, stdout</line-2>\n<line-11> else:</line-11>", "lines": [2, 11]}
#### 0 |
<line-1>import sys</line-1>
<line-3>import math</line-3>
<line-4>from collections import defaultdict as dd</line-4>
<line-5>input=sys.stdin.readline</line-5>
<line-6>##sys.setrecursionlimit(10**7)</line-6>
<line-7>def cin():</line-7>
<line-8> return list(map(int,sin().split()))</line-8>
<line-9>def ain(): ... | {"code": "<line-2>import bisect as bi</line-2>\n<line-66>## print(l,c)</line-66>", "lines": [2, 66]}
#### 0 |
<line-1>n=int(input())</line-1>
<line-3> t=int(input())</line-3>
<line-4> m=list(map(int,input().split()))</line-4>
<line-5> p,q=0,0</line-5>
<line-6> if t==1:</line-6>
<line-7> if m[0]>=0:</line-7>
<line-8> print('YES')</line-8>
<line-9> else:</line-9>
<line-10> print('NO')</line-10>
<line-11> else:</line-11>
<l... | {"code": "<line-2>for i in range(n):</line-2>\n<line-19> else:</line-19>", "lines": [2, 19]}
#### 0 |
<line-1>for z in range(int(input())):</line-1>
<line-3> n = len(s)</line-3>
<line-4> i = 0</line-4>
<line-5> while i<n and s[i]=='1':</line-5>
<line-6> i+=1</line-6>
<line-7> if i==0:</line-7>
<line-8> print(0)</line-8>
<line-9> else:</line-9>
<line-10> k = 0</line-10>
<line-11> ... | {"code": "<line-2> s = input()</line-2>\n<line-13> k+=1</line-13>", "lines": [2, 13]}
#### 0 |
<line-1>import functools</line-1>
<line-2></line-2>
<line-4> if(y == 0):</line-4>
<line-5> return x</line-5>
<line-6> return gcd(y, x%y)</line-6>
<line-7></line-7>
<line-8>for _ in range(int(input())):</line-8>
<line-9> n, m= map(int, input().split())</line-9>
<line-10> p = list(map(int, input().split()))</line-10>
<l... | {"code": "<line-3>def gcd(x,y):</line-3>\n<line-25> res = n-max(f)</line-25>", "lines": [3, 25]}
#### 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.