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
s099143645
p03808
u828766688
1579295668
Python
PyPy3 (2.4.0)
py
Runtime Error
218
62832
528
import sys N = int(input()) A = list(map(int,input().split())) M = N*(N+1)//2 if sum(A) % M != 0: print ("NO") sys.exit() able = sum(A) // M print (M,able) A.append(A[0]) now = 0 for i in range(N): if A[i+1] - A[i] == able: continue else: #print (A[i+1],A[i],able,1-N) i...
s619316620
p03808
u670180528
1575103079
Python
Python (3.4.3)
py
Runtime Error
76
14956
238
n,*a=map(int,open(0).read().split()) d=[j-i for i,j in zip(a,a[1:]+[a[0]])] M=max(d) dd=[M-x for x in d] if (n==2 and sum(a)%3) or any(x%n for x in dd) or sum(x//n for x in dd)!=M or sum(a)//M!=n*(n+1)//2: print("NO") else: print("YES")
s266306578
p03808
u670180528
1575102398
Python
Python (3.4.3)
py
Runtime Error
78
14956
230
n,*a=map(int,open(0).read().split()) d=[j-i for i,j in zip(a,a[1:]+[a[0]])] M=max(d) dd=[M-x for x in d] if n==1 or (all(x%n==0 for x in dd) and sum(x//n for x in dd)==M and sum(a)//M==n*(n+1)//2): print("YES") else: print("NO")
s805822997
p03808
u670180528
1575102250
Python
Python (3.4.3)
py
Runtime Error
78
14956
220
n,*a=map(int,open(0).read().split()) d=[j-i for i,j in zip(a,a[1:]+[a[0]])] M=max(d) dd=[M-x for x in d] if all(x%n==0 for x in dd) and sum(x//n for x in dd)==M and sum(a)//M==n*(n+1)//2: print("YES") else: print("NO")
s448778260
p03808
u039623862
1569626473
Python
Python (3.4.3)
py
Runtime Error
28
11104
257
n = int(input()) a = list(map, input().split()) suma = sum(a) if sum(a) % (n*(n+1)//2) > 0: print('NO') exit() k = 2*suma//(n*(n+1)) diffs = [a[i+1] - a[i] + k for i in range(n-1)] if all([d % n == 0 for d in diffs]): print('YES') else: print('NO')
s912504755
p03808
u201234972
1567043095
Python
Python (3.4.3)
py
Runtime Error
18
3064
850
#import sys #input = sys.stdin.readline from itertools import accumulate def main(): N = int( input()) A = list( map( int, input().split())) C = [0]*(N*2+2) L = [0]*(N*2+2) cnt = 0 if sum(A)%(N*(N+1)//2) != 0: print("NO") return t = sum(A)//(N*(N+1)//2) for i in range(N):...
s202276608
p03808
u729133443
1566050106
Python
Python (3.4.3)
py
Runtime Error
111
14068
177
n,*a=map(int,open(0).read().split()) b,m=sum(a),n*-~n//2 n-=1 c=b//m f=b%m>0 for i,j in zip(*[iter([a[-1]]+a*2)]*2): j-=i t=min(0,j//n) f|=c!=j+n*-t-t print('YNEOS'[f::2])
s490731799
p03808
u163320134
1562950588
Python
Python (3.4.3)
py
Runtime Error
45
14228
320
def gcd(a,b): if b==0: return a else: return(b,a%b) n=int(input()) arr=list(map(int,input().split())) sum1=sum(arr) sum2=(n*(n+1))//2 cnt=sum1//sum2 if sum1%sum2!=0: print('NO') else: s=set() l=n//(gcd(n,cnt)) for val in arr: s.add(val%n) if len(s)==l: print('YES') else: print('NO')
s354485281
p03808
u623819879
1559605776
Python
PyPy3 (2.4.0)
py
Runtime Error
171
38640
472
#n,a,b,c,d=map(int,input().split()) n=int(input()) a=[int(i) for i in input().split()] ans=False c=[] t=sum(a)//((n*(n+1))//2) if sum(a)%((n*(n+1))//2)!=0: ans=False else: for i in range(n): if i==0: d=a[0]-a[-1] else: d=a[i]-a[i-1] if (t-d)%n!=0: an...
s675583999
p03808
u623819879
1559605609
Python
PyPy3 (2.4.0)
py
Runtime Error
176
38356
493
#n,a,b,c,d=map(int,input().split()) n=int(input()) a=[int(i) for i in input().split()] ans=False c=[] t=sum(a)//((n*(n+1))//2) if sum(a)%((n*(n+1))//2)!=0: ans=False else: if n==1: ans=True break for i in range(n): if i==0: d=a[0]-a[-1] else: d=a[i]-...
s565744081
p03808
u310678820
1559434758
Python
PyPy3 (2.4.0)
py
Runtime Error
264
68080
277
import math n=int(input()) a=list(map(int, input().split())) tmp=0 for i in range(n-1): if a[i]>(a[i+1]+tmp*n): tmp=math.ceil((a[i]-a[i+1])/n) a[i+1]+=tmp*n tmp = a[1]-a[0] if all(a[i+1]-a[i]==tmp for i in range(1, n-1)): print('YES') else: print('NO')
s107436329
p03808
u923279197
1553737776
Python
PyPy3 (2.4.0)
py
Runtime Error
229
62832
529
n = int(input()) a = list(map(int,input().split())) global count count = 0 def solve(a): count += 1 if count > 10**7: print('NO') exit() if min(a) < 0: return False for i in range(n): if a[i] != 0: break if i == n-1: return True for i...
s612836191
p03808
u923279197
1553737513
Python
PyPy3 (2.4.0)
py
Runtime Error
2118
236752
439
n = int(input()) a = list(map(int,input().split())) def solve(a): if min(a) < 0: return False for i in range(n): if a[i] != 0: break if i == n-1: return True for i in range(n): b = [] for j in range(n): c = a[(i+j)%n]-j-1 ...
s801949388
p03808
u923279197
1553737460
Python
PyPy3 (2.4.0)
py
Runtime Error
2113
256184
461
n = int(input()) a = list(map(int,input().split())) def solve(a): print(a) for i in range(n): if a[i] != 0: break if i == n-1: return True for i in range(n): b = [] for j in range(n): if a[j] < 0: return False ...
s170268636
p03808
u785578220
1552600298
Python
Python (3.4.3)
py
Runtime Error
78
14476
243
N = int(input()) A = list(map(int, input().split())) K = sum(A) / sum(range(1, N+1)) for i in range(-1,N-1): D = A[i+1] - A[i] - K for d in D: if not (d <= 0 and d % N == 0): print("NO") break else: print("YES")
s442471091
p03808
u299869545
1546416542
Python
Python (2.7.6)
py
Runtime Error
12
2568
875
#include<iostream> #include<cstdio> #include<algorithm> #include<cmath> #include<vector> #include<map> #include<set> #include<string> #include<queue> #include<stack> using namespace std; #define MOD 1000000007 #define INF (1<<29) #define EPS (1e-10) typedef long long Int; typedef pair<Int, Int> P; #define max(x, y) ((...
s052986304
p03808
u236127431
1543865811
Python
PyPy3 (2.4.0)
py
Runtime Error
236
63472
213
N=int(input()) a=[int(i) for i in input().split()] k=sum(a)//(N*(N-1)//2) D=[] a.append(a[0]) for i in range(N): D.append(a[i+1]-a[i]-k) for d in D: if d%N!=0: print("NO") exit() print("YES")
s912145302
p03808
u667024514
1539099313
Python
Python (3.4.3)
py
Runtime Error
44
14104
303
n=int(input()) lis=list(map(int,input().split())) num=(n*(n+1))//2 if sum(lis)%num!=0: print("NO") exit() ans=0 for k in range(n): if -(lis[i]-lis[i-1]-sum(lis)//num)%n!=0: print("NO") exit() ans+=-(lis[i]-lis[i-1]-sum(lis)//num)//n if ans == sum(lis)//num:print("YES") else:print("NO")
s344360697
p03808
u667024514
1539098360
Python
Python (3.4.3)
py
Runtime Error
17
3064
301
n=int(input()) lis=list(map(int,input.split())) num=(n*(n+1))//2 if sum(lis)%num!=0: print("No") exit() li=[lis[i]-lis[i-1]-sum(lis)//num for i in range(n)] ans=0 for k in range(n): if -li[k]%n!=0: print("No") exit() ans+=-li[k]//n if ans == sum(lis)//num:print("Yes") else:print("No")
s051630209
p03808
u690536347
1536633653
Python
Python (3.4.3)
py
Runtime Error
84
14292
249
n=int(input()) *l,=map(int,input().split()) m=[0]*n a=n*(n+1)//2 b=sum(l) if b%a: print("NO") else: k=b//a for i in range(n): m[i]=(l[(i+1)%n]-l[i]-k) *o,=filter(lambda x:x<0 and x%n==0,m) if len(o)==k: print("YES") else: print("NO")
s373275879
p03808
u218843509
1536447511
Python
Python (3.4.3)
py
Runtime Error
97
14484
375
n = int(input()) a = list(map(int, input().split())) if sum(a) % (n * (n + 1) // 2) != 0: print("NO") else: k = sum(a) // (n * (n + 1) // 2) ok = True for i in range(n - 1): if (a[i] + k) % n != a[i + 1] % n or a[i] + k < a[i + 1]: ok = False break if (a[-1] + k) % n != a[0] % n or a[-1] + k < a[i + 1]: ...
s773329139
p03808
u870262604
1515955985
Python
Python (3.4.3)
py
Runtime Error
87
14996
674
def solve(): n = int(input()) a = list(map(int, input().split())) one = n*(n+1)/2 if sum(a) % one != 0: print("NO") else: nop = sum(a) / one d = [0 for i in range(n)] for i in range(n): d[i] = a[(i+1)%n] - a[i] d[i] = d[i] - nop count = 0 for i i...
s818538729
p03808
u761320129
1515800236
Python
Python (3.4.3)
py
Runtime Error
41
11104
272
N = int(input()) src = map(int,input().split()) S = sum(src) M = N*(N+1)//2 if S%M: print('NO') exit() K = S//M mem = [src[i] - K*i for i in range(N)] mem.append(mem[0]) for a,b in zip(mem,mem[1:]): if (a-b)%N: print('NO') exit() print('YES')
s983075499
p03808
u667084803
1498111722
Python
Python (3.4.3)
py
Runtime Error
17
2940
470
import sys N=int(input()) A=list(map(int,input().split())) total=0 for i in range(N): total+=A[i] if total*2/((N+1)*N)%1!=0: print("NO") sys.exit() times=int(total*2/((N+1)*N)) if (times-A[0]+A[N-1])/N%1! or times-A[0]+A[N-1]<0=0: print("NO") sys.exit() B=(times-A[0]+A[N-1])/N for i in range(N-1): B+=(times...
s818830740
p03808
u026450699
1491406889
Python
Python (2.7.6)
py
Runtime Error
11
2820
504
def getMaxIndex(list): maxVal = 0 maxIdx = 0 for i in range(0, len(list)): if(maxVal < list[i]): maxIdx = i maxVal = list[i] return maxIdx def check(list): for i in range(0, N): index = getMaxIndex(A) for j in range(0, N): A[(index + j + ...
s807097087
p03808
u369752439
1486270606
Python
Python (2.7.6)
py
Runtime Error
75
11344
828
N = int(raw_input()) inList = map(int, raw_input().split()) ans = "NO" key = sum(range(1,N+1)) flag = True tmpFlag = True if(sum(inList)%key != 0): flag = False if(max(inList) > min(inList)*N): flag = False minKey = min(inList) / key tmpList = [inList[(minId + i)%N] - minKey * key for i in range(N)] #while...
s753592245
p03808
u369752439
1486270368
Python
Python (2.7.6)
py
Runtime Error
78
11360
820
N = int(raw_input()) inList = map(int, raw_input().split()) ans = "NO" key = sum(range(1,N+1)) flag = True tmpFlag = True if(sum(inList)%key != 0): flag = False if(max(inList) > min(inList)*N): flag = False minKey = min(inList) / key tmpList = [inList[(minId + i)%N] - minKey * key for i in range(N)] while(...
s776571697
p03808
u369752439
1486270221
Python
Python (2.7.6)
py
Runtime Error
77
11344
820
N = int(raw_input()) inList = map(int, raw_input().split()) ans = "NO" key = sum(range(1,N+1)) flag = True tmpFlag = True if(sum(inList)%key != 0): flag = False if(max(inList) > min(inList)*N): flag = False minKey = min(inList) / key tmpList = [inList[(minId + i)%N] - minKey * key for i in range(N)] while(...
s001672911
p03808
u369752439
1486270141
Python
Python (2.7.6)
py
Runtime Error
74
11364
852
N = int(raw_input()) inList = map(int, raw_input().split()) ans = "NO" key = sum(range(1,N+1)) flag = True tmpFlag = True if(sum(inList)%key != 0): flag = False if(max(inList) > min(inList)*N): flag = False minKey = min(inList) / key print key, minKey tmpList = [inList[(minId + i)%N] - minKey * key for i i...
s094494860
p03808
u369752439
1486269988
Python
Python (2.7.6)
py
Runtime Error
75
11344
827
N = int(raw_input()) inList = map(int, raw_input().split()) ans = "NO" key = sum(range(1,N+1)) flag = True tmpFlag = True if(sum(inList)%key != 0): flag = False if(max(inList) > min(inList)*N): flag = False minKey = min(inList) / key tmpList = [inList[(minId + i)%N] - i - 1 - minKey * key for i in range(N)...
s996337960
p03808
u973712798
1486266641
Python
Python (3.4.3)
py
Runtime Error
22
3064
1268
n = int(input()) a = [int(i) for i in input().split()] def get_inv_diff(a): prev_val = a[-1] idx_lst = [] for idx, cur_val in enumerate(a): # print("cur,pre",cur_val,prev_val) if cur_val <= prev_val: idx_lst.append(idx) if idx != 0 and prev_val - cur_val > 3: ...
s220044977
p03808
u272028993
1486266425
Python
Python (2.7.6)
py
Runtime Error
117
11344
426
n=int(raw_input()) a=map(int,raw_input().split()) sn=n*(n+1)/2 if sum(a)%sn!=0: print("NO") exit() c=sum(a)/sn sa=sorted(a) if sa[0]<c or sa[n-1]>n*c: print("NO") exit() for i in xrange(n): if a[i]-a[(i+1)%n]<0: if abs(a[i]-a[i+1])>c: print("NO") exit() elif a[i]-...
s269305127
p03808
u369752439
1486266333
Python
Python (2.7.6)
py
Runtime Error
16
2696
386
import sys N = int(next(sys.stdin)) inList = map(int, next.stdin.split()) def checkList(inList, N): maxId = inList.index(max(inList)) for i in range(N): inList[(maxId-i)%N] -= N - i print inList if(max(inList) == 0 and min(inList) == 0): return "Yes" if(min(inList) < 0): retu...
s902844880
p03808
u012693733
1486266234
Python
Python (2.7.6)
py
Runtime Error
15
2568
260
n = int(raw_input()) a = map(int, raw_input().split()) if 0 max(a) >= len(a) and sum(a) % (n * (n + 1) / 2) == 0: for j in xrange(n + 1): i = a.index(max(a)) a[(i + j) % n] -= j if not 0 in a: print 'YES' else: print 'NO'
s272291772
p03808
u439009525
1486264791
Python
Python (3.4.3)
py
Runtime Error
40
11172
319
N=int(input()) A_list=map(int, input().split()) # N=7 # A_list=[1,2,3,4,5,6,7] # N=5 # A_list=[4,5,1,2,3] # A_list=[6,9,12,10,8] # N=4 # A_list=[1,2,3,1] d_list=[A_list[j]-A_list[j-1] for j in range(0, N)] if 0 in d_list: print("NO") else: if sum(d_list)==0: print("YES") else: print("NO")
s252500516
p03808
u720968399
1486264241
Python
Python (2.7.6)
py
Runtime Error
16
2568
382
import numpy as np N = int(raw_input()) n = np.array(map(int, raw_input().split())) Nsum = np.sum(n) if Nsum % np.sum(np.arange(N+1)[1:]): print 'NO' exit() sa = np.append(n[1:], n[0]) - n tmp = np.sum(sa % N != Nsum / np.sum(np.arange(N+1)[1:])) tmp2 = np.sum(np.abs(sa) / N > (N-1)*Nsum / np.sum(np.arange(...
s019118791
p03808
u439009525
1486264096
Python
Python (3.4.3)
py
Runtime Error
39
11172
385
N=int(input()) A_list=map(int, input().split()) # N=7 # A_list=[1,2,3,4,5,6,7] # N=5 # A_list=[4,5,1,2,3] # A_list=[6,9,12,10,8] # N=4 # A_list=[1,2,3,1] m=1 while m>0: i=(A_list.index(max(A_list))) A_list=[A_list[(i+j)%N]-j for j in range(1, N+1)] m=min(A_list) if m<0: print("NO") elif m==0: if m...
s222673991
p03808
u720968399
1486262223
Python
Python (2.7.6)
py
Runtime Error
16
2572
304
import numpy as np N = int(raw_input()) n = np.array(map(int, raw_input().split())) Nsum = np.sum(n) if not Nsum % np.cumsum(np.arange(N)): print 'NO' return sa = n[1:-1] - n for s in sa: if s % n != Nsum / np.cumsum(np.arange(N)): print 'NO' return print 'YES' return
s031695535
p03809
u906428167
1593205897
Python
PyPy3 (7.3.0)
py
Runtime Error
2208
101244
1198
from collections import deque n = int(input()) a = [int(x) for x in input().split()] g = [[] for _ in range(n)] if n == 2: print('YES' if a[0] == a[1] else 'NO') exit() for _ in range(n-1): aa, b = map(int, input().split()) aa -= 1 b -= 1 g[aa].append(b) g[b].append(aa) if len(g[aa]) =...
s361668185
p03809
u488401358
1592634104
Python
PyPy3 (7.3.0)
py
Runtime Error
85
74780
726
import sys input=sys.stdin.readline sys.setrcursionlimit(2*10**5) N=int(input()) A=list(map(int,input().split())) edge=[[] for i in range(N)] for i in range(N-1): a,b=map(int,input().split()) edge[a-1].append(b-1) edge[b-1].append(a-1) root=0 for i in range(N): if len(edge[i])!=1: root=i ...
s824065077
p03809
u488401358
1592634064
Python
PyPy3 (7.3.0)
py
Runtime Error
102
74788
733
import sys input=sys.stdin.buffer.readline sys.setrcursionlimit(2*10**5) N=int(input()) A=list(map(int,input().split())) edge=[[] for i in range(N)] for i in range(N-1): a,b=map(int,input().split()) edge[a-1].append(b-1) edge[b-1].append(a-1) root=0 for i in range(N): if len(edge[i])!=1: root...
s114497051
p03809
u638795007
1591457525
Python
PyPy3 (2.4.0)
py
Runtime Error
488
78500
1879
def examA(): N = I() A = LI() ans = "YES" cur = 0 for a in A: if a%2==1: cur +=1 if cur%2==1: ans = "NO" print(ans) return def examB(): N = I() A = LI() ans = "YES" sumA = sum(A) oneA = (1+N)*N//2 if sumA%oneA!=0: ans = "NO" ...
s189892650
p03809
u682686221
1586298551
Python
Python (3.4.3)
py
Runtime Error
17
2940
1779
#include <bits/stdc++.h> #define rep(i,n) for(int i=0;i<(int)(n);i++) #define FOR(i,n,m) for(int i=(int)(n); i<=(int)(m); i++) #define RFOR(i,n,m) for(int i=(int)(n); i>=(int)(m); i--) #define ITR(x,c) for(__typeof(c.begin()) x=c.begin();x!=c.end();x++) #define RITR(x,c) for(__typeof(c.rbegin()) x=c.rbegin();x!=c.rend...
s730188996
p03809
u905582793
1585160448
Python
PyPy3 (2.4.0)
py
Runtime Error
548
97240
1029
import random import sys input = sys.stdin.readline n = int(input()) stone = [0]+list(map(int,input().split())) ab = [list(map(int,input().split())) for i in range(n-1)] graph = [[] for i in range(n+1)] dp = [[] for i in range(n+1)] deg = [0]*(n+1) stack = [] for a,b in ab: graph[a].append(b) graph[b].append(a) d...
s248834002
p03809
u340781749
1582936892
Python
Python (3.4.3)
py
Runtime Error
621
117928
1119
import sys sys.setrecursionlimit(10 ** 6) def dfs(v, p, aaa): if len(links[v]) == 1: return aaa[v] children = [] for u in links[v]: if u == p: continue result = dfs(u, v, aaa) if result == -1: return -1 children.append(result) if len(c...
s328037082
p03809
u340781749
1582936799
Python
Python (3.4.3)
py
Runtime Error
683
117924
1123
import sys sys.setrecursionlimit(10 ** 5 + 5) def dfs(v, p, aaa): if len(links[v]) == 1: return aaa[v] children = [] for u in links[v]: if u == p: continue result = dfs(u, v, aaa) if result == -1: return -1 children.append(result) if l...
s630132472
p03809
u892251744
1578939750
Python
PyPy3 (2.4.0)
py
Runtime Error
446
82540
1572
def main(): import sys from collections import deque input = sys.stdin.readline N = int(input()) A = list(map(int, input().split())) adj = [[] for _ in range(N+1)] for _ in range(N-1): a, b = map(int, input().split()) adj[a].append(b) adj[b].append(a) for v in r...
s909841088
p03809
u368780724
1576547494
Python
PyPy3 (2.4.0)
py
Runtime Error
492
95596
1487
import sys readline = sys.stdin.readline from collections import Counter def calc(A): s = sum(A) ma = max(A) if 2*ma > s: return s - ma return s//2 def check(): candi = [[] for _ in range(N)] for l in L[:0:-1]: p = P[l] if candi[l]: x = sum(candi[l]) - cand...
s746520461
p03809
u627417051
1576117354
Python
Python (3.4.3)
py
Runtime Error
743
121952
1413
#設定 import sys input = sys.stdin.buffer.readline #ライブラリインポート from collections import defaultdict #入力受け取り def getlist(): return list(map(int, input().split())) #部分木 大きさ import sys sys.setrecursionlimit(10**7) from collections import defaultdict class Graph(object): def __init__(self): self.graph = defaultdict(l...
s510487517
p03809
u236127431
1545071149
Python
PyPy3 (2.4.0)
py
Runtime Error
826
80628
682
N=int(input()) A=[int(i) for i in input().split()] G=[[] for i in range(N)] for i in range(N-1): a,b=map(int,input().split()) G[a-1].append(b-1) G[b-1].append(a-1) Visited=[False]*N B=[0]*N def B_map(x): C=[] S=-1 Visited[x]=True for i in G[x]: if not Visited[i]: res=B_map(i) if S<0: ...
s554340960
p03809
u236127431
1545063006
Python
PyPy3 (2.4.0)
py
Runtime Error
769
80756
496
N=int(input()) A=[int(i) for i in input().split()] G=[[] for i in range(N)] for i in range(N-1): a,b=map(int,input().split()) G[a-1].append(b-1) G[b-1].append(a-1) Visited=[False]*N B=[0]*N def B_map(x): res=-1 Visited[x]=True for i in G[x]: if not Visited[i]: if res<0: res=B_map(i) ...
s772790663
p03809
u884982181
1544396093
Python
Python (3.4.3)
py
Runtime Error
869
45360
863
n = int(input()) a = list(map(int,input().split())) g = [[]for i in range(n)] for i in range(n-1): x,y = map(int,input().split()) x-=1;y-=1 g[x].append(y) g[y].append(x) used = [0]*n ue = [0]*n for i in range(n): if len(g[i])== 1: ne = i break huka = [0]*n def dfs(x,y,z): if used[x]: return 0 ...
s651437517
p03809
u767131578
1489754431
Python
Python (3.4.3)
py
Runtime Error
1285
55812
1545
import copy def traverse(N,A,mm): if N<2 or len(A)!=N+1 or len(mm)!=N+1: return(False) m=copy.deepcopy(mm) t=[] rp=[] c=[] for i in range(N+1): t.extend([0]) rp.extend([0]) c.extend([[0]]) start=1 for i in range(start,N+1): if len(m[i])==1 and A[i]>0: #if A[i]>0: root=i break eerror=Fals...
s899450949
p03809
u767131578
1489754042
Python
Python (3.4.3)
py
Runtime Error
1394
56196
1545
import copy def traverse(N,A,mm): if N<2 or len(A)!=N+1 or len(mm)!=N+1: return(False) m=copy.deepcopy(mm) t=[] rp=[] c=[] for i in range(N+1): t.extend([0]) rp.extend([0]) c.extend([[0]]) start=1 for i in range(start,N+1): #if len(m[i])==1 and A[i]>0: if A[i]>0: root=i break eerror=Fals...
s162064402
p03809
u767131578
1489752955
Python
Python (3.4.3)
py
Runtime Error
1345
56184
1485
import copy def traverse(N,A,mm): m=copy.deepcopy(mm) t=[] rp=[] c=[] for i in range(N+1): t.extend([0]) rp.extend([0]) c.extend([[0]]) start=1 for i in range(start,N+1): #if len(m[i])==1 and A[i]>0: if A[i]>0: root=i break eerror=False if len(m[root]) in [0,1]: t[root]=A[root] else: ...
s228028104
p03809
u767131578
1489655372
Python
Python (3.4.3)
py
Runtime Error
1270
55940
1477
import copy def traverse(N,A,mm): m=copy.deepcopy(mm) t=[] rp=[] c=[] for i in range(N+1): t.extend([0]) rp.extend([0]) c.extend([[0]]) start=1 for i in range(start,N+1): #if len(m[i])==1 and A[i]>0: if A[i]>0: root=i break eerror=False if len(m[root]) in [0,1]: t[root]=A[root] else: ...
s854778786
p03809
u767131578
1489619946
Python
Python (3.4.3)
py
Runtime Error
1246
55812
1426
import copy def traverse(N,A,mm): m=copy.deepcopy(mm) t=[] rp=[] c=[] for i in range(N+1): t.extend([0]) rp.extend([0]) c.extend([[0]]) start=1 for i in range(start,N+1): #if len(m[i])==1 and A[i]>0: if A[i]>0: root=i break eerror=False if len(m[root]) in [0,1]: t[root]=A[root] else: ...
s512857364
p03809
u767131578
1489619215
Python
Python (3.4.3)
py
Runtime Error
1361
55940
1426
import copy def traverse(N,A,mm): m=copy.deepcopy(mm) t=[] rp=[] c=[] for i in range(N+1): t.extend([0]) rp.extend([0]) c.extend([[0]]) start=1 for i in range(start,N+1): #if len(m[i])==1 and A[i]>0: if A[i]>0: root=i break eerror=False if len(m[root]) in [0,1]: t[root]=A[root] else: ...
s811801326
p03809
u767131578
1489212327
Python
Python (3.4.3)
py
Runtime Error
710
26928
867
N= int(input()) A=[[]] for x in input().split(): A.extend([int(x)]) m=[] t=[] rp=[] for i in range(N+1): m.extend([[]]) t.extend([0]) rp.extend([0]) for i in range(N-1): l=[int(xx) for xx in input().split()] m[l[0]]+=[l[1]] m[l[1]]+=[l[0]] for i in range(1,N+1): if len(m[i])==1 and A[i]>0: root=i break ...
s468252023
p03809
u767131578
1489211570
Python
Python (3.4.3)
py
Runtime Error
770
26928
784
N= int(input()) A=[[]] for x in input().split(): A.extend([int(x)]) m=[] t=[] rp=[] for i in range(N+1): m.extend([[]]) t.extend([0]) rp.extend([0]) for i in range(N-1): l=[int(xx) for xx in input().split()] m[l[0]]+=[l[1]] m[l[1]]+=[l[0]] for i in range(1,N+1): if len(m[i])==1 and A[i]>0: root=i break ...
s020265364
p03809
u767131578
1489030406
Python
Python (3.4.3)
py
Runtime Error
618
38052
598
def TTT(me=0,r=0): mm=m[me] l=len(mm) if l==1: if r!=0: ret=A[me] else: ret=TTT(mm[0],me) else: c=0 for i in range(l): if mm[i]!=r: c+=TTT(mm[i],me) ret=2*A[me]-c #print(me,r,ret) return(ret) N= int(input()) A=[[]]+[int(x) for x in input().split()] L=[] for i in range(N-1): ...
s160498773
p03809
u767131578
1489030123
Python
Python (3.4.3)
py
Runtime Error
616
38080
620
def TTT(A=[],m=[],me=0,r=0): mm=m[me] l=len(mm) if l==1: if r!=0: ret=A[me] else: ret=TTT(A,m,mm[0],me) else: c=0 for i in range(l): if mm[i]!=r: c+=TTT(A,m,mm[i],me) ret=2*A[me]-c #print(me,r,ret) return(ret) N= int(input()) A=[[]]+[int(x) for x in input().split()] L=[] for...
s191923899
p03809
u767131578
1488861652
Python
Python (3.4.3)
py
Runtime Error
17
3064
768
def T(A=[],lines=[],me=0,parent=0): if [x for y in lines for x in y].count(me)==1 and parent==0: for a in lines: if a[0]==me: return(T(A,lines,a[1],me)) elif a[1]==me: return(T(A,lines,a[0],me)) elif [me,parent] not in lines and [parent,me] not in lines: return(0) else: sl=0 for a in lines: ...
s882283410
p03810
u905582793
1590274881
Python
PyPy3 (2.4.0)
py
Runtime Error
172
38384
721
from math import gcd n = int(input()) a = list(map(int,input().split())) def gcds(ls): ret = 0 for i in ls: ret = gcd(ret,i) return ret def flg(ls): if (sum(ls)-len(ls))%2: ret = 1 else: ret = 2 return ret if n%2 == 0: if sum(a)%2: print("Second") else: print("First") else: cnt = 0...
s863390982
p03810
u368780724
1590146192
Python
PyPy3 (2.4.0)
py
Runtime Error
647
104212
472
import sys readline = sys.stdin.readline from functools import reduce def gcd(a,b): while b: a, b = b, a%b return a def calc(A): N = len(A) K = sum(1 for a in A if a % 2 == 0) if K & 1: return True if N-1 != K: return False A = [a-a%2 for a in A] g = reduce(gcd, ...
s803007937
p03810
u693716675
1586033280
Python
Python (3.4.3)
py
Runtime Error
19
3064
997
#d #the niumbers of evens is important #the point is, there is no influence to odd/even if you divide them by odd numbers. #You should do simulation only in the case where there is one odd over 3 and even numbers of even numbers from math import gcd def count(a): odd, even = 0,0 for x in a: if x % 2 =...
s957145700
p03810
u785578220
1549404735
Python
Python (3.4.3)
py
Runtime Error
18
2940
363
n = int(input()) x = list(map(int, input().split())) j = 1 k=1 while j: s=0 if 1 in x: s = sum(x)-n break for i in range(n): if x[i]%2 == 0: x[i]/=2 s+=1 else: x[i] = (x[i]-1)/2 if s == n-1 and s%2==0):j = 1 else:j=0 if s %2 != 0: ...
s617303369
p03810
u767131578
1490415795
Python
Python (3.4.3)
py
Runtime Error
2104
16080
986
import copy def gcd(a, b): while b: a, b = b, a % b return a def gcdm(x): g=x[0] for i in range(1,len(x)): g=gcd(g,x[i]) return(g) def score(A): return(sum(A)-len(A)) def Ifavor(A): return(score(A)%2==1) def playmove(A,i): A[i]-=1 g=gcdm(A) A=[x//g for x in A] def testmove(A,i): N=len(A) A[i]-=1...
s728028618
p03811
u767131578
1492217568
Python
Python (3.4.3)
py
Runtime Error
2117
214172
1686
import random def tester(N=0): maxno1=10 maxno2=1e2 s=input() if s!='': return(s) if N==0: return(6) return(random.randint(2,maxno1)) else: print('Testing...') print('N=',N) return('2 3 4 5 6 25') A=[] for i in range(N): A.extend([random.randint(1,maxno2)]) r=' '.join(list(map(str,A))...
s278872893
p03811
u637175065
1486266000
Python
Python (3.4.3)
py
Runtime Error
84
7756
1405
import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,random,time sys.setrecursionlimit(10**7) inf = 10**20 mod = 10**9 + 7 def LI(): return list(map(int, input().split())) def II(): return int(input()) def LS(): return input().split() def S(): return input() def main(): n = II() a = ...
s094281848
p03812
u284102701
1518874404
Python
Python (3.4.3)
py
Runtime Error
17
2940
1032
#include <bits/stdc++.h> //#include <math.h> using namespace std; #define INF 1.1e9 #define LINF 1.1e18 #define FOR(i,a,b) for (int i=(a);i<(b);++i) #define REP(i,n) FOR(i,0,n) #define ALL(v) (v).begin(),(v).end() #define pb push_back #define pf push_front #define fi first #define se second #define BIT(x,n) bitset<n>(...
s097084348
p03812
u934019430
1486349773
Python
Python (3.4.3)
py
Runtime Error
68
7100
1199
#!/usr/bin/env python3 # -*- coding: utf-8 -*- from fractions import gcd def readln(): _res = list(map(int,str(input()).split(' '))) return _res def calc(x,line): if line == 0: for l in v[x]: if e[l][0] == x: son = e[l][1] else: son = e[l][0] if a[son-1] < a[x-...
s588315936
p03813
u987039273
1601235899
Python
Python (3.8.2)
py
Runtime Error
24
9100
88
X= (int(x) for x in input().split()) if X>1200: print("ARC") else : print("ABC")
s719587586
p03813
u546853743
1598379319
Python
Python (3.8.2)
py
Runtime Error
25
9024
68
x = int,input() if x < 1200: print('ABC') else: print("ARC")
s026967484
p03813
u834301346
1598052193
Python
Python (3.8.2)
py
Runtime Error
33
9740
114
import re letter = str(input()) pattern = 'A(.*)Z' target = re.search(pattern, letter).group() print(len(target))
s271141635
p03813
u909716307
1597790576
Python
Python (3.8.2)
py
Runtime Error
20
8940
43
print('ABC'if x=int(input())<1200else'ARC')
s120725941
p03813
u075303794
1597636475
Python
Python (3.8.2)
py
Runtime Error
26
8960
62
x=int(inptu()) if x<1200: print('ABC') else: print('ARC')
s237899161
p03813
u608355135
1597293046
Python
Python (3.8.2)
py
Runtime Error
27
9028
60
x=input() if x<1200: print("ABC") else: print("ARC")
s513013833
p03813
u835575472
1597261782
Python
Python (3.8.2)
py
Runtime Error
22
9024
70
rate = int(input()) if rate < 1200: print("ABC") else: print("ARC)
s839549993
p03813
u886907961
1597139552
Python
Python (3.8.2)
py
Runtime Error
39
8980
61
n = int(input) if n<1200: print("ABC") else: print("ARC")
s125597182
p03813
u886907961
1597139509
Python
Python (3.8.2)
py
Runtime Error
19
8772
62
n = int(input) if n<1200: print("ABC") else: print("ARC")
s971234758
p03813
u684743124
1595922463
Python
Python (3.8.2)
py
Runtime Error
22
8848
40
print("ABC" if input()<1200 else "ARC")
s414565791
p03813
u309716323
1594602770
Python
PyPy3 (7.3.0)
py
Runtime Error
94
74896
240
def read_int(): return int(input().strip()) def read_ints(): return list(map(int, input().strip().split(' '))) def solve(): A, B, C, D = read_ints() return max(A*B, C*D) if __name__ == '__main__': print(solve())
s389129325
p03813
u099217546
1593523870
Python
Python (3.8.2)
py
Runtime Error
22
8952
81
input_line = int(input()) if input_line >= 1200 print("ARC") else print("ABC")
s095364909
p03813
u095844416
1590565424
Python
Python (3.4.3)
py
Runtime Error
17
2940
67
a=int(input()) if x < 1200: print('ABC') else: print('ARC')
s178198309
p03813
u732743460
1590468022
Python
Python (3.4.3)
py
Runtime Error
20
3316
170
from collections import Counter N = int(input()) A = sorted(list(map(int,input().split()))) edible = sum(i-1 for i in Counter(A).values()) print(len(set(A))-edible%2)
s920527595
p03813
u475966842
1590097002
Python
Python (3.4.3)
py
Runtime Error
17
2940
39
print("A"+"RB"[int(input())<1200)]+"C")
s528766918
p03813
u381282312
1589555197
Python
Python (3.4.3)
py
Runtime Error
17
2940
156
s = input() t = [] u = [] for i in range(len(s)): if s[i] == 'A': t.append(i) if s[i] == 'Z': u.append(i) print(max(u) - min(t) + 1)
s513673650
p03813
u891217808
1588726493
Python
PyPy3 (2.4.0)
py
Runtime Error
180
38384
69
n = int(input()) if x < 1200: print('ABC') else: print('ARC')
s625660165
p03813
u600261652
1588526563
Python
Python (3.4.3)
py
Runtime Error
17
2940
58
x = input() if x<1200: print("ABC") else: print("ARC")
s113967742
p03813
u600261652
1588526475
Python
Python (3.4.3)
py
Runtime Error
17
2940
58
x = input() if x<1200: print("ABC") else: pritn("ARC")
s891398369
p03813
u227085629
1587764406
Python
Python (3.4.3)
py
Runtime Error
17
2940
63
a = int(input()) if a<1200: pirnt('ABC') else: print('ARC')
s305437268
p03813
u896741788
1587613778
Python
Python (3.4.3)
py
Runtime Error
17
2940
54
print("A{}C".format("B" if int(input()<1200 else "R"))
s914372660
p03813
u735335967
1587603887
Python
Python (3.4.3)
py
Runtime Error
17
2940
177
s = input() ca = [] cz = [] ans = 0 for i in range(len(s)): if s[i] == "A": ca.append(i) if s[i] == "Z": cz.append(i) ans = max(cz)-min(ca)+1 print(ans)
s918384396
p03813
u172780602
1586711948
Python
Python (3.4.3)
py
Runtime Error
16
2940
61
x=input() if x>=1200: print("ARC") else: print("ABC")
s390162191
p03813
u457957084
1586708149
Python
Python (3.4.3)
py
Runtime Error
17
2940
69
x = int(input()) if x < 1200: print(ABC) else: print(ARC)
s189679704
p03813
u457957084
1586708122
Python
Python (3.4.3)
py
Runtime Error
18
2940
64
x = int(input()) if x, 1200: print(ABC) else: print(ARC)
s817118155
p03813
u787449825
1586218310
Python
Python (3.4.3)
py
Runtime Error
17
2940
63
x = int(inout()) if x>1200: print('ARC') else: print('ABC')
s913176923
p03813
u760961723
1585196062
Python
Python (3.4.3)
py
Runtime Error
17
2940
65
X = int(input()) if x < 1200: print("ABC") else: print("ARC")
s001219213
p03813
u623819879
1584855586
Python
PyPy3 (2.4.0)
py
Runtime Error
168
38256
41
print('A'+'RB'[input()[:2]<’12’]+'C')