s_id
stringlengths
10
10
p_id
stringlengths
6
6
u_id
stringlengths
10
10
date
stringlengths
10
10
language
stringclasses
1 value
original_language
stringclasses
11 values
filename_ext
stringclasses
1 value
status
stringclasses
1 value
cpu_time
stringlengths
1
5
memory
stringlengths
1
7
code_size
stringlengths
1
6
code
stringlengths
1
539k
s935502249
p01101
u226888928
1523580647
Python
Python3
py
Runtime Error
0
0
322
while true: (n,m) = map(int,input().split()) if n == 0 && m == 0: break is = list(map(int, input().split())) best = max [ is[i] + is[j] if not ( i == j) and is[i] + is[j] <= k else -1 for i in range(0:n) for j in range(0:n) ] if(best < 0): print("NONE") else: print(best)...
s557885448
p01101
u226888928
1523580668
Python
Python3
py
Runtime Error
0
0
323
while true: (n,m) = map(int,input().split()) if n == 0 and m == 0: break is = list(map(int, input().split())) best = max [ is[i] + is[j] if not ( i == j) and is[i] + is[j] <= k else -1 for i in range(0:n) for j in range(0:n) ] if(best < 0): print("NONE") else: print(best...
s104385294
p01101
u063056051
1526457521
Python
Python3
py
Runtime Error
0
0
428
n,m=map(int,raw_input().split()) while n!=0 and m!=0: ok=0 list=map(int,raw_input().split()) if list[0]<m: max=list[0] for j in range(len(list)-1): for k in range(1,len(list)): tmp=list[j]+list[k] if tmp>max and tmp<=m: ok=1 max...
s819131407
p01101
u063056051
1526457909
Python
Python3
py
Runtime Error
0
0
426
n,m=map(int,raw_input().split()) while n!=0 and m!=0: ok=0 list=map(int,raw_input().split()) if list[0]<m: max=list[0] for j in range(len(list)-1): for k in range(1,len(list)): tmp=list[j]+list[k] if tmp>max and tmp<=m: ok=1 max=t...
s218948014
p01101
u063056051
1526458255
Python
Python3
py
Runtime Error
0
0
424
n,m=map(int,raw_input().split()) while n>0 and m>0: ok=0 list=map(int,raw_input().split()) if list[0]<m: max=list[0] for j in range(len(list)-1): for k in range(1,len(list)): tmp=list[j]+list[k] if tmp>max and tmp<=m: ok=1 max=tm...
s400702249
p01101
u810922275
1526459021
Python
Python
py
Runtime Error
0
0
560
import numpy as np ans=[] for i in range(50000): n,m=map(int,input().split()) if n==0 and m==0: break else: A=list(map(int,input().split(' '))) sum=0 max=0 for j in range(len(A)): for k in range(len(A)): if j!=k: sum=A[j...
s792057449
p01101
u810922275
1526459182
Python
Python3
py
Runtime Error
0
0
560
import numpy as np ans=[] for i in range(50000): n,m=map(int,input().split()) if n==0 and m==0: break else: A=list(map(int,input().split(' '))) sum=0 max=0 for j in range(len(A)): for k in range(len(A)): if j!=k: sum=A[j...
s994215760
p01101
u063056051
1526459647
Python
Python3
py
Runtime Error
0
0
530
max1=[] ok1=[0] n,m=map(int,raw_input().split()) while n>0 and m>0: ie=0 list=map(int,raw_input().split()) if list[0]<m: max=list[0] for j in range(len(list)-1): for k in range(1,len(list)): tmp=list[j]+list[k] if tmp>max and tmp<=m: max=tmp ...
s041567339
p01101
u810098703
1526459858
Python
Python
py
Runtime Error
0
0
704
#include<stdio.h> #define MAX 2000000 int select(int S[],int n,int max){ int ans=0; int temp; for(int i = 0;i<n;i++){ for(int j = i+1;j<n;j++){ temp = S[i]+S[j]; if(temp <= max && ans <= temp){ ans = temp; } } } return ans; } int main(){ int n; int a; int m; int k =0; ...
s241022505
p01101
u063056051
1526459903
Python
Python3
py
Runtime Error
0
0
539
max1=[] ok1=[0] n,m=map(int,raw_input().split()) while n>0 and m>0: tmp=0 ie=0 list=map(int,raw_input().split()) if list[0]<m: max=list[0] for j in range(len(list)-1): for k in range(1,len(list)): tmp=list[j]+list[k] if tmp>max and tmp<=m: ma...
s430473118
p01101
u196653484
1526459979
Python
Python3
py
Runtime Error
0
0
429
maxs=[] while(True): max=0 b=list(map(int,input().split())) n=b[0] m=b[1] if(n == 0 and m == 0): break a=list(map(int,input().split())) for i in range(n): for j in range(i+1,n): sum=a[i]+a[j] if(sum>max and sum<m): max=sum ...
s749984458
p01101
u684325232
1526460192
Python
Python3
py
Runtime Error
0
0
377
s=[] cnt=0 while 1: max=0 n,m =map(int,input().split()) l=list(map(int,input().split())) if n==0 and m==0: break for i in range(len(l)): for j in range(len(l)): if max<l[i]+l[j] and i!=j and m>=l[i]+l[j]: max=l[i]+l[j] if max==0: s+=["NONE"...
s971016170
p01101
u684325232
1526460251
Python
Python3
py
Runtime Error
0
0
377
s=[] cnt=0 while 1: max=0 n,m =map(int,input().split()) l=list(map(int,input().split())) if n==0 and m==0: break for i in range(len(l)): for j in range(len(l)): if max<l[i]+l[j] and i!=j and m>=l[i]+l[j]: max=l[i]+l[j] if max==0: s+=["NONE"...
s903737422
p01101
u196653484
1526460371
Python
Python3
py
Runtime Error
0
0
415
maxs=[] while(True): max=-1 b=list(map(int,input().split())) n=b[0] m=b[1] if(n == 0 and m == 0): break a=list(map(int,input().split())) for i in range(n): for j in range(i+1,n): sum=a[i]+a[j] if(sum>max and sum=<m): max=sum ma...
s529016845
p01101
u063056051
1526460736
Python
Python3
py
Runtime Error
0
0
596
max1=[] ok1=[0] n,m=map(int,raw_input().split()) while n>0 and m>0: ok=0 ie=0 list=map(int,raw_input().split()) if list[0]<m: max=list[0] for j in range(len(list)-1): for k in range(1,len(list)): tmp=0 tmp=list[j]+list[k] if tmp>max and tmp<=m: ...
s814157856
p01101
u063056051
1526895412
Python
Python3
py
Runtime Error
0
0
509
A=map(int,input().split()) n=int(A[0]) m=int(A[1]) max=[] k=0 while n>0 and m>0: B=[0 for i in range(n)] B=input().split() for i in range(n): B[i]=int(B[i]) ma=0 for i in range(n): for j in range(i+1,n): x=0 x=B[i]+B[j] if ma<x and x<=m: ...
s877825546
p01101
u063056051
1526895510
Python
Python3
py
Runtime Error
0
0
518
A=[0 for i in range(2)] A=(int,input().split()) n=A[0] m=A[1] max=[] k=0 while n>0 and m>0: B=[0 for i in range(n)] B=input().split() for i in range(n): B[i]=int(B[i]) ma=0 for i in range(n): for j in range(i+1,n): x=0 x=B[i]+B[j] if ma<x and x...
s782731924
p01101
u146816547
1527782512
Python
Python
py
Runtime Error
0
0
329
while True: n, m = map(int, raw_input().split()) if n == 0 and m == 0: break a = [int(raw_input()) for _ in range(n)] ans = -1 for i in range(n-1): for j in range(i+1, n): if a[i] + a[j] <= m: ans = max(ans, a[i] + a[j]) print "NONE" if ans == -1 ...
s908329742
p01102
u328199937
1555828691
Python
Python3
py
Runtime Error
0
0
1564
while True: s1 = input() if s1 == ".": break s2 = input() listed_s1 = [[]] listed_s2 = [[]] start = 0 now = 0 for i in range(len(s1)): if s1[i] == "\"" and not start: listed_s1.append([]) now += 1 start = 1 listed_s1[now].a...
s643598020
p01102
u328199937
1555828750
Python
Python3
py
Runtime Error
0
0
1564
while True: s1 = input() if s1 == ".": break s2 = input() listed_s1 = [[]] listed_s2 = [[]] start = 0 now = 0 for i in range(len(s1)): if s1[i] == "\"" and not start: listed_s1.append([]) now += 1 start = 1 listed_s1[now].a...
s447634745
p01102
u260980560
1500995686
Python
Python3
py
Runtime Error
0
0
357
while 1: s1 = input().split('"') if s1 is '.': break s2 = input().split('"') if len(s1) != len(s2): print("DIFFERENT") continue r = [0]*2 for i in range(len(s1)): if s1[i] != s2[i]: r[i%2] += 1 if [0,1]<r: print("DIFFERENT") else: ...
s099659158
p01102
u009961299
1502675182
Python
Python3
py
Runtime Error
0
0
1138
#!/usr/bin/env python3 # -*- coding: utf-8 -*- import re from typing import List def rdp_connect() -> bool: global s1, s2 s1 = input() if s1 == '.': return False s2 = input() return True def rdp_token(s: str) -> List[str]: res = [] while s: match = re.match(r'[a-zA-Z0-9;]+'...
s604652225
p01102
u009961299
1502675331
Python
Python3
py
Runtime Error
0
0
1152
#!/usr/bin/env python3 # -*- coding: utf-8 -*- import re from typing import List def rdp_connect() -> bool: global s1, s2 s1 = input() if s1 == '.': return False s2 = input() return True def rdp_token(s: str) -> List[str]: res = [] while s: match = re.match(r'[a-zA-Z0-9;]+'...
s326062663
p01102
u684325232
1526460925
Python
Python3
py
Runtime Error
0
0
281
s=[] while 1: l1=list(input().split()) if l1==".": break l2=list(input().split()) if l1==l2: s+=["INDENTCAL"] elif len(set(l1+l2))==1: s+=["CLODSE"] else: s+=["DIFFERENT"] print(s)
s316551929
p01102
u196653484
1526462092
Python
Python3
py
Runtime Error
0
0
634
results=[] while True: a=input().split("\"") if a[0]==".": break b=input().split("\"") for i in range(len(a)): if(i%2==0): del(a[i]) for i in range(len(b)): if(i%2==0): del(b[i]) count=0 for i,j in zip(a,b): for k,l in zip(a[i],b[j]...
s696720248
p01102
u196653484
1526462362
Python
Python3
py
Runtime Error
0
0
522
results=[] while True: a=input().split("\"") if a[0]==".": break b=input().split("\"") count=0 for i,j in zip(range(len(a)),range(len(b))): for k,l in zip(a[2*i+1],b[2*j+1]): if(k!=l): count+=1 if count==0: results.append(0) elif count==1: ...
s896106006
p01102
u196653484
1526462403
Python
Python3
py
Runtime Error
0
0
526
results=[] while True: a=input().split("\"") if a[0]==".": break b=input().split("\"") count=0 for i,j in zip(range(len(a)/2),range(len(b)/2)): for k,l in zip(a[2*i+1],b[2*j+1]): if(k!=l): count+=1 if count==0: results.append(0) elif count=...
s456617712
p01102
u196653484
1526462528
Python
Python3
py
Runtime Error
0
0
517
results=[] while True: a=input().split("\"") if a[0]==".": break b=input().split("\"") count=0 for i,j in zip(range(len(a)),range(len(b)): for k,l in zip(a[2*i],b[2*j]): if(k!=l): count+=1 if count==0: results.append(0) elif count==1: ...
s010518196
p01102
u196653484
1526462601
Python
Python3
py
Runtime Error
0
0
496
results=[] while True: a=input().split("\"") if a[0]==".": break b=input().split("\"") count=0 for i in range(len(a)): for k,l in zip(a[2*i],b[2*i]): if(k!=l): count+=1 if count==0: results.append(0) elif count==1: results.append(1)...
s469041876
p01102
u196653484
1526462745
Python
Python3
py
Runtime Error
0
0
503
results=[] while True: a=input().split("\"") if a[0]==".": break b=input().split("\"") count=0 for i in range(int(len(a)/2)): for k,l in zip(a[2*i],b[2*i]): if(k!=l): count+=1 if count==0: results.append(0) elif count==1: results.ap...
s779939186
p01102
u196653484
1526463317
Python
Python3
py
Runtime Error
0
0
510
results=[] while True: a=input().split("\"") if a[0]==".": break b=input().split("\"") count=0 for i in range(0,int(len(a)/2)): for k,l in zip(a[2*i+1],b[2*i+1]): if(k!=l): count+=1 if count==0: results.append(0) elif count==1: resu...
s604211354
p01102
u196653484
1526463488
Python
Python3
py
Runtime Error
0
0
502
results=[] while True: a=input().split("\"") if a[0]==".": break b=input().split("\"") count=0 for i in range(int(len(a)/2)): for k,l in zip(a[2*i+1],b[2*i+1]): if(k!=l): count+=1 if count==0: results.append(0) elif count==1: result...
s535690891
p01102
u064313887
1526463858
Python
Python3
py
Runtime Error
0
0
944
while 1: key = 0 s1 = input() if s1 == '.': break s2 = input() if len(s1) == len(s2): for i in range(len(s1)): if s1[i] != s2[i]: key += 1 if key >= 2: output.append('DIFFERENT') break if key == 0: ...
s306416973
p01102
u064313887
1526463866
Python
Python3
py
Runtime Error
0
0
944
while 1: key = 0 s1 = input() if s1 == '.': break s2 = input() if len(s1) == len(s2): for i in range(len(s1)): if s1[i] != s2[i]: key += 1 if key >= 2: output.append('DIFFERENT') break if key == 0: ...
s105305521
p01102
u064313887
1526464086
Python
Python3
py
Runtime Error
0
0
935
while 1: key = 0 s1 = input() if s1 == '.': break s2 = input() if len(s1) == len(s2): for i in range(len(s1)): if s1[i] != s2[i]: key += 1 if key >= 2: output.append('DIFFERENT') break if key == 0: ...
s037838561
p01102
u848218390
1526465905
Python
Python3
py
Runtime Error
0
0
600
while 1: s1 = input().split('\"') if s1[0] == '.': break s2 = input().split('\"') jdg = 1 cnt_d = if len(s1) != len(s2): print("DIFFERENT") else: l = len(s1) i = 0 while i < l: if s1[i] != s2[i]: cnt_d += 1 if cnt_d == 1 ...
s573836667
p01102
u196653484
1526532287
Python
Python3
py
Runtime Error
0
0
831
results=[] while True: a=input().split("\"") if a[0]==".": break b=input().split("\"") count1=0 count2=0 print(a) print(b) for i in range(int(len(a))): if(i%2==1): for k,l in zip(a[i],b[i]): if(k!=l): count1+=1 else:...
s209724227
p01102
u196653484
1526532329
Python
Python3
py
Runtime Error
0
0
799
results=[] while True: a=input().split("\"") if a[0]==".": break b=input().split("\"") count1=0 count2=0 for i in range(int(len(a))): if(i%2==1): for k,l in zip(a[i],b[i]): if(k!=l): count1+=1 else: for k,l in zi...
s222679766
p01102
u196653484
1526532533
Python
Python3
py
Runtime Error
0
0
769
results=[] while True: a=input().split("\"") if a[0]==".": break b=input().split("\"") count1=0 count2=0 for i in range(int(len(a))): if(i%2==1): for k,l in zip(a[i],b[i]): if(k!=l): count1+=1 else: for k,l in zi...
s695740990
p01102
u196653484
1526532631
Python
Python3
py
Runtime Error
0
0
771
results=[] while True: a=input().split("\"") if a[0]==".": break b=input().split("\"") count1=0 count2=0 for i in range(int(len(a))): if(i%2==1): for (k,l) in zip(a[i],b[i]): if(k!=l): count1+=1 else: for k,l in ...
s742791736
p01102
u196653484
1526532921
Python
Python3
py
Runtime Error
0
0
793
results=[] while True: a=list(map(input().split("\""))) if a[0]==".": break b=list(map(input().split("\""))) count1=0 count2=0 for i in range(int(len(a))): if(i%2==1): for (k,l) in zip(a[i],b[i]): if(k!=l): count1+=1 else: ...
s849933635
p01102
u196653484
1526533178
Python
Python3
py
Runtime Error
0
0
793
results=[] while True: a=list(map(input().split("\""))) if a[0]==".": break b=list(map(input().split("\""))) count1=0 count2=0 for i in range(int(len(a))): if(i%2==1): for (k,l) in zip(a[i],b[i]): if(k!=l): count1+=1 else: ...
s747146611
p01102
u196653484
1526533355
Python
Python3
py
Runtime Error
0
0
763
results=[] while 1: a=input().split("\"") if a[0]==".": break b=input().split("\"") count1=0 count2=0 for i in range(len(a)): if(i%2==1): for (k,l) in zip(a[i],b[i]): if(k!=l): count1+=1 else: for k,l in zip(a[i]...
s570542671
p01102
u564105430
1526534313
Python
Python3
py
Runtime Error
0
0
450
while 1: s1=input().split('"') if s1==".": break s2=input().split('"') cnt1=0 cnt2=0 i=0 if len(s1)!=len(s2): print("DIFFERENT") else: while i<len(s1): if s1[i]==s2[i]: cnt1+=1 elif s1[i]!=s2[i] and i%2==0: print("DIFFERENT") break elif s1[i]!=s2[i] and i%2!=0: cnt2+=1 if ...
s518008299
p01102
u063056051
1526985132
Python
Python3
py
Runtime Error
0
0
481
while 1: list1=input().split('"') if len(list1)==1 and list1[0]=='.': break list2=input().split('"') cnt=0 flag1=1 flag2=0 if len(list1)!=len(list2): flag1=0 else: i=0 while i<len(list1): if list1[i]==list2[i]: elif i%2==0: flag1=0 flag2=1 break else: cnt+=1 if c...
s459655107
p01102
u063056051
1526985251
Python
Python3
py
Runtime Error
0
0
712
while 1: list1=input().split('"') if len(list1)==1 and list1[0]==".": break list2=input().split('"') c1=0 c2=0 flag=0 if len(list1)!=len(list2): print("DIFFERENT") else: i=0 while i<len(list1): if list1[i]==list2[i]: ...
s667316633
p01102
u063056051
1526985266
Python
Python3
py
Runtime Error
0
0
694
while 1: list1=input().split('"') if list1[0]==".": break list2=input().split('"') c1=0 c2=0 flag=0 if len(list1)!=len(list2): print("DIFFERENT") else: i=0 while i<len(list1): if list1[i]==list2[i]: c1+=1 ...
s047715730
p01102
u826549974
1526991234
Python
Python3
py
Runtime Error
0
0
1848
while(1): a = input() if(a == '.'): break b = input() n = len(a) m = len(b) l = 0; flag = 0 idx_dif = 0 error_cou = 0 while(1): if(l >= n-1 or l+idx_dif >= m-1): flag = 2 if(flag == 0): for i in range(l,n): if(a[i]...
s171650124
p01102
u826549974
1526991380
Python
Python3
py
Runtime Error
0
0
1872
while(1): a = input() if(a == '.'): break b = input() n = len(a) m = len(b) l = 0; flag = 0 idx_dif = 0 error_cou = 0 while(1): if(l >= n-1 or l+idx_dif >= m-1): flag = 2 if(flag == 0): for i in range(l,n): if(a[...
s919927742
p01102
u826549974
1526994358
Python
Python3
py
Runtime Error
0
0
2116
while(1): a = input() if(a == '.'): break b = input() n = len(a) m = len(b) l = 0; flag = 0 idx_dif = 0 error_cou = 0 while(1): if(l >= n-1 or l+idx_dif >= m-1): flag = 2 if(flag == 0): for i in range(l,n): if(a[i]...
s932565592
p01102
u810922275
1527034214
Python
Python
py
Runtime Error
0
0
658
import numpy as np A1=[] A2=[] ans=[] for i in range(100): cnt=0 S1=input("プログラム1:") if S1=='.': break S2=input("プログラム2:") A1=S1.split('"') A2=S2.split('"') if len(A1)==len(A2): for j in range(len(A1)): if j%2!=0: if A1[j]!=A2[j]: ...
s877658451
p01102
u810922275
1527034233
Python
Python
py
Runtime Error
0
0
639
A1=[] A2=[] ans=[] for i in range(100): cnt=0 S1=input("プログラム1:") if S1=='.': break S2=input("プログラム2:") A1=S1.split('"') A2=S2.split('"') if len(A1)==len(A2): for j in range(len(A1)): if j%2!=0: if A1[j]!=A2[j]: cnt=cnt+1 ...
s429414688
p01102
u055885332
1527047803
Python
Python3
py
Runtime Error
0
0
463
#16D8101014F 久留米 竜之介 Python3 #a=[] while(True): i=0 tmp=0 a=input().split('"') aL=a.len() b=input().split('"') bL=b.len() if aL != bL: print("DIFFELENT") else: while(True): if a[i] != b[i]: print("DIFFERENT") break elif i > aL-2: if tmp==1: print("CLOSE") break else: pr...
s632167684
p01102
u055885332
1527047900
Python
Python3
py
Runtime Error
0
0
461
#16D8101014F 久留米 竜之介 Python3 #a=[] while(True): i=0 tmp=0 a=input().split('"') aL=len(a) b=input().split('"') bL=len(b) if aL != bL: print("DIFFELENT") else: while(True): if a[i] != b[i]: print("DIFFERENT") break elif i > aL-2: if tmp==1: print("CLOSE") break else: prin...
s972560515
p01102
u055885332
1527048042
Python
Python3
py
Runtime Error
0
0
487
#16D8101014F 久留米 竜之介 Python3 #a=[] while(True): i=0 tmp=0 a=input().split('"') aL=len(a) b=input().split('"') bL=len(b) if a[0]==".": break if aL != bL: print("DIFFELENT") else: while(True): if a[i] != b[i]: print("DIFFERENT") break elif i > aL-2: if tmp==1: print("CLOSE") ...
s464685599
p01103
u260980560
1500996475
Python
Python3
py
Runtime Error
0
0
914
while 1: d, w = map(int, input().split()) if d == w == 0: break E = [[*map(int, input().split())] for i in range(d)] ans = 0 for x2 in range(d): for y2 in range(w): for x1 in range(x2-1): for y1 in range(y2-1): # [x1, x2] x [y1, y2] ...
s281140338
p01103
u260980560
1500996567
Python
Python3
py
Runtime Error
0
0
872
while 1: d, w = map(int, input().split()) if d == w == 0: break E = [[*map(int, input().split())] for i in range(d)] ans = 0 for x2 in range(d): for y2 in range(w): for x1 in range(x2-1): for y1 in range(y2-1): co = 10**18 ...
s354104636
p01103
u148477094
1527046026
Python
Python3
py
Runtime Error
0
0
825
while 1: d, w = map(int, input().split()) if d==w==0: break E=[list(map(int, input().split())) for i in range(d)] a=0 for x2 in range(d): for y2 in range(w): for x1 in range(x2-1): for y1 in range(y2-1): co=10**18 fo...
s111247307
p01103
u148477094
1527046053
Python
Python3
py
Runtime Error
0
0
825
while 1: d, w = map(int, input().split()) if d==w==0: break E=[list(map(int, input().split())) for i in range(d)] a=0 for x2 in range(d): for y2 in range(w): for x1 in range(x2-1): for y1 in range(y2-1): co=10**18 fo...
s616764035
p01103
u148477094
1527046114
Python
Python3
py
Runtime Error
0
0
828
while True: d, w = map(int, input().split()) if d==w==0: break E=[list(map(int, input().split())) for i in range(d)] a=0 for x2 in range(d): for y2 in range(w): for x1 in range(x2-1): for y1 in range(y2-1): co=10**18 ...
s536396611
p01104
u260980560
1500998277
Python
Python3
py
Runtime Error
0
0
245
while 1: n, m = map(int, input().split()) if n+m == 0: break B = [int(input(),2) for i in range(n)] C = {0: 0} for b in B: for k, v in [*C.items()]: C[k^b] = max(C.get(k^b, 0), v+1) print(C[0])
s548409619
p01104
u260980560
1501208622
Python
Python3
py
Runtime Error
0
0
1082
a=65280; b=61680; c=52428; d=43690; e=65535 QS = [[] for i in range(17)] QS[1] = [a, b, c, d] L = {a: 1, b: 1, c: 1, d: 1, e: 1, e: 1, 0: 1} H = [] get = L.get push = H.append for l in range(1, 16): Q = QS[l] li = 13-l; l3 = l+3; l1 = l+1 pop = Q.pop pushQN = QS[l1].append while Q: p = pop()...
s397475554
p01104
u260980560
1501208875
Python
Python3
py
Runtime Error
0
0
1071
a=65280; b=61680; c=52428; d=43690; e=65535 QS = [[] for i in range(17)] QS[1] = [a, b, c, d] L = {a: 1, b: 1, c: 1, d: 1, e: 1, e: 1, 0: 1} H = [] get = L.get push = H.append for l in range(1, 16): Q = QS[l] li = 13-l; l3 = l+3; l1 = l+1 pop = Q.pop pushQN = QS[l1].append while Q: p = pop()...
s942430667
p01104
u196653484
1526548813
Python
Python3
py
Runtime Error
0
0
1221
import itertools def addlist(a,b,m): result=[0 for i in range(m)] for i in range(m): c=a[i]+b[i] result[i] = c%2 return result def sum(b): result=0 for i in b: result += i return result def make(b,m,n,l): sumlist=[] flag=False p=list(itertools.combinations(b,...
s573005395
p01104
u196653484
1526551437
Python
Python3
py
Runtime Error
0
0
1228
import itertools def addlist(a,b,m): result=[0 for i in range(m)] for i in range(m): c=a[i]+b[i] result[i] = c%2 return result def sum(b): result=0 for i in b: result += i return result def make(b,m,n,l): sumlist=[] flag=False p=list(itertools.combinations(...
s426270832
p01109
u258535552
1535947905
Python
Python3
py
Runtime Error
0
0
173
n=int(input()) a=[int(i) for i in input().split] total=0 for i in a: total+=i hei=total/n count=0 for i in a: if i <= hei: count+=1 print(count)
s636822771
p01110
u191474223
1559115811
Python
Python3
py
Runtime Error
0
0
2301
from collections import defaultdict,deque import sys,heapq,bisect,math,itertools,string,queue,datetime sys.setrecursionlimit(10**8) INF = float('inf') mod = 10**9+7 eps = 10**-7 def inpl(): return list(map(int, input().split())) def inpl_str(): return list(input().split()) def rev_w(MAP,H,W): nextMAP = [[] for y ...
s482095810
p01110
u046108504
1559498887
Python
Python3
py
Runtime Error
0
0
1495
from operator import add def fold_right(v, length): for i in range(len(v[0])): if not any(list(zip(*v))[i]): continue for j in range(length): for yoko in range(len(v)): v[yoko][i + j + length] += v[yoko][i + j] v[yoko][i + j] = 0 retu...
s052355599
p01111
u300645821
1531405748
Python
Python
py
Runtime Error
0
0
237
import sys while True: n=int(sys.stdin.readline()) if not n: break head=tail=1 s=0 while True: while s<N: s+=tail tail+=1 while s>N: s-=head head+=1 if s==N sys.stdout.write('%d %d\n'%(head,tail-head)) break
s744910808
p01111
u300645821
1531405805
Python
Python
py
Runtime Error
0
0
238
import sys while True: n=int(sys.stdin.readline()) if not n: break head=tail=1 s=0 while True: while s<n: s+=tail tail+=1 while s>n: s-=head head+=1 if s==n: sys.stdout.write('%d %d\n'%(head,tail-head)) break
s285414644
p01111
u300645821
1531405812
Python
Python3
py
Runtime Error
0
0
238
import sys while True: n=int(sys.stdin.readline()) if not n: break head=tail=1 s=0 while True: while s<n: s+=tail tail+=1 while s>n: s-=head head+=1 if s==n: sys.stdout.write('%d %d\n'%(head,tail-head)) break
s747707321
p01125
u296492699
1409860815
Python
Python
py
Runtime Error
0
0
2064
while True: &#160;&#160;&#160;&#160;num_hoseki=input() &#160;&#160;&#160;&#160;if num_hoseki==0: &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;break &#160;&#160;&#160;&#160;&#160; &#160;&#160;&#160;&#160;hoseki_list=[] &#160;&#160;&#160;&#160;for i in range(num_hoseki): &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160...
s953910683
p01125
u266872031
1422111822
Python
Python
py
Runtime Error
0
0
1396
while(1): N=int(raw_input()) if N==0: break else: gems=[] okflag=0 loc=[10,10] for i in range(N): [gemx,gemy]=[int(x) for x in raw_input().split()] gems.append([gemx,gemy]) M=int(raw_input()) for i in range(M): com=r...
s876620110
p01125
u078042885
1485629061
Python
Python3
py
Runtime Error
0
0
393
while 1: n=int(input()) if n==0:break x=y=10 b=[list(map(int,input().split())) for _ in range(n)] print(b) for i,j in [input().split() for _ in range(int(input()))]: for _ in range(int(j)): if 'N'<=i<='S': y+=1 if i=='N' else -1 else: x+=1 if i=='E' else -1 ...
s778957062
p01125
u078042885
1485629115
Python
Python3
py
Runtime Error
0
0
380
while 1: n=int(input()) if n==0:break x=y=10 b=[list(map(int,input().split())) for _ in range(n)] for i,j in [input().split() for _ in range(int(input()))]: for _ in range(int(j)): if 'N'<=i<='S': y+=1 if i=='N' else -1 else: x+=1 if i=='E' else -1 if [x,y...
s794468418
p01125
u974788383
1506842707
Python
Python3
py
Runtime Error
0
0
1616
while (True): pos = [10, 10] result = 'No' N = int(input()) # Total number of jewels if N == 0: break jewelPositions = list() for i in range(N): jewelPos = list(map(int, input().split())) jewelPositions.append(jewelPos) M = int(input()) # Number of instructions #...
s677868049
p01125
u256256172
1506944011
Python
Python3
py
Runtime Error
0
0
557
while True: n = int(input()) if n == 0: break p = [10, 10] l = [list(map(int,input().split())) for _ in range(n)] for d,s in [input.split() for _ in range(int(input()))]: for _ in range(s): if d == 'N': p[1] += 1 elif d == 'E': ...
s221551461
p01125
u256256172
1506993659
Python
Python
py
Runtime Error
0
0
559
while True: n = int(input()) if n == 0: break p = [10, 10] l = [list(map(int,input().split())) for _ in range(n)] for d,s in [input().split() for _ in range(int(input()))]: for _ in range(s): if d == 'N': p[1] += 1 elif d == 'E': ...
s571083966
p01126
u978831775
1415114875
Python
Python
py
Runtime Error
0
0
631
# coding: utf-8 def main(): while True: (n, m, a) = map(int, raw_input().split(' ')) if (n, m, a) == (0, 0, 0): break bars = [] for i in range(m): (h, p, q) = map(int, raw_input().split(' ')) bars.append((h, p, q)) x = a while True: # Down step by step, and above bars are ...
s527848793
p01126
u617183767
1420615649
Python
Python
py
Runtime Error
0
0
891
#! /usr/bin/env python # -*- coding: utf-8 -*- import os import sys import itertools import math from collections import Counter, defaultdict class Main(object): def __init__(self): pass def solve(self): ''' insert your code ''' while True: n, m, a = m...
s774089363
p01126
u124909914
1426643028
Python
Python3
py
Runtime Error
0
0
374
while True: n, m, a = map(int, input().split()) if n == 0: break ls = [[0 for i in range(n+1)] for i in range(m)] print(ls) for i in range(m): h, p, q = map(int, input().split()) ls[h][p] = 1 ls.reverse() print(ls) for t in ls: if t[a] == 1: a += 1 ...
s309866426
p01126
u248416507
1464101487
Python
Python
py
Runtime Error
0
0
588
if __name__ == "__main__": while True: n, m, a = map(int, raw_input().split()) if n == 0 and m == 0 and a == 0: break now = a amida = [[] for i in range(1000)] for i in range(m): h, p, q = map(int, raw_input().split()) amida[h].append((p,...
s794952288
p01126
u248416507
1464101507
Python
Python
py
Runtime Error
0
0
588
if __name__ == "__main__": while True: n, m, a = map(int, raw_input().split()) if n == 0 and m == 0 and a == 0: break now = a amida = [[] for i in range(1000)] for i in range(m): h, p, q = map(int, raw_input().split()) amida[h].append((p,...
s329578307
p01126
u858885710
1466502965
Python
Python3
py
Runtime Error
0
0
416
while True: n, m, a = map(int, input().split()) if n + m + a == 0: break lines = list(reversed(sorted([tuple(map(int, input().split())) for _ in range(m)]))) replace = list(range(1, n+1)) for l in lines: h, p, q = l p -= 1 q -= 1 replace[p], replace[q] =...
s726860097
p01126
u616098312
1466503847
Python
Python3
py
Runtime Error
0
0
315
while True: [n,m,a]=input().split() if [n,m,a]==["0","0","0"]: break [n,m,a]=[int(n),int(m),int(a)] yokobo={} for k in range(m): [h,p,q]=input().sprit() yokobo[h,p]=[int(q)] yokobo[h,q]=[int(p)] move=1000 while move>0: a=yokobo[move,a] move=move-1
s799009082
p01126
u685815919
1474601047
Python
Python
py
Runtime Error
0
0
401
while True: n,m,a = map(int, raw_input().split()) if n==m==a==0: break lst = [0] * n for i in xrange(n): lst[i] = i ms = {} for _ in xrange(n): h,p,q = map(int, raw_input().split()) if h not in ms: ms[h] = {} ms[h][p] = q for i,v in sorted(ms.items()): for k,l in v.items(): ...
s288674450
p01126
u936898312
1492606793
Python
Python3
py
Runtime Error
0
0
431
while True: n, m, a = map(int, input().split()) if (not (n or m or a)): break amida = [[] for i in range(n)] for i in range(n): h, p, q = map(int, input().split()) amida[p-1].append((h, q-1)) amida[q-1].append((h, p-1)) for i in range(n): amida[i].sort() a -= 1 h = 1000 while amida[a]: h2, a2 = amid...
s704528767
p01126
u179694829
1498973057
Python
Python3
py
Runtime Error
0
0
300
while True: n,m,a = map(int,input().split()) if n == m == a == 0: break A = [[0]*1002 for i in range(n + 1)] for i in range(m + 1): h,p,q = map(int,input().split()) A[p][1001 - h] = q A[q][1001 - h] = p for i in range(1001): if A[a][i] == 0: pass else: a = A[a][i] print(a)
s196941371
p01126
u506554532
1513127999
Python
Python3
py
Runtime Error
0
0
258
N,M,A = map(int,input().split()) amd = [{} for i in range(1001)] for i in range(M): h,p,q = map(int,input().split()) amd[h][p] = q amd[h][q] = p raw_input() #ignore now = A for d in reversed(amd): if now in d: now = d[now] print(now)
s384676741
p01126
u591052358
1528895821
Python
Python3
py
Runtime Error
0
0
698
N = 10**6 N1 = [i for i in range(N+40)] N2 = [i for i in range(N+40)] #N1[0] = 0 #N2[0] = 0 p = [n*(n+1)*(n+2)//6 for n in range(1,200) if n *(n+1)*(n+2)//6< N+1] p2 = [n*(n+1)*(n+2)//6 for n in range(1,200) if n *(n+1)*(n+2)//6< N+1 and n *(n+1)*(n+2)//6 % 2 ==1 ] #print(p2) for p_ in p: if p_ > N +1: c...
s355706810
p01126
u459861655
1350625214
Python
Python
py
Runtime Error
0
1004
669
n, m, a = [int(x) for x in raw_input().strip().split()] lines = [] while True: h, p, q = [int(x) for x in raw_input().strip().split()] if h == p == q == 0: break else: lines.append([h, p, q]) verticals = [[] for i in xrange(n)] for i in xrange(n): for l in lines: if l[1] == i + 1 or l[2] == i + 1:...
s869825722
p01126
u351182591
1375714266
Python
Python
py
Runtime Error
20000
4268
660
while 1: num=map(int,raw_input().split()) if num==[0,0,0] : break hrz=[0 for i in range(num[1])] for i in range(num[1]): hrz[i]=map(int,raw_input().split()) lct=[1001,num[2]] while lct[0]!=1: pps=[0,0] for i in range(num[1])...
s239074154
p01127
u633068244
1428311159
Python
Python
py
Runtime Error
19930
4776
1133
from itertools import permutations from collections import defaultdict import copy def judge(field, c): for y in xrange(corner[c][2], corner[c][3] + 1): for x in xrange(corner[c][0], corner[c][1] + 1): if field[y][x] != c and field[y][x] != "*": return False field[y...
s508083553
p01127
u633068244
1428311371
Python
Python
py
Runtime Error
19930
4772
1129
from itertools import permutations from collections import defaultdict import copy def judge(field, c): for y in xrange(corner[c][2], corner[c][3] + 1): for x in xrange(corner[c][0], corner[c][1] + 1): if field[y][x] != c and field[y][x] != "*": return False field[y...
s232894524
p01127
u633068244
1428311630
Python
Python
py
Runtime Error
19930
4676
1107
from itertools import permutations from collections import defaultdict def judge(field, c): for y in xrange(corner[c][2], corner[c][3] + 1): for x in xrange(corner[c][0], corner[c][1] + 1): if field[y][x] != c and field[y][x] != "*": return False field[y][x] = "*" ...
s061071485
p01127
u633068244
1428311662
Python
Python3
py
Runtime Error
0
0
1109
from itertools import permutations from collections import defaultdict def judge(field, c): for y in xrange(corner[c][2], corner[c][3] + 1): for x in xrange(corner[c][0], corner[c][1] + 1): if field[y][x] != c and field[y][x] != "*": return False field[y][x] = "*" ...
s785718782
p01127
u260980560
1467371765
Python
Python
py
Runtime Error
40000
6372
1475
from itertools import permutations for t in xrange(input()): h, w = map(int, raw_input().split()) A = [list(raw_input()) for i in xrange(h)] xmin = {}; xmax = {} ymin = {}; ymax = {} obj = set() for i in xrange(h): for j in xrange(w): c = A[i][j] if c == '.': cont...
s773501899
p01128
u509278866
1530781155
Python
Python3
py
Runtime Error
0
0
1801
import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,random,time,copy,functools sys.setrecursionlimit(10**7) inf = 10**20 eps = 1.0 / 10**10 mod = 10**9+7 dd = [(-1,0),(0,1),(1,0),(0,-1)] ddn = [(-1,0),(-1,1),(0,1),(1,1),(1,0),(1,-1),(0,-1),(-1,-1)] def LI(): return [int(x) for x in sys.stdin....
s283923947
p01128
u598551137
1514336049
Python
Python3
py
Runtime Error
0
0
890
for i in range(int(input())): xa, ya, xb, yb = map(int, input().split(' ')) n = int(input()) ip = [] for j in range(n): xs, ys, xt, yt, o, l = map(int, input().split(' ')) d = (xb - xa) * (yt - ys) - (yb - ya) * (xt - xs) if d == 0: continue t0 = ((yt - ys) * ...
s849525163
p01128
u598551137
1514370996
Python
Python3
py
Runtime Error
0
0
691
for i in range(int(input())): xa, ya, xb, yb = map(int, input().split(' ')) n = int(input()) ip = [] for j in range(n): xs, ys, xt, yt, o, l = map(int, input().split(' ')) d = (xb - xa) * (yt - ys) - (yb - ya) * (xt - xs) continue t0 = ((yt - ys) * (xs - xa) - (xt - x...