question stringlengths 0 30.2k | answer stringlengths 55 2.44k |
|---|---|
<line-1>from sys import stdin, stdout</line-1>
<line-3>#a,b = map(int, stdin.readline().split())</line-3>
<line-4>#l1 = list(map(int, stdin.readline().split()))</line-4>
<line-5>l = [1,6,7]</line-5>
<line-6>c = 1</line-6>
<line-7>for x in range(3,100001):</line-7>
<line-8> if x%2==1:</line-8>
<line-9> a = l[c... | {"code": "<line-2>#from math import gcd as g</line-2>\n<line-16> s = int(stdin.readline())</line-16>", "lines": [2, 16]}
#### 0 |
<line-1>for _ in range(int(input())):</line-1>
<line-3> for j in range(len(l)-1,-1,-1):</line-3>
<line-4> if l[j]==1:</line-4>
<line-5> l.pop()</line-5>
<line-6> else:</line-6>
<line-7> break</line-7>
<line-8> if l.count(1):</line-8>
<line-9> time,prev,z,c=0,0,0,0</line-9>
<line-10> for j in range(len(l)-1,-1,-... | {"code": "<line-2> l=list(map(int,input().strip()))</line-2>\n<line-20> else:</line-20>", "lines": [2, 20]}
#### 0 |
<line-1>n = int(input())</line-1>
<line-3> s = input()</line-3>
<line-4> l = len(s)</line-4>
<line-5> n1 = int(s[0])</line-5>
<line-7> print(n1+n2)</line-7> | {"code": "<line-2>for i in range(n):</line-2>\n<line-6> n2 = int(s[l-1])</line-6>", "lines": [2, 6]}
#### 0 |
<line-1>tc=int(input())</line-1>
<line-3> m,r=list(map(int,input().split()))</line-3>
<line-4> n=m**(r-1)</line-4>
<line-5> a=[i**n for i in range(1,2*n+1)]</line-5>
<line-6> tmp=2*n-1</line-6>
<line-7> for i in range(n):</line-7>
<line-8> for j in range(tmp-i):</line-8>
<line-10> print((a[n-1]/m)%1000000007)</line-10... | {"code": "<line-2>for case in range(tc):</line-2>\n<line-9> a[j]=a[j+1]-a[j]</line-9>", "lines": [2, 9]}
#### 0 |
<line-1>N,M,C = list(map(int, input().split()))</line-1>
<line-3></line-3>
<line-4>def add(u,k):</line-4>
<line-5> while u < len(tree):</line-5>
<line-6> tree[u] += k </line-6>
<line-7> u += u&-u</line-7>
<line-8></line-8>
<line-9>def query(k):</line-9>
<line-10> ans = 0</line-10>
<line-11> while k:</line-11>
<line-1... | {"code": "<line-2>tree = [0] * (N+1)</line-2>\n<line-28> solve()</line-28>", "lines": [2, 28]}
#### 0 |
<line-1>tc=int(input())</line-1>
<line-3> n,d=list(map(int,input().split()))</line-3>
<line-4> a=list(map(int,input().split()))</line-4>
<line-5> sm=sum(a)</line-5>
<line-6> f=True</line-6>
<line-7> if sm%n==0:</line-7>
<line-8> avg=sm/n</line-8>
<line-9> for i in range(d):</line-9>
<line-10> tmp_sm=0</line-10>
<li... | {"code": "<line-2>for case in range(tc):</line-2>\n<line-32> else:</line-32>", "lines": [2, 32]}
#### 0 |
<line-1># cook your dish here</line-1>
<line-3></line-3>
<line-4>for _ in range(t):</line-4>
<line-5></line-5>
<line-6> n,s = input().split()</line-6>
<line-7></line-7>
<line-8> N = int(n) </line-8>
<line-9> r = N - len(s)</line-9>
<line-10></line-10>
<line-11> count = 0</line-11>
<line-12></line-12>
<line-... | {"code": "<line-2>t = int(input())</line-2>\n<line-18> count = count%(10**9 + 7)</line-18>", "lines": [2, 18]}
#### 0 |
<line-1># cook your dish here</line-1>
<line-3>try:</line-3>
<line-4> n,d=map( int,input().split() )</line-4>
<line-5> a=list(map(int,input().split()))</line-5>
<line-6> a.sort()</line-6>
<line-7> z=abs(a[0]-d)</line-7>
<line-8> for j in range(n):</line-8>
<line-9> x=abs(a[j]-d)</line-9>
<line-10>... | {"code": "<line-2>import math</line-2>\n<line-14>except:</line-14>", "lines": [2, 14]}
#### 0 |
<line-1>def multiple_input(): return map(int, input().split())</line-1>
<line-2></line-2>
<line-3></line-3>
<line-5></line-5>
<line-6></line-6>
<line-7>mod = int(1e9) + 7</line-7>
<line-8>for _ in range(int(input())):</line-8>
<line-9> n, m = multiple_input()</line-9>
<line-10> a = list_input()</line-10>
<line-11> a.so... | {"code": "<line-4>def list_input(): return list(map(int, input().split()))</line-4>\n<line-19> ans = (ans * (pow(levels[i - 1], levels[i], mod))) % mod</line-19>", "lines": [4, 19]}
#### 0 |
<line-1>t=int(input())</line-1>
<line-3> n,k,l=map(int,input().split())</line-3>
<line-4> if k*l<n:</line-4>
<line-5> print(-1)</line-5>
<line-6> elif (k==1 and n>1):</line-6>
<line-7> print(-1)</line-7>
<line-8> else:</line-8>
<line-9> for j in range(n):</line-9>
<line-11> print()</line-11> | {"code": "<line-2>for i in range(t):</line-2>\n<line-10> print((j%k)+1,end=' ')</line-10>", "lines": [2, 10]}
#### 0 |
<line-1>test=int(input())</line-1>
<line-3> n=int(input())</line-3>
<line-4> a=list(map(int,input().split()))</line-4>
<line-5> b=[0]*(n+2)</line-5>
<line-6> b[n-1]=1</line-6>
<line-7> for i in range(n-2,-1,-1):</line-7>
<line-8> if(a[i]*a[i+1]<0):</line-8>
<line-9> b[i]=b[i+1]+1</line-9>
<line-10> else:</line-10>
... | {"code": "<line-2>for i in range(test):</line-2>\n<line-13> print(b[i], end=' ')</line-13>", "lines": [2, 13]}
#### 0 |
<line-1># cook your dish here</line-1>
<line-3>t=int(input())</line-3>
<line-4>for i in range(t):</line-4>
<line-5> s,e,l,r=map(str,input().split())</line-5>
<line-6> l,r=int(l),int(r)</line-6>
<line-7> v=(d.index(e)-d.index(s)+8)%7</line-7>
<line-8> c=r+1</line-8>
<line-9> for i in range(l,r+1):</line-9>
<line-10> if... | {"code": "<line-2>d=[\"saturday\",\"sunday\",\"monday\",\"tuesday\",\"wednesday\",\"thursday\",\"friday\"]</line-2>\n<line-17> else:</line-17>", "lines": [2, 17]}
#### 0 |
<line-1># cook your dish here</line-1>
<line-3>def dist(a,b):</line-3>
<line-4> return abs(a[0]-b[0])+abs(a[1]-b[1])</line-4>
<line-5>n, m = map(int, input().split())</line-5>
<line-6>matrix=[]</line-6>
<line-7>id_matrix=[[0 for i in range(n)] for i in range(n)]</line-7>
<line-8>for _ in range(n):</line-8>
<line-9> ... | {"code": "<line-2>import sys </line-2>\n<line-61> print('YES')</line-61>", "lines": [2, 61]}
#### 0 |
<line-1># cook your dish here</line-1>
<line-3>count = 0</line-3>
<line-4>for _ in range(n):</line-4>
<line-5> L = list(map(int, input().split()))</line-5>
<line-6> if (L.count(1)>=2):</line-6>
<line-8> </line-8>
<line-9>print(count)</line-9> | {"code": "<line-2>n = int(input())</line-2>\n<line-7> count+=1</line-7>", "lines": [2, 7]}
#### 0 |
<line-2>a=list(map(int,input().split()))</line-2>
<line-3>a.sort()</line-3>
<line-4>print(a[-1],a[0])</line-4> | {"code": "<line-1>n=int(input())</line-1>", "lines": [1]}
#### 0 |
<line-1>from collections import Counter</line-1>
<line-3>for k in range(tc):</line-3>
<line-4> n=int(input())</line-4>
<line-5> a=list(map(int, input().rstrip().split()))</line-5>
<line-6> b= list(map(int, input().rstrip().split()))</line-6>
<line-7> cc=sorted(a+b)</line-7>
<line-8> #print('cc = ',cc)</line-8>
<line-9>... | {"code": "<line-2>tc=int(input())</line-2>\n<line-64> i += 1'''</line-64>", "lines": [2, 64]}
#### 0 |
<line-1>import math</line-1>
<line-3> count = 0</line-3>
<line-4> while (n): </line-4>
<line-5> n &= (n-1) </line-5>
<line-6> count+= 1</line-6>
<line-7> </line-7>
<line-8> return count</line-8>
<line-9>def f(ca,cb,i,cf,C,n,dp):</line-9>
<line-10> if ca<0 or cb<0:</line-10>
<line-11> return 0</line-11>
<line-12> if... | {"code": "<line-2>def csb(n): </line-2>\n<line-41> print(f(csb(a),csb(b),0,0,c,n,dp))</line-41>", "lines": [2, 41]}
#### 0 |
<line-1>cards = ['A','2','3','4','5','6','7','8','9','T','J','Q','K']</line-1>
<line-2></line-2>
<line-4> nonlocal ans, confirm</line-4>
<line-5> rf_set = 'TJQKA'</line-5>
<line-6> rf = 1</line-6>
<line-7> for char in arr:</line-7>
<line-8> if char[0] not in rf_set:</line-8>
<line-9> rf = 0</line-9>
<line-10> brea... | {"code": "<line-3>def royal_flush(arr):</line-3>\n<line-103> two_pairs(cards_set[1])</line-103>", "lines": [3, 103]}
#### 0 |
<line-1>import numpy as np</line-1>
<line-3> n = int(input())-1;soldiers = [int(j) for j in input().split()]</line-3>
<line-4> force = int(input());attacks = np.zeros(2*n,dtype=int);attacks[:n] = np.array(soldiers);attacks[n:2*n] = attacks[:n];shield = [0 for _ in range(n)];pow_of_2 = 1</line-4>
<line-5> while n ... | {"code": "<line-2>for _ in range(int(input())):</line-2>\n<line-27> for i in range(n):</line-27>", "lines": [2, 27]}
#### 0 |
<line-1>t=int(input())</line-1>
<line-3> n=int(input())</line-3>
<line-4> l=[]</line-4>
<line-5> for i in range(n):</line-5>
<line-6> l.append(list(map(int,input().split())));</line-6>
<line-7> m=[]</line-7>
<line-8> for i in l:</line-8>
<line-9> m.append((i[1]//(i[0]+1))*i[2])</line-9>
<line-10> res=max(m)</line-10>... | {"code": "<line-2>while(t):</line-2>\n<line-11> print(res)</line-11>", "lines": [2, 11]}
#### 0 |
<line-1># Why do we fall ? So we can learn to pick ourselves up.</line-1>
<line-2></line-2>
<line-3></line-3>
<line-4></line-4>
<line-5></line-5>
<line-7>for _ in range(0,t):</line-7>
<line-8> n = int(input())</line-8>
<line-9> abc = [int(i) for i in input().split()]</line-9>
<line-10></line-10>
<line-11> i = ... | {"code": "<line-6>t = int(input())</line-6>\n<line-67>3</line-67>", "lines": [6, 67]}
#### 0 |
<line-1># cook your dish here</line-1>
<line-3> n,q=map(int,input().split())</line-3>
<line-4> l=[int(i) for i in input().split()]</line-4>
<line-5> qry=[int(input()) for i in range(q)]</line-5>
<line-6> def cmp(sub1,sub2):</line-6>
<line-7> for i in range(len(sub1)):</line-7>
<line-8> if sub1[i]>sub2[i]:</line-8>
<... | {"code": "<line-2>for _ in range(int(input())):</line-2>\n<line-18> for i in qry:</line-18>", "lines": [2, 18]}
#### 0 |
<line-1>from fractions import gcd</line-1>
<line-3> n = eval(input())</line-3>
<line-4> if n == 1:</line-4>
<line-5> print('1')</line-5>
<line-6> elif n == 2:</line-6>
<line-7> print('2')</line-7>
<line-8> elif n == 3:</line-8>
<line-9> print('6')</line-9>
<line-10> else:</line-10>
<line-11> c = n*(n-1)</line-11>
<... | {"code": "<line-2>for testCases in range(eval(input())):</line-2>\n<line-22> k1 -= 1</line-22>", "lines": [2, 22]}
#### 0 |
<line-1>#from itertools import combinations as c</line-1>
<line-3>l1=[]</line-3>
<line-4>if(n<3):</line-4>
<line-5> print("NO")</line-5>
<line-6>else:</line-6>
<line-7> l.sort()</line-7>
<line-8> for i in range(n-2):</line-8>
<line-9> if(l[i]+l[i+1]>l[i+2]):</line-9>
<line-10> l1.append([l[i+... | {"code": "<line-2>n=int(input());l=list(map(int,input().split()))</line-2>\n<line-14>else:</line-14>", "lines": [2, 14]}
#### 0 |
<line-1># cook your dish here</line-1>
<line-3> </line-3>
<line-4>def BinarySearch(a, x): </line-4>
<line-5> i = bisect_left(a, x) </line-5>
<line-6> if i != len(a) and a[i] == x: </line-6>
<line-7> return i </line-7>
<line-8> else: </line-8>
<line-9> return -1</line-9>
<line-10></line-10>
<line-11>for _t in range(in... | {"code": "<line-2>from bisect import bisect_left </line-2>\n<line-25> else:</line-25>", "lines": [2, 25]}
#### 0 |
<line-1>try:</line-1>
<line-3> arr=list(map(int, input().split()))</line-3>
<line-4> forward = [0]*(n+1)</line-4>
<line-5> backward= [0]*(n+1)</line-5>
<line-6> backward[0]=arr[0]</line-6>
<line-7> backward[1]=arr[0]+arr[1]</line-7>
<line-8> for i in range(k, n):</line-8>
<line-9> forward[i]=arr[i... | {"code": "<line-2> n, k=map(int, input().split())</line-2>\n<line-18>except Exception:</line-18>", "lines": [2, 18]}
#### 0 |
<line-1># cook your dish here</line-1>
<line-3> n = int(input())</line-3>
<line-4> a = list(map(int, input().split()))</line-4>
<line-5> curr = 0</line-5>
<line-6> ans = 0</line-6>
<line-7> for x in a:</line-7>
<line-8> curr += x</line-8>
<line-10> print(ans)</line-10> | {"code": "<line-2>for _ in range(int(input())):</line-2>\n<line-9> ans += abs(curr)</line-9>", "lines": [2, 9]}
#### 0 |
<line-1>#dt = {} for i in x: dt[i] = dt.get(i,0)+1</line-1>
<line-3>inp,ip = lambda :int(input()),lambda :[int(w) for w in input().split()]</line-3>
<line-4></line-4>
<line-5>n,k = ip()</line-5>
<line-6>x = ip()</line-6>
<line-7>x.sort()</line-7>
<line-8>if k == 1:</line-8>
<line-9> a = x[n//2]</line-9>
<line-10> ... | {"code": "<line-2>import sys;input = sys.stdin.readline</line-2>\n<line-19>else:</line-19>", "lines": [2, 19]}
#### 0 |
<line-1>for _ in range(int(input())):</line-1>
<line-3></line-3>
<line-4></line-4>
<line-5> def maxConsequtiveOnes(lst):</line-5>
<line-6> _max = 0</line-6>
<line-7> _ones = [0]</line-7>
<line-8> for i in lst:</line-8>
<line-9> if i == 0:</line-9>
<line-10> _max += 1</line-10>
<line-11> if i == 1:</line-11>
<... | {"code": "<line-2> n=int(input())</line-2>\n<line-21> else:</line-21>", "lines": [2, 21]}
#### 0 |
<line-1># cook your dish here</line-1>
<line-3>primes = {2,3,5,7,11,13,17}</line-3>
<line-4>edges = [(0,3),(0,1),(1,2),(1,4),(2,5),(3,4),(3,6),(4,5),(4,7),(5,8),(6,7),(7,8)]</line-4>
<line-5>x = [1,2,3,4,5,6,7,8,9]</line-5>
<line-6>avail = {tuple(x):0}</line-6>
<line-7>q = deque([x])</line-7>
<line-8>while q:</line-8>
... | {"code": "<line-2>from collections import deque</line-2>\n<line-28> else: print(-1);</line-28>", "lines": [2, 28]}
#### 0 |
<line-1>def bookList():</line-1>
<line-3> bookNum=[int(x) for x in input().split()]</line-3>
<line-4> takenBooks=int(input())</line-4>
<line-5> for i in range(takenBooks):</line-5>
<line-6> takenBookPos=(int(input()))</line-6>
<line-7> a=bookNum[takenBookPos-1]</line-7>
<line-8> print(a)</... | {"code": "<line-2> numBooks=int(input())</line-2>\n<line-9> bookNum.remove(a)</line-9>", "lines": [2, 9]}
#### 0 |
<line-1>for _ in range(int(input())):</line-1>
<line-3> l=list(map(int,input().split()))</line-3>
<line-4> su=l[0]</line-4>
<line-5> for i in range(1,n):</line-5>
<line-7> print(su)</line-7> | {"code": "<line-2> n=int(input())</line-2>\n<line-6> su^=l[i]</line-6>", "lines": [2, 6]}
#### 0 |
<line-1># cook your dish here</line-1>
<line-3> n=int(input())</line-3>
<line-4> a=[int(x) for x in input().split()]</line-4>
<line-5> sum=0</line-5>
<line-6> for i in range(n):</line-6>
<line-7> if a[i]%2==0:</line-7>
<line-8> sum+=1</line-8>
<line-9> a[i]=sum </line-9>
<line-10> q=int(input())</line-10>
<line-11>... | {"code": "<line-2>for _ in range(int(input())):</line-2>\n<line-20> print(\"EVEN\")</line-20>", "lines": [2, 20]}
#### 0 |
<line-1>T=int(input())</line-1>
<line-3> x,y=map(int,input().split())</line-3>
<line-4> while(y): </line-4>
<line-5> x, y = y, x % y</line-5>
<line-6> if x==1:</line-6>
<line-7> print("YES")</line-7>
<line-8> else:</line-8>
<line-10> T-=1</line-10> | {"code": "<line-2>while T:</line-2>\n<line-9> print(\"NO\")</line-9>", "lines": [2, 9]}
#### 0 |
<line-1># cook your dish here</line-1>
<line-3> n,m = list(map(int,input().split()))</line-3>
<line-4> colors = [0]*41; cost = [0]*41</line-4>
<line-5> color = 0</line-5>
<line-6> for i in range(n):</line-6>
<line-7> cc,pp = list(map(int,input().split()))</line-7>
<line-8> colors[cc] += 1</lin... | {"code": "<line-2>for _ in range(int(input())):</line-2>\n<line-24> den += dp2[i][40]</line-24>", "lines": [2, 24]}
#### 0 |
<line-1>for _ in range(int(input())):</line-1>
<line-3> ls = []</line-3>
<line-4> rs = []</line-4>
<line-5> lrs = []</line-5>
<line-6></line-6>
<line-7> for i in range(n):</line-7>
<line-8> l, r = map(int, input().split())</line-8>
<line-9> ls.append(l)</line-9>
<line-10> rs.append(r)</line-10>
<line-11> lrs.append... | {"code": "<line-2> n = int(input())</line-2>\n<line-30> res[i] = c</line-30>", "lines": [2, 30]}
#### 0 |
<line-1>def main():</line-1>
<line-3> [n, m] = [int(i) for i in input().split()]</line-3>
<line-4> if n == m and n == 0:</line-4>
<line-5> break</line-5>
<line-6> cache = {}</line-6>
<line-7> for i in range(n):</line-7>
<line-8> ... | {"code": "<line-2> while True:</line-2>\n<line-20> main()</line-20>", "lines": [2, 20]}
#### 0 |
<line-1># cook your dish here</line-1>
<line-2></line-2>
<line-4></line-4>
<line-5> </line-5>
<line-6></line-6>
<line-7>t = int(input())</line-7>
<line-8>while t:</line-8>
<line-9> t-=1</line-9>
<line-10> c=0</line-10>
<line-11> ar=[int(i) for i in input().strip().split()]</line-11>
<line-12> for i in range(1,16):</lin... | {"code": "<line-3># cook your dish here</line-3>\n<line-21> break</line-21>", "lines": [3, 21]}
#### 0 |
<line-1>from sys import stdin,stdout</line-1>
<line-3>n=int(input())</line-3>
<line-4>a=[[] for i in range(n)]</line-4>
<line-5>for i in range(n-1):</line-5>
<line-6> u,v=map(int,input().split())</line-6>
<line-7> a[u-1].append(v-1)</line-7>
<line-8> a[v-1].append(u-1)</line-8>
<line-9>b=[0]*n</line-9>
<line-1... | {"code": "<line-2>input=stdin.readline</line-2>\n<line-67> ans+=1</line-67>", "lines": [2, 67]}
#### 0 |
<line-1>testcase = int(input())</line-1>
<line-3> n = int(input())</line-3>
<line-5> print('\n') </line-5> | {"code": "<line-2>for case in range(testcase):</line-2>\n<line-4> print(2**(n-2)+1)</line-4>", "lines": [2, 4]}
#### 0 |
<line-1># This is not my code, it's Snehasish Karmakar's. Refer to http://www.codechef .com/viewsolution/7153774</line-1>
<line-3># Submitting it to try and work out if it can be sped up.</line-3>
<line-4></line-4>
<line-5>def compute_nCr(n,r) :</line-5>
<line-6> C[0][0]=1</line-6>
<line-7> for i in range(1,n+1) :<... | {"code": "<line-2># for original version.</line-2>\n<line-38> print(solve(n,m))</line-38>", "lines": [2, 38]}
#### 0 |
<line-1>try:</line-1>
<line-3> for i in range(t):</line-3>
<line-4> n,k=map(int,input().split())</line-4>
<line-5> s=input()</line-5>
<line-6> l=[-1]*len(s)</line-6>
<line-7> numb=s.count('b')</line-7>
<line-8> x=numb</line-8>
<line-9> for j in range(len(s)):</line-9>
<line-... | {"code": "<line-2> t=int(input())</line-2>\n<line-22>except:</line-22>", "lines": [2, 22]}
#### 0 |
<line-1>for i in range(int(input())):</line-1>
<line-3> b=input().split()</line-3>
<line-4> if '0' in b:</line-4>
<line-5> print(100*(a-b.index('0'))+b.count('0')*1000)</line-5>
<line-7> print(0)</line-7> | {"code": "<line-2> a=int(input())</line-2>\n<line-6> else:</line-6>", "lines": [2, 6]}
#### 0 |
<line-1># cook your dish here</line-1>
<line-3>from itertools import combinations</line-3>
<line-4>n = int(input())</line-4>
<line-5>t = list(combinations(list(map(int, input().split())), 2))</line-5>
<line-6>ar = 0</line-6>
<line-7>for i in t:</line-7>
<line-9>print(ar)</line-9> | {"code": "<line-2># cook your dish here</line-2>\n<line-8> ar += abs(i[0] - i[1])</line-8>", "lines": [2, 8]}
#### 0 |
<line-1>for _ in range(int(input())):</line-1>
<line-3> a=input()</line-3>
<line-4> b=input()</line-4>
<line-5> l=[]</line-5>
<line-6> flag=0</line-6>
<line-7> for i in range(n):</line-7>
<line-8> if b[i]!=a[i]:</line-8>
<line-9> if b[i] in a and b[i]<a[i]:</line-9>
<line-10> l.append(b[i])</line-10>
<line-11> ... | {"code": "<line-2> n=int(input())</line-2>\n<line-32> q.append(k)</line-32>", "lines": [2, 32]}
#### 0 |
<line-1>for _ in range(int(input())):</line-1>
<line-3> n,m=int(n),int(m)</line-3>
<line-4> x=y=c=0</line-4>
<line-5> l=list(map(int,input().split()))</line-5>
<line-6> for i in range(n):</line-6>
<line-7> for j in range(i,n):</line-7>
<line-8> x=x+l[j]</line-8>
<line-9> if (x%m)>y:</line-9>
<line-10> y=x%m</li... | {"code": "<line-2> n,m=input().split()</line-2>\n<line-14> x = 0</line-14>", "lines": [2, 14]}
#### 0 |
<line-1>def fact(n):</line-1>
<line-3> return 1</line-3>
<line-4> return n * fact(n-1)</line-4>
<line-5> </line-5>
<line-6>def ncr(n, r):</line-6>
<line-7> return fact(n)// (fact(r)*fact(n-r))</line-7>
<line-8> </line-8>
<line-9>t=int(input())</line-9>
<line-10></line-10>
<line-11>for _ in range(t):</line-11>
<line-12... | {"code": "<line-2> if n<2:</line-2>\n<line-16> count_z_seq = a[:k].count(a[k-1])</line-16>", "lines": [2, 16]}
#### 0 |
<line-1>import sys</line-1>
<line-2></line-2>
<line-4> s=sys.stdin.readline</line-4>
<line-5> n, m = list(map(int, s().split()))</line-5>
<line-6> nums={}</line-6>
<line-7> for i in range(1, n+1):</line-7>
<line-8> nums[i]=list(map(int, s().split()))</line-8>
<line-9> cases=int(s())</line-9>
<line-10> for case in rang... | {"code": "<line-3>def main():</line-3>\n<line-19> main()</line-19>", "lines": [3, 19]}
#### 0 |
<line-1>a=int(input())</line-1>
<line-3> c,d=list(map(int,input().split()))</line-3>
<line-4> crr=[[[0,0] for i in range(c+1)] for j in range(c+1)]</line-4>
<line-5> trr=[]</line-5>
<line-6> for i in range(c):</line-6>
<line-7> kk=list(input().split())</line-7>
<line-8> trr.append(kk)</line-8>... | {"code": "<line-2>for _ in range(a):</line-2>\n<line-33> m,n=list(map(int,input().split()))</line-33>", "lines": [2, 33]}
#### 0 |
<line-1>t = eval(input())</line-1>
<line-3> n, m = list(map(int, input().split()))</line-3>
<line-4> if n*m == 2:</line-4>
<line-5> print('Yes')</line-5>
<line-6> elif (n*m)%2 == 0 and m != 1 and n != 1:</line-6>
<line-7> print('Yes')</line-7>
<line-9> print('No')</line-9> | {"code": "<line-2>for _ in range(t):</line-2>\n<line-8> else:</line-8>", "lines": [2, 8]}
#### 0 |
<line-1>def bestMovie():</line-1>
<line-3> for t in range(tests):</line-3>
<line-4> n = int(input())</line-4>
<line-5> L = list(map(int, input().split()))</line-5>
<line-6> R = list(map(int, input().split()))</line-6>
<line-7> maxIndex = -1</line-7>
<line-8> maxValue = 0</line-8>
<line-9> for i in range(n):</line... | {"code": "<line-2> tests=int(input())</line-2>\n<line-17> print(maxIndex+1)</line-17>", "lines": [2, 17]}
#### 0 |
<line-1>for t in range(eval(input())):</line-1>
<line-3> n-=n%10</line-3>
<line-5> print(n*(n+1)/2*10)</line-5> | {"code": "<line-2> n=eval(input())</line-2>\n<line-4> n/=10</line-4>", "lines": [2, 4]}
#### 0 |
<line-1>T = int(input())</line-1>
<line-3> x = int(input())</line-3>
<line-4> l= [int(x) for x in input().split()]</line-4>
<line-5> t=[]</line-5>
<line-6> for i in range(len(l)):</line-6>
<line-8> print(max(t))</line-8> | {"code": "<line-2>for i in range(T):</line-2>\n<line-7> t.append(l[i]+i) </line-7>", "lines": [2, 7]}
#### 0 |
<line-1>def isSubsetSum(arr, n, sum): </line-1>
<line-3> for i in range(n + 1): </line-3>
<line-4> for j in range(sum + 1): </line-4>
<line-5> if (j == 0):subset[i % 2][j] = True</line-5>
<line-6> elif (i == 0):subset[i % 2][j] = False</line-6>
<line-7> elif (arr[i - 1] <= j):... | {"code": "<line-2> subset = [ [False for j in range(sum + 1)] for i in range(3) ] </line-2>\n<line-12> if sum(a) < k or k < min(a):print(0);continue</line-12>", "lines": [2, 12]}
#### 0 |
<line-1>def func(num):</line-1>
<line-3> if i < num//2 + 1:</line-3>
<line-4> print(' '*i, end='')</line-4>
<line-5> print('*')</line-5>
<line-6> else:</line-6>
<line-7> print(' '*(num-i-1), end='')</line-7>
<line-8> print('*')</line-8>
<line-9></line-9>
<line-1... | {"code": "<line-2> for i in range(num):</line-2>\n<line-13> num = int(input())</line-13>", "lines": [2, 13]}
#### 0 |
<line-1>M = 10 ** 9 + 7</line-1>
<line-3> s,p,m,r = list(map(int, input())),0,1,0</line-3>
<line-4> for d in reversed(s):</line-4>
<line-5> p += d * m</line-5>
<line-6> m = m * 10 % M</line-6>
<line-7> for d in s:</line-7>
<line-8> r = (r * m + p) % M</line-8>
<line-10> print(r)</line-1... | {"code": "<line-2>for _ in range(int(input())):</line-2>\n<line-9> p = (p * 10 - (m - 1) * d) % M</line-9>", "lines": [2, 9]}
#### 0 |
<line-1>t=int(input())</line-1>
<line-3> n=int(input())</line-3>
<line-4> b=1</line-4>
<line-5> if n%2:</line-5>
<line-6> c=n-2</line-6>
<line-7> for j in range(n//2):</line-7>
<line-8> print(" "*j+str(b) +" "*c+ str(b))</line-8>
<line-9> b+=1</line-9>
<line-10> c... | {"code": "<line-2>for _ in range(t):</line-2>\n<line-27> b+=1</line-27>", "lines": [2, 27]}
#### 0 |
<line-1>t=int(input())</line-1>
<line-3> n=int(input())</line-3>
<line-4> </line-4>
<line-5> grid=[]</line-5>
<line-6> for _ in range(n):</line-6>
<line-7> temp=[]</line-7>
<line-8> temp=list(map(int,input().strip().split()))</line-8>
<line-9> temp.sort()</line-9>
<line-10> grid.append(temp)</line-10>
<line-11> </... | {"code": "<line-2>for _ in range(t):</line-2>\n<line-26> break</line-26>", "lines": [2, 26]}
#### 0 |
<line-1>def getInput():</line-1>
<line-3> N =int(N_k[0])</line-3>
<line-4> k =int(N_k[1])</line-4>
<line-5> list = []</line-5>
<line-6> output = []</line-6>
<line-7> count = 0</line-7>
<line-8> for i in range(0,k):</line-8>
<line-9> val = input()</line-9>
<line-10> if(val!="CLOSEALL"):</line-10>
<line-11> val=val.s... | {"code": "<line-2> N_k = input().split()</line-2>\n<line-25> print(each)</line-25>", "lines": [2, 25]}
#### 0 |
<line-1>def __gcd(a, b): </line-1>
<line-2> </line-2>
<line-4> if (a == 0 or b == 0): </line-4>
<line-5> return 0; </line-5>
<line-6> </line-6>
<line-7> # base case </line-7>
<line-8> if (a == b): </line-8>
<line-9> return a; </line-9>
<line-10> </line-10>
<line-11> # a is greater </line-11>
<line-12> if (a > b): </... | {"code": "<line-3> # Everything divides 0 </line-3>\n<line-31> c,d=map(int,input().split())</line-31>", "lines": [3, 31]}
#### 0 |
<line-1>K,A,B = map(int,input().split())</line-1>
<line-2> </line-2>
<line-4> print(K + 1)</line-4>
<line-5> return</line-5>
<line-6> </line-6>
<line-7>start = A - 1</line-7>
<line-8>K -= start</line-8>
<line-10>print(ans)</line-10> | {"code": "<line-3>if A + 2 > B:</line-3>\n<line-9>ans = K//2 * (B-A) + K%2 + start + 1</line-9>", "lines": [3, 9]}
#### 0 |
<line-1>a= [0, 0, 1, 1, 2, 0, 3, 1, 1, 0, 3, 3, 2, 2, 4, 0, 5, 2, 2, 3, 3, 0, 1, 1, 3, 0, 2, 1, 1, 0, 4, 5, 2, 7, 4, 0, 1, 1, 2, 0, 3, 1, 1, 0, 3, 3, 2, 2, 4, 4, 5, 5, 2, 3, 3, 0, 1, 1, 3, 0, 2, 1, 1, 0, 4, 5, 3, 7, 4, 8, 1, 1, 2, 0, 3, 1, 1, 0, 3, 3, 2, 2, 4, 4, 5, 5, 9, 3, 3, 0, 1, 1, 3, 0, 2, 1, 1, 0, 4, 5, 3, 7, 4,... | {"code": "<line-3>t = int(input())</line-3>\n<line-9>\telse:</line-9>", "lines": [3, 9]}
#### 0 |
<line-1># cook your dish here</line-1>
<line-3>T = int(input())</line-3>
<line-4></line-4>
<line-5>for i in range(T):</line-5>
<line-6> N,data = int(input()),list(map(int,input().split()))</line-6>
<line-7> if(N==3):</line-7>
<line-8> print(sum(data))</line-8>
<line-9> else:</line-9>
<line-10> be... | {"code": "<line-2>#Moony and ICPC team</line-2>\n<line-20> best = l</line-20>", "lines": [2, 20]}
#### 0 |
<line-1>n=eval(input())</line-1>
<line-3>c=m=0</line-3>
<line-4>maxi=max(a)</line-4>
<line-5>for i in range(n):</line-5>
<line-6> if a[i]==maxi:</line-6>
<line-7> c+=1</line-7>
<line-8> m=max(c,m)</line-8>
<line-9> else:</line-9>
<line-11>print(m) </line-11> | {"code": "<line-2>a=list(map(int,input().split()))</line-2>\n<line-10> c=0</line-10>", "lines": [2, 10]}
#### 0 |
<line-1>from math import gcd</line-1>
<line-2></line-2>
<line-4></line-4>
<line-5></line-5>
<line-6>def test():</line-6>
<line-7> n = int(input())</line-7>
<line-8> a = list(map(int, input().split()))</line-8>
<line-9> a = list(set(a))</line-9>
<line-10> n = len(a)</line-10>
<line-11> if len(a) == 1:</li... | {"code": "<line-3>__author__ = 'Prateek'</line-3>\n<line-35> for _ in range(t):</line-35>", "lines": [3, 35]}
#### 0 |
<line-2> n,k=map(int,input().split())</line-2>
<line-3> print(((2*n*(k-1))+2)/k)</line-3> | {"code": "<line-1>for _ in range(int(input())):</line-1>", "lines": [1]}
#### 0 |
<line-1>t=int(input())</line-1>
<line-3> n=int(input())</line-3>
<line-4> for i in range(0,n):</line-4>
<line-5> for j in range(0,n):</line-5>
<line-6> if i%2==0:</line-6>
<line-7> if j%2==0:</line-7>
<line-8> print(0,end="")</line-8>
<line-9> els... | {"code": "<line-2>for t in range(t):</line-2>\n<line-15> print(0,end=\"\")</line-15>", "lines": [2, 15]}
#### 0 |
<line-1># cook your dish here</line-1>
<line-3>for i in range(t):</line-3>
<line-4> n=int(input())</line-4>
<line-5> if n<101:</line-5>
<line-6> l1=[]</line-6>
<line-7> l2=[]</line-7>
<line-8> d=dict()</line-8>
<line-9> for i in range(1,2*n+1):</line-9>
<line-10> if i%2==0:</line-10>
<line-11> l1.append(int(in... | {"code": "<line-2>t=int(input())</line-2>\n<line-25> print(0)</line-25>", "lines": [2, 25]}
#### 0 |
<line-1># cook your dish here</line-1>
<line-3> n = int(input())</line-3>
<line-4> arr = list(map(int,input().split()))</line-4>
<line-5> l = []</line-5>
<line-6> for i in range(0, len(arr)): </line-6>
<line-7> for j in range(i+1, len(arr)): </line-7>
<line-8> if(arr[i] == arr[j]): ... | {"code": "<line-2>for _ in range(int(input())):</line-2>\n<line-12> else:</line-12>", "lines": [2, 12]}
#### 0 |
<line-2>for i in range(oo):</line-2>
<line-3> val = input()</line-3>
<line-4> print(val[::-1])</line-4> | {"code": "<line-1>oo = int(input())</line-1>", "lines": [1]}
#### 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> a = {}</line-6>
<line-7> </line-7>
<line-8> for i in range(n):</line-8>
<line-9> l = input()</line-9>
<line-10> </line-10>
<line-11> if l not in a:</line-11>
<line-12> ... | {"code": "<line-3>for _ in range(t):</line-3>\n<line-39> a[v1] = 0</line-39>", "lines": [3, 39]}
#### 0 |
<line-1>testcases = int(input())</line-1>
<line-2></line-2>
<line-4> n = int(input())</line-4>
<line-5> my = list(map(int,input().split()))</line-5>
<line-6> opp = list(map(int,input().split()))</line-6>
<line-7> </line-7>
<line-8> my.sort(reverse = True)</line-8>
<line-9> opp.sort(reverse = True)</line-9>
<line-10> </... | {"code": "<line-3>for i in range(testcases):</line-3>\n<line-16> k += 1</line-16>", "lines": [3, 16]}
#### 0 |
<line-1># cook your dish here</line-1>
<line-3>while t>0:</line-3>
<line-4> n=int(input())</line-4>
<line-5> if n==1:</line-5>
<line-6> print(1)</line-6>
<line-7> else:</line-7>
<line-8> c,num=1,2</line-8>
<line-9> while num<n:</line-9>
<line-10> num*=2</line-10>
<line-11> ... | {"code": "<line-2>t=int(input())</line-2>\n<line-14> print(num//2)</line-14>", "lines": [2, 14]}
#### 0 |
<line-1>import math</line-1>
<line-3>import random</line-3>
<line-4>import re</line-4>
<line-5>import sys</line-5>
<line-6></line-6>
<line-7></line-7>
<line-8>r = 100000</line-8>
<line-9>prev = 1</line-9>
<line-10>s = set()</line-10>
<line-11>for i in range(1, r+1):</line-11>
<line-12> now = i ^ prev</line-12>
<line... | {"code": "<line-2>import os</line-2>\n<line-30> else:</line-30>", "lines": [2, 30]}
#### 0 |
<line-1># cook your dish here</line-1>
<line-3>T = int(input())</line-3>
<line-4>for _ in range(T):</line-4>
<line-5> N, H = map(int, input().split())</line-5>
<line-6> A = list(map(int, input().split()))</line-6>
<line-7> low, high = 1, max(A)</line-7>
<line-8> while low != high:</line-8>
<line-9> time = 0</line-9>
<... | {"code": "<line-2>import math</line-2>\n<line-17> low = mid + 1</line-17>", "lines": [2, 17]}
#### 0 |
<line-1>#!/usr/bin/env python</line-1>
<line-2></line-2>
<line-4>def fibo():</line-4>
<line-5> for i in range(500):</line-5>
<line-6> F.append(F[-2] + F[-1])</line-6>
<line-7></line-7>
<line-8>def main():</line-8>
<line-9> fibo()</line-9>
<line-10> #print len(str(F[-1]))</line-10>
<line-11> #print len(str(10**100))</l... | {"code": "<line-3>F = [1,1]</line-3>\n<line-18> break</line-18>", "lines": [3, 18]}
#### 0 |
<line-1>cases = int(input())</line-1>
<line-2></line-2>
<line-4> N, M, K = [int(i) for i in input().split()]</line-4>
<line-5> A = [int(i) for i in input().split()]</line-5>
<line-6> jad = 0</line-6>
<line-7> P = M*K</line-7>
<line-8></line-8>
<line-9> for milk in A:</line-9>
<line-10> if(milk>P):</line-10>
<line-11> ... | {"code": "<line-3>for case in range(cases):</line-3>\n<line-13> jad += milk%K</line-13>", "lines": [3, 13]}
#### 0 |
<line-1>n=int(input())</line-1>
<line-3>dp=[]</line-3>
<line-4>d={}</line-4>
<line-5>for i in range(n):</line-5>
<line-6> l.append(int(input()))</line-6>
<line-7> d[i]=[]</line-7>
<line-8> dp.append([0,0])</line-8>
<line-9></line-9>
<line-10>for i in range(n-1):</line-10>
<line-11> a,b=list(map(int,input().split()))</l... | {"code": "<line-2>l=[]</line-2>\n<line-31>#print(dp)</line-31>", "lines": [2, 31]}
#### 0 |
<line-1>testCases = int(input())</line-1>
<line-3> n, k = list(map(int, input().split()))</line-3>
<line-4> sum = 0</line-4>
<line-5> i = 0</line-5>
<line-6> power = 1</line-6>
<line-7> while i <= n:</line-7>
<line-8> if k**power == i:</line-8>
<line-9> power += 1</line-9>
<line-10> else:</line-10>
<line-11> sum ... | {"code": "<line-2>for c in range(testCases):</line-2>\n<line-13> answer = \"Case #\" + str(c + 1) + \": \" + str(sum)</line-13>", "lines": [2, 13]}
#### 0 |
<line-1>try:</line-1>
<line-2> </line-2>
<line-4> n = int(input())</line-4>
<line-5> print(0) if(n==1) else print(pow(2,n-1,10**9+7)-2) </line-5>
<line-7> pass</line-7>
<line-8></line-8>
<line-9> </line-9> | {"code": "<line-3> for _ in range(int(input())):</line-3>\n<line-6>except EOFError:</line-6>", "lines": [3, 6]}
#### 0 |
<line-1>t=int(input())</line-1>
<line-3> n=int(input())</line-3>
<line-4> l=list(map(int,input().split()))</line-4>
<line-5> if sum(l)!=n or max(l)==n:</line-5>
<line-6> print('-1')</line-6>
<line-7> else:</line-7>
<line-8> d=dict()</line-8>
<line-9> ans=[-1]*n</line-9>
<line-10> for i in range(0,n):</line-10>
<lin... | {"code": "<line-2>for _ in range(t):</line-2>\n<line-33> break</line-33>", "lines": [2, 33]}
#### 0 |
<line-1>T = int(input())</line-1>
<line-3> W = list(map(int, input().strip().split()))</line-3>
<line-4> S = W[0]</line-4>
<line-5> W = W[1:]</line-5>
<line-6> W = W[::-1]</line-6>
<line-7> i = 0</line-7>
<line-8> c = 0</line-8>
<line-9> flag = 0</line-9>
<line-10> while (len(W) != 0 or flag != 1) and i<len(W):</line-1... | {"code": "<line-2>for _ in range(T):</line-2>\n<line-20> i += 1</line-20>", "lines": [2, 20]}
#### 0 |
<line-1>from bisect import insort</line-1>
<line-3>for _ in range(int(input())):</line-3>
<line-4> n,k=list(map(int,input().split( )))</line-4>
<line-5> array=list(map(int,input().split( )))</line-5>
<line-6> ans=0</line-6>
<line-7> index=[]</line-7>
<line-8> for i in range(1,n+1):</line-8>
<line-9> index.append(ceil(... | {"code": "<line-2>from math import ceil</line-2>\n<line-21> ans+=1</line-21>", "lines": [2, 21]}
#### 0 |
<line-1>x = input()</line-1>
<line-3>z = x.find(y)</line-3>
<line-4>if z == -1 :</line-4>
<line-5> print('N')</line-5>
<line-7> print('Y')</line-7> | {"code": "<line-2>y = input()</line-2>\n<line-6>else :</line-6>", "lines": [2, 6]}
#### 0 |
<line-1># cook your dish here</line-1>
<line-3>from math import gcd,sqrt,floor,factorial,ceil</line-3>
<line-4>from bisect import bisect_left,bisect_right</line-4>
<line-5>import bisect;</line-5>
<line-6>import sys;</line-6>
<line-7>from sys import stdin,stdout</line-7>
<line-8>import os</line-8>
<line-9>sys.setrecursi... | {"code": "<line-2>import math;</line-2>\n<line-69> theta=function(l1,0,None,0)</line-69>", "lines": [2, 69]}
#### 0 |
<line-1>import sys</line-1>
<line-2></line-2>
<line-4># print(t)</line-4>
<line-5>for _ in range(t):</line-5>
<line-6> n,m = map(int,input().split());</line-6>
<line-7> s = [];</line-7>
<line-8> for i in range(n):</line-8>
<line-9> s.append(input())</line-9>
<line-10> ans = []</line-10>
<line-11> for i in range(n):</l... | {"code": "<line-3>t = int(input())</line-3>\n<line-64>\t\tpairs += ((res[i]*(res[i]-1))//2)</line-64>", "lines": [3, 64]}
#### 0 |
<line-1>for t in range(int(input())):</line-1>
<line-3> solvedbychef = 0</line-3>
<line-4> solvedbyappy = 0</line-4>
<line-5> for i in range(n+1):</line-5>
<line-6> if i % a == 0 and i % b == 0 :</line-6>
<line-7> continue</line-7>
<line-8> elif i%a == 0 :</line-8>
<line-9> solvedbyappy+=1</line-9>
<line-10> eli... | {"code": "<line-2> n, a , b , k = map(int,input().split())</line-2>\n<line-15> else :</line-15>", "lines": [2, 15]}
#### 0 |
<line-1>let_to_num = {'A':[0,5], 'B':[1,6], 'C':[2,7], 'D':[3,8], 'E':[4,9]}</line-1>
<line-2></line-2>
<line-4> 5:'A', 6:'B', 7:'C', 8:'D', 9:'E'}</line-4>
<line-5></line-5>
<line-6>connections = {0:(1,4,5), 1:(0,2,6), 2:(1,3,7), 3:(2,4,8), 4:(0,3,9), 5:(0,7,8),</line-6>
<line-7> 6:(1,8,9), ... | {"code": "<line-3>num_to_let = {0:'A', 1:'B', 2:'C', 3:'D', 4:'E',</line-3>\n<line-54> print(min(''.join(str(k) for k in out_1), ''.join(str(k) for k in out_2)))</line-54>", "lines": [3, 54]}
#### 0 |
<line-1>import math</line-1>
<line-3>for i in range(T):</line-3>
<line-4> N,M,S=input().split()</line-4>
<line-5> N=int(N)</line-5>
<line-6> M=int(M)</line-6>
<line-7> S=int(S)</line-7>
<line-8> ls=list(map(int,input().split()))</line-8>
<line-9> maxx=max(ls)</line-9>
<line-10> if S<17 and maxx<=50:</line-10>
<line-11>... | {"code": "<line-2>T=int(input())</line-2>\n<line-22> print(count)</line-22>", "lines": [2, 22]}
#### 0 |
<line-1>import sys</line-1>
<line-3>from collections import deque</line-3>
<line-4>from fractions import Fraction as f</line-4>
<line-5>from copy import *</line-5>
<line-6>from bisect import * </line-6>
<line-7>from heapq import *</line-7>
<line-8>from math import *</line-8>
<line-9>from itertools import permutations <... | {"code": "<line-2>from collections import defaultdict as dd</line-2>\n<line-72> flag|=c </line-72>", "lines": [2, 72]}
#### 0 |
<line-1>t=int(input())</line-1>
<line-2></line-2>
<line-4> n,x=map(int,input().split())</line-4>
<line-5> a=list(map(int,input().split()))</line-5>
<line-6> </line-6>
<line-7> mx=max(a)</line-7>
<line-8> mn=min(a)</line-8>
<line-9> </line-9>
<line-10> if (mx-mn<x):</line-10>
<line-11> print("YES")</line-11>
<line-13> ... | {"code": "<line-3>for t1 in range(t):</line-3>\n<line-12>\telse:</line-12>", "lines": [3, 12]}
#### 0 |
<line-1>t = int(input())</line-1>
<line-3> x, y, k, n = [int(x) for x in input().split()]</line-3>
<line-4> k = k*2</line-4>
<line-5> temp = abs(x-y)</line-5>
<line-6> if(temp%k == 0):</line-6>
<line-7> print("Yes")</line-7>
<line-9> print("No")</line-9> | {"code": "<line-2>for _ in range(t):</line-2>\n<line-8> else:</line-8>", "lines": [2, 8]}
#### 0 |
<line-1># cook your dish here</line-1>
<line-2></line-2>
<line-4> </line-4>
<line-5></line-5>
<line-6>def minstairs(n,k):</line-6>
<line-7> stairsHeight=[]</line-7>
<line-8> stairs=0</line-8>
<line-9> current = 0</line-9>
<line-10> stairsHeight=list(map(int, input().split()))</line-10>
<line-11> stairsHeight=np.array(s... | {"code": "<line-3>import numpy as np</line-3>\n<line-26> n,k =list(map(int,input().split()))</line-26>", "lines": [3, 26]}
#### 0 |
<line-1>for _ in range(int(input())):</line-1>
<line-3> ans = 0</line-3>
<line-4> for i in range(y, x+1, y):</line-4>
<line-5> if i%y == 0:</line-5>
<line-7> print(ans)</line-7> | {"code": "<line-2> x, y = map(int, input().split())</line-2>\n<line-6> ans += i%10</line-6>", "lines": [2, 6]}
#### 0 |
<line-2>for i in range(oo):</line-2>
<line-3> val = int(input())</line-3>
<line-4> print((val**2)*3.14)</line-4> | {"code": "<line-1>oo = int(input())</line-1>", "lines": [1]}
#### 0 |
<line-1># cook your dish here</line-1>
<line-3>for i in range(t):</line-3>
<line-4> n=int(input())</line-4>
<line-5> ar=list(map(int,input().split()))</line-5>
<line-6> tot=0</line-6>
<line-7> st=0</line-7>
<line-8> for j in range(1,n):</line-8>
<line-9> if(ar[j-1]>ar[j]):</line-9>
<line-10> si=j-st</line-10>
<line-... | {"code": "<line-2>t=int(input())</line-2>\n<line-16> tot+=c</line-16>", "lines": [2, 16]}
#### 0 |
<line-1>from collections import Counter</line-1>
<line-3> a = Counter(A)</line-3>
<line-4> b = Counter(B)</line-4>
<line-5> ans = 0</line-5>
<line-6> for i in a:</line-6>
<line-7> if i in b:</line-7>
<line-8> ans += min(a[i],b[i])</line-8>
<line-9> </line-9>
<line-10> return ... | {"code": "<line-2>def solve(A,B):</line-2>\n<line-17> B = input()</line-17>", "lines": [2, 17]}
#### 0 |
<line-1>for _ in range(int(input())):</line-1>
<line-3> a = list(map(int, input().split()))</line-3>
<line-4> s = set(a)</line-4>
<line-5></line-5>
<line-6> if n == 1 or len(s) > 2:</line-6>
<line-7> print(-1)</line-7>
<line-8> continue</line-8>
<line-9></line-9>
<line-10> if len(s) == 1:</line-10>
<line-11> x = s.p... | {"code": "<line-2> n = int(input())</line-2>\n<line-27> else:</line-27>", "lines": [2, 27]}
#### 0 |
<line-1>try:</line-1>
<line-3> s,s1=0,0</line-3>
<line-4> x,k=[int(i) for i in input().split()]</line-4>
<line-5> for i in range(2,x+1):</line-5>
<line-6> if(x%i==0):</line-6>
<line-7> s=s+i**k</line-7>
<line-8> for i in range(2,k+1):</line-8>
<line-9> if... | {"code": "<line-2> for _ in range(int(input())):</line-2>\n<line-12>except EOFError as e:</line-12>", "lines": [2, 12]}
#### 0 |
<line-1>from sys import stdin, stdout</line-1>
<line-3>from collections import defaultdict as dd</line-3>
<line-4>import math</line-4>
<line-5>def geti(): return list(map(int, input().strip().split()))</line-5>
<line-6>def getl(): return list(map(int, input().strip().split()))</line-6>
<line-7>def gets(): return input(... | {"code": "<line-2>input = stdin.readline</line-2>\n<line-19> solve()</line-19>", "lines": [2, 19]}
#### 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.