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
s671547510
p03723
u254343015
1494122170
Python
Python (2.7.6)
py
Runtime Error
10
2568
304
N,M = map(int,raw_input().split()) node_list = [0 for l in range(N)] for i in range(M): items = map(int,raw_input().split()) node_list[items[0]-1]+=1 node_list[items[1]-1]+=1 flag=False for n in range(N): if n%2==1: flag=True if flag: print 'NO' else: print 'YES'
s064464594
p03723
u254343015
1494121599
Python
Python (2.7.6)
py
Runtime Error
10
2568
305
N,M = map(int,raw_input().split()) node_list = [0 for l in range(N)] for i in range(M): items = map(int,raw_input().split()) node_list[items[0]-1]+=1 node_list[items[1]-1]+=1 flag=False for n in range(N): if n%2==1: flag=True if flag: print 'NO' else: print 'YES'
s641157758
p03723
u254343015
1494121431
Python
Python (2.7.6)
py
Runtime Error
10
2696
318
N,M = map(int,raw_input().split()) node_list = [0 for l in range(N)] for i in range(M): items = map(int,raw_input().split()) node_list[items[0]-1]+=1 node_list[items[1]-1]+=1 flag=False for i in range(N): if node_list[i]%2==1: flag=True if flag: print 'YES' else: print 'NO'
s624410282
p03723
u402189762
1494120722
Python
Python (3.4.3)
py
Runtime Error
21
3316
370
A=int(input()) B=int(input()) C=int(input()) time=0 s=0 if A==B and B==C and A%2==0: print(-1) else: while(s==0): if A%2==1 or B%2==1 or C%2==1: print(time) break; else: time+=1 a=int(A/2) b=int(B/2) c=int(C/2) ...
s904670275
p03723
u402629484
1494119688
Python
Python (3.4.3)
py
Runtime Error
21
3316
304
def main(): a, b, c = map(int, input().split()) count = 0 while (a | b | c) & 1 == 0: if a==b==c: print(-1) return a, b, c = (b + c) >> 1, (c + a) >> 1, (a + b) >> 1 count += 1 print(a,b,c) print(count) while True: main()
s305226776
p03724
u668785999
1600648813
Python
Python (3.8.2)
py
Runtime Error
221
9660
307
N,M = map(int,input().split()) cntNode = [0]*N for i in range(N): a,b = map(int,input().split()) a -= 1 b -= 1 cntNode[a] += 1 cntNode[b] += 1 flag = True for i in range(N): if(cntNode[i] % 2 != 0): flag = False break if(flag): print('YES') else: print('NO')
s217484777
p03724
u668785999
1600648775
Python
Python (3.8.2)
py
Runtime Error
221
9632
307
N,M = map(int,input().split()) cntNode = [0]*N for i in range(N): a,b = map(int,input().split()) a -= 1 b -= 1 cntNode[a] += 1 cntNode[b] += 1 flag = True for i in range(N): if(cntNode[i] % 2 != 0): flag = False break if(flag): print('Yes') else: print('No')
s202053484
p03724
u648881683
1597288307
Python
Python (3.8.2)
py
Runtime Error
134
11460
1087
import bisect, collections, copy, heapq, itertools, math, string, sys input = lambda: sys.stdin.readline().rstrip() sys.setrecursionlimit(10**7) INF = float('inf') def I(): return int(input()) def F(): return float(input()) def SS(): return input() def LI(): return [int(x) for x in input().split()] def LI_(): return [...
s449406713
p03724
u225388820
1597126202
Python
PyPy3 (7.3.0)
py
Runtime Error
116
76416
229
import sys input = sys.stdin.readline n, m = map(int, input().split()) a = [0] * n for _ in range(m): x, y = map(int, input().split()) a[x] = (a[x] + 1) & 1 a[y] = (a[y] + 1) & 1 print("YES" if sum(a) == 0 else "NO")
s960077325
p03724
u225388820
1597120485
Python
PyPy3 (7.3.0)
py
Runtime Error
254
105256
773
from collections import defaultdict # d = defaultdict(int)で0で初期化 # d = defaultdict(lambda: 100)で100で初期化 import sys input = sys.stdin.readline n, m = map(int, input().split()) es = [defaultdict(int) for _ in range(n)] for i in range(m): a, b = map(int, input().split()) a -= 1 b -= 1 es[a][b] += 1 es[...
s564499612
p03724
u361381049
1594934092
Python
PyPy3 (7.3.0)
py
Runtime Error
97
74356
158
N = int(input()) M = int(input()) for i in range(M): a,b = map(int,input().split()) if N % 2 == 0 and M % 2 == 0: print('Yes') else: print('No')
s969300269
p03724
u545368057
1593519380
Python
Python (3.8.2)
py
Runtime Error
205
10608
525
""" rootを決めて、aから必ずrootを通ってbに到達するとする aとbのlcaより上は、+2されることになるので、実質通っていないのと同値 どんな木であっても、自分自身が偶数回(0を含む)でてこないと ノードの値は偶数にはなりえない """ n, m = map(int, input().split()) cnts = [0] * (n+1) for i in range(n): a,b = map(int, input().split()) cnts[a] += 1 cnts[b] += 1 if all([c%2 == 0 for c in cnts]): print("YES") el...
s008264343
p03724
u134019875
1592476265
Python
Python (3.4.3)
py
Runtime Error
347
15084
245
n, m = map(int, input().split()) d = {i: 0 for i in range(1, n+1)} for _ in range(n): a, b = map(int, input().split()) d[a] += 1 d[b] += 1 for k, v in d.items(): if v % 2: print('NO') break else: print('YES')
s024907554
p03724
u134019875
1592476195
Python
Python (3.4.3)
py
Runtime Error
334
15084
243
n, m = map(int, input().split()) d = {i: 0 for i in range(1, n)} for _ in range(n): a, b = map(int, input().split()) d[a] += 1 d[b] += 1 for k, v in d.items(): if v % 2: print('NO') break else: print('YES')
s700409829
p03724
u134019875
1592475973
Python
Python (3.4.3)
py
Runtime Error
375
15084
335
n, m = map(int, input().split()) d = {i: 0 for i in range(1, n)} for _ in range(n): a, b = map(int, input().split()) if a != 1: d[a] = 1 if a not in d else d[a] + 1 if b != 1: d[b] = 1 if b not in d else d[b] + 1 for k, v in d.items(): if v % 2: print('NO') break else: ...
s067229236
p03724
u318127926
1591743707
Python
Python (3.4.3)
py
Runtime Error
323
3828
230
n, m = map(int, input().split()) nnode = [0]*n for _ in range(n): a, b = map(int, input().split()) nnode[a-1] += 1 nnode[b-1] += 1 for i in nnode: if i%2==1: print('NO') break else: print('YES')
s028625734
p03724
u514118270
1590725257
Python
Python (3.4.3)
py
Runtime Error
18
3064
324
A,B,C = map(int,input().split()) if A*2 == B+C and B*2 == A+C and C*2 == A+B: print(-1) exit() ans = 0 for i in range(10000): a = A//2 b = B//2 c = C//2 if A%2 == 0 and B%2 == 0 and C%2 == 0: ans += 1 A = b+c B = a+c C = a+b else: print(ans) ex...
s550469025
p03724
u934442292
1589753179
Python
Python (3.4.3)
py
Runtime Error
144
3828
368
import sys input = sys.stdin.readline def main(): N, M = map(int, input().split()) count = [0] * (N + 1) for _ in range(N): a, b = map(int, input().split()) count[a] += 1 count[b] += 1 if all(c % 2 == 0 for c in count): ans = "YES" else: ans = "NO" pri...
s774528171
p03724
u896741788
1589082255
Python
Python (3.4.3)
py
Runtime Error
17
2940
197
n,m=map(int,input().split()) c=sum([list(map(int,input().split())) for i in range(m)],[]) from collections import Counter as co for i in co(c).values(): if i%2:print("NO");exit() print("YES")
s705176082
p03724
u489959379
1588949845
Python
Python (3.4.3)
py
Runtime Error
313
3828
420
import sys sys.setrecursionlimit(10 ** 7) f_inf = float('inf') mod = 10 ** 9 + 7 def resolve(): n, m = map(int, input().split()) cnt = [0] * n for i in range(n): a, b = map(int, input().split()) cnt[a - 1] += 1 cnt[b - 1] += 1 for i in cnt: if i % 2: prin...
s394340761
p03724
u372144784
1588439575
Python
PyPy3 (2.4.0)
py
Runtime Error
294
46940
392
#AGC014-B Unplanned Queries import sys from collections import defaultdict readline = sys.stdin.buffer.readline def even(n): return 1 if n%2==0 else 0 n,m = map(int,readline().split()) dic1 = defaultdict(int) for i in range(n): a,b = map(int,readline().split()) dic1[a] += 1 dic1[b] += 1 for i in dic1.value...
s932045903
p03724
u228223940
1588291724
Python
PyPy3 (2.4.0)
py
Runtime Error
588
60888
372
n,m = map(int,input().split()) ab = [[int(i) for i in input().split()] for j in range(m)] im_b = [0]*(n) for i in range(n): im_b[ab[i][0]-1] += 1 im_b[ab[i][1]-1] -= 1 if im_b[0] % 2 == 1: print('NO') exit() #im_a = [0]*(n) #im_a[0] = im_b[0] for i in range(n-1): #print(i) if im_b[i] % 2 ==...
s688407972
p03724
u373047809
1588271261
Python
Python (3.4.3)
py
Runtime Error
96
19060
99
c = [0]*10**5 for i in open(0).read().split()[2::]: c[int(i)] ^= 1 print("NO" if any(c) else "YES")
s877757969
p03724
u373047809
1588268843
Python
Python (3.4.3)
py
Runtime Error
67
19060
99
c = [0]*10**5 for i in open(0).read().split()[::2]: c[int(i)] ^= 1 print("NO" if any(c) else "YES")
s402642146
p03724
u246217175
1588194981
Python
PyPy3 (2.4.0)
py
Runtime Error
586
65112
294
n,m = map(int,input().split()) from collections import Counter s = [] for _ in range(n): a,b = map(int,input().split()) s.append(a) s.append(b) c = Counter(s) d = list(c.values()) ans = "YES" for i in d: if i % 2 == 1: ans = "NO" break print(ans)
s390917077
p03724
u211805975
1587088259
Python
Python (3.4.3)
py
Runtime Error
18
3060
259
#13 a,b,c = map(int,input().split()) cnt = 0 if a%2 == 1 or b%2 == 1 or c%2 == 1: print(0) while a%2 == b%2 == c%2 == 0: if a==b==c: print('-1') break else: a,b,c = b//2+c//2,c//2+a//2+a//2+b//2 cnt+=1 print(cnt)
s917132031
p03724
u211805975
1587088219
Python
Python (3.4.3)
py
Runtime Error
18
3064
280
#13 a,b,c = map(int,input().split()) cnt = 0 if a%2 == 1 or b%2 == 1 or c%2 == 1: print(0) while a%2 == b%2 == c%2 == 0: if a==b==c: print('-1') break else: a,b,c = b//2+c//2,c//2+a//2+a//2+b//2 cnt+=1 print(a,b,c) print(cnt)
s342025235
p03724
u179169725
1586578026
Python
Python (3.4.3)
py
Runtime Error
21
3316
1159
# https://atcoder.jp/contests/agc014/tasks/agc014_b # 条件を満たすものが存在するかの判別問題 # クエリをグラフにして考えてみる # a-bを結ぶすべての経路は木上のa-b間の経路を必ず通る # つまりa-b間の経路の数が偶数である必要がある。すべてのノードに対してエッジが偶数個つながっているかを確認すればよい import sys sys.setrecursionlimit(1 << 25) read = sys.stdin.readline ra = range enu = enumerate def read_ints(): return list(map(...
s591255610
p03724
u984276646
1584483856
Python
Python (3.4.3)
py
Runtime Error
17
3064
231
N, M = map(int, input().split()) D = {i: 0 for i in range(1, N + 1)} for i in range(M): a, b = map(int, input().split()) D[a], D[b] += 1 p = 0 for i in D: if i % 2 == 1: p = 1 if p == 0: print("YES") else: print("NO")
s082300575
p03724
u043048943
1584328566
Python
PyPy3 (2.4.0)
py
Runtime Error
204
38640
12
わからん
s856380129
p03724
u867848444
1582738002
Python
Python (3.4.3)
py
Runtime Error
453
32452
300
from collections import defaultdict n,m=map(int,input().split()) ab=[list(map(int,input().split())) for i in range(n)] cnt=defaultdict(lambda :0) for i in range(m): for j in range(2): cnt[ab[i][j]]+=1 for i in cnt.values(): if i%2!=0: print('NO') exit() print('YES')
s318679402
p03724
u186838327
1582723677
Python
PyPy3 (2.4.0)
py
Runtime Error
315
49468
341
import sys #sys.setrecursionlimit(10**9) input = sys.stdin.readline n, m = map(int, input().split()) d = {} for i in range(n): d[i] = 0 for i in range(n): a, b = map(int, input().split()) a, b = a-1, b-1 d[a] += 1 d[b] += 1 for v in d.values(): if v%2 != 0: print('NO') exit() e...
s030253566
p03724
u503228842
1582415714
Python
Python (3.4.3)
py
Runtime Error
356
3828
331
N, M = map(int,input().split()) freq = [True]*M for i in range(N): a,b = map(int,input().split()) a-=1 b-=1 if freq[a]: freq[a] = False else: freq[a] = True if freq[b]: freq[b] = False else: freq[b] = True ans = all(freq) if ans: print('YES') else: p...
s504709408
p03724
u503228842
1582415657
Python
Python (3.4.3)
py
Runtime Error
334
3828
331
N, M = map(int,input().split()) freq = [True]*M for i in range(M): a,b = map(int,input().split()) a-=1 b-=1 if freq[a]: freq[a] = False else: freq[a] = True if freq[b]: freq[b] = False else: freq[b] = True ans = all(freq) if ans: print('YES') else: p...
s914645075
p03724
u987164499
1581481535
Python
Python (3.4.3)
py
Runtime Error
231
28296
296
from sys import stdin n,m = map(int,stdin.readline().rstrip().split()) ab = [list(map(int,stdin.readline().rstrip().split())) for _ in range(n)] li = [0 for _ in range(n+1)] for a,b in ab: li[a] += 1 li[b] += 1 for i in li: if i%2 == 1: print("NO") exit() print("YES")
s602151747
p03724
u937642029
1580157461
Python
PyPy3 (2.4.0)
py
Runtime Error
185
39020
1327
import sys, bisect, math, itertools, string, queue, copy # import numpy as np # import scipy from collections import Counter,defaultdict,deque from itertools import permutations, combinations from heapq import heappop, heappush input = sys.stdin.readline sys.setrecursionlimit(10**8) mod = 10**9+7 def inp(): return int(...
s001252292
p03724
u905582793
1579193235
Python
Python (3.4.3)
py
Runtime Error
21
3316
181
import sys from collections import Counter n,m=map(int,input().split()) a=list(map(int,read().split())) c=Counter(a) ans="YES" for i in c.values(): if i%2: ans="NO" print(ans)
s768242287
p03724
u102960641
1577428312
Python
Python (3.4.3)
py
Runtime Error
18
3828
196
n,m = map(int, input().split()) ab = list(map(int, input().split())) s = [0] * (10 ** 5+1) for a,b in ab: s[a] += 1 s[b] += 1 if any([s % 2 for i in s]): print("NO") else: print("YES")
s288326368
p03724
u518042385
1573603553
Python
Python (3.4.3)
py
Runtime Error
330
3828
205
n,m=map(int,input().split()) l=[0]*n for i in range(m): a,b=map(int,input().split()) l[a-1]+=1 l[b-1]+=1 b=True for i in range(m): if l[i]%2!=1: b=False if b: print("YES") else: print("NO")
s861793049
p03724
u532966492
1573439799
Python
Python (3.4.3)
py
Runtime Error
401
27936
345
def main(): n, m = map(int, input().split()) ab = [sorted(list(map(int, input().split()))) for _ in [0] * n] l = [0] * (n - 1) for i in range(m): a, b = ab[i] if a != 1: l[a-2]+=1 l[b - 2] += 1 l=[i%2 for i in l] if sum(l) > 0: print("NO") else: ...
s417969473
p03724
u426108351
1568511488
Python
Python (3.4.3)
py
Runtime Error
21
3188
252
N, M = map(int, input().split()) num = [0] * (N+1) for i in range(M): a, b = map(int, input().split()) num[a] += 1 num[b] += 1 flag = 1 for i in num: if i % 2 != 0: flag = 0 if flag = 1: print("YES") else: print("NO")
s660316967
p03724
u426108351
1568511450
Python
Python (3.4.3)
py
Runtime Error
17
2940
254
N, M = map(int, input().split()) num = [0] * (N+1) for i in range(M): a, b = map(int, input().split()) num[a] += 1 num[b] += 1 flag = 1 for i in num: if num % 2 != 0: flag = 0 if flag = 1: print("YES") else: print("NO")
s968656903
p03724
u009348313
1568501402
Python
PyPy3 (2.4.0)
py
Runtime Error
773
88664
532
N,M = map(int,input().split()) AB = [list(map(int,input().split())) for _ in range(M)] E = [set() for _ in range(N)] for a,b in AB: a -= 1 b -= 1 E[a].add(b) E[b].add(a) visited = [0] * N def dfs(u,v,count): visited[u] = count count += 1 res = False for t in E[u]: if t != v: #print(t,u,visit...
s145329255
p03724
u310678820
1568344025
Python
Python (3.4.3)
py
Runtime Error
334
15992
253
from collections import Counter N, M = map(int, input().split()) c = [] for i in range(N): a, b = map(int, input().split()) c.append(a) c.append(b) c = Counter(c) if all(cnt%2==0 for cnt in c.values()): print('YES') else: print('NO')
s748085269
p03724
u623687794
1568164226
Python
Python (3.4.3)
py
Runtime Error
325
3828
221
n,m=map(int,input().split()) num=[0]*n for i in range(n): a,b=map(int,input().split()) a-=1;b-=1 num[a]+=1;num[b]+=1 flag=0 for i in num: if i%2==1: flag=1 break if bool(flag):print("NO") else:print("YES")
s724987475
p03724
u163320134
1563140049
Python
Python (3.4.3)
py
Runtime Error
17
2940
284
n,m=map(int,input().split()) g=[[]*for _ in range(n+1)] for _ in range(m): u,v=map(int,input().split()) g[u].append(v) g[v].append(u) flag=True for i in range(1,n+1): if g[i]%2==0: continue else: flag=False break if flag==True: print('YES') else: print('NO')
s983664437
p03724
u155024797
1561000610
Python
Python (3.4.3)
py
Runtime Error
306
3828
326
def main(): N, M = map(int, input().split()) cnt = [0] * N for _ in range(N): a, b = map(int, input().split()) cnt[a-1] += 1 cnt[b-1] += 1 for i in range(N): if cnt[i] % 2 == 1: print("NO") return print("YES") if __name__ == "__main__": m...
s245037959
p03724
u785578220
1553781540
Python
Python (3.4.3)
py
Runtime Error
371
16508
242
N,M=map(int,input().split()) import collections e =[] for i in range(N): ta,tb =map(int,input().split()) e.extend([ta,tb]) c = collections.Counter(e) #print(c) ans = "YES" for i in c: if c[i]%2 != 0: ans = "NO" print(ans)
s110997501
p03724
u785578220
1553781484
Python
Python (3.4.3)
py
Runtime Error
438
27140
241
N,M=map(int,input().split()) import collections e =[] for i in range(N): ta,tb =map(int,input().split()) e.extend([ta,tb]) c = collections.Counter(e) print(c) ans = "YES" for i in c: if c[i]%2 != 0: ans = "NO" print(ans)
s441797536
p03724
u375616706
1553014571
Python
Python (3.4.3)
py
Runtime Error
17
3060
315
# python template for atcoder1 import sys sys.setrecursionlimit(10**9) input = sys.stdin.readline N, M = int(input()) node = [0]*(N+1) for _ in range(M): a, b = map(lambda x: int(x)-1, input().split()) node[a] += 1 node[b] += 1 if all(x % 2 == 0 for x in node): print("YES") else: print("NO")
s264177649
p03724
u729133443
1551678313
Python
Python (3.4.3)
py
Runtime Error
90
18420
98
l=[0]*2**14 for i in open(0).read().split()[2:]:l[int(i)]+=1 print('YNEOS'[any(i%2for i in l)::2])
s043089626
p03724
u394721319
1551481466
Python
Python (3.4.3)
py
Runtime Error
340
3828
237
N,M = [int(i) for i in input().split()] q = [0] * N for _ in range(N): a,b = [int(i) for i in input().split()] q[a-1] += 1 q[b-1] += 1 for i in range(M): if q[i]%2 != 0: print('NO') exit() print('YES')
s673415900
p03724
u054106284
1549028858
Python
Python (3.4.3)
py
Runtime Error
403
3828
236
N, M = (int(i) for i in input().split()) DP = [False]*N for i in range(M): a, b = (int(k) for k in input().split()) for j in (a, b): DP[j-1] = not DP[j-1] for i in range(N): if DP[i]: print(NO) break else: print(YES)
s875873162
p03724
u054106284
1549028811
Python
Python (3.4.3)
py
Runtime Error
391
3828
236
N, M = (int(i) for i in input().split()) DP = [False]*N for i in range(M): a, b = (int(i) for i in input().split()) for j in (a, b): DP[j-1] = not DP[j-1] for i in range(N): if DP[i]: print(NO) break else: print(YES)
s947881406
p03724
u054106284
1549028772
Python
Python (3.4.3)
py
Runtime Error
19
3828
239
N, M = (int(i) for i in input().split()) DP[N] = [False]*N for i in range(M): a, b = (int(i) for i in input().split()) for j in (a, b): DP[j-1] = not DP[j-1] for i in range(N): if DP[i]: print(NO) break else: print(YES)
s457794533
p03724
u054106284
1549028692
Python
Python (3.4.3)
py
Runtime Error
19
3828
239
N, M = (int(i) for i in input().split()) DP[N] = [False]*N for i in range(M): a, b = (int(i) for i in input().split()) for i in (a, b): DP[i-1] = not DP[i-1] for i in range(N): if DP[i]: print(NO) break else: print(YES)
s692693354
p03724
u054106284
1549028647
Python
Python (3.4.3)
py
Runtime Error
18
3828
235
N, M = (int(i) for i in input().split()) DP[N] = [False]*N for i in range(M): a, b = (int(i) for i in input().split()) for i in (a, b): DP[i] = not DP[i] for i in range(N): if DP[i]: print(NO) break else: print(YES)
s497886674
p03724
u884982181
1544503737
Python
PyPy3 (2.4.0)
py
Runtime Error
176
38256
210
n,m = map(int,input().split()) ans = [0]*n for i in range(m): a,b = map(int,input().split()) a-=1,b-=1 ans[a] +=1 ans[b] +=1 for i in range(n): if ans[i]%2 ==1: print("NO") exit() print("YES")
s308075250
p03724
u562016607
1539462536
Python
Python (3.4.3)
py
Runtime Error
374
11840
317
N,M=map(int,input().split()) a=[0 for i in range(N)] b=[0 for i in range(N)] for i in range(M): a[i],b[i]=map(int,input().split()) a[i]-=1 b[i]-=1 X=[0 for i in range(N)] for i in range(M): X[a[i]]+=1 X[b[i]]+=1 for i in range(N): if X[i]%2==1: print("NO") exit() print("YES")
s131463622
p03724
u667024514
1523503954
Python
Python (3.4.3)
py
Runtime Error
2104
15596
399
from collections import Counter n,m = map(int,input().split()) lis = [] il = set() key = 0 for i in range(n): a,b = map(int,input().split()) lis.append(a) lis.append(b) il.add(a) il.add(b) for h in range(len(il)): try: if lis.count(h+1) % 2 == 1: print("NO") key =...
s284075462
p03724
u830580569
1502400081
Python
Python (2.7.6)
py
Runtime Error
286
21508
361
def unplanned_queries(): n, m = map(int, raw_input().split(" ")) a = [] for i in range(m): a.append(map(int, raw_input().split(" "))) dic = defaultdict(int) for i in range(m): dic[a[i][0]] += 1 dic[a[i][1]] += 1 for key,value in dic.iteritems(): if value%2!=0: print "NO" return print "YES" if __n...
s297273906
p03724
u761320129
1496243737
Python
Python (2.7.6)
py
Runtime Error
305
10940
300
N,M = map(int, raw_input().split()) hist = {} for i in range(N): a,b = map(int, raw_input().split()) if a in hist: hist[a] += 1 else: hist[a] = 1 if b in hist: hist[b] += 1 else: hist[b] = 1 for v in hist.values(): if v%2 == 1: print 'NO' break else : print 'YES'
s046495817
p03724
u125205981
1494126139
Python
Python (3.4.3)
py
Runtime Error
2110
17936
441
def main(): N, M = map(int, input().split()) i = 0 AB = [] while i < M: AB.append(tuple(map(int, input().split()))) i += 1 edge = [0 for i in range(M)] for i in AB: j = i[0] - 1 end = i[1] - 1 while j < end: edge[j] += 1 j += 1 ...
s103845072
p03724
u854685751
1494125253
Python
Python (3.4.3)
py
Runtime Error
18
3064
368
N = int(input()) l = [0 for i in range(N)] ad = [[] for i in range(N)] de1 = [0 for i in range(N)] for i in range(N-1): a,b = map(int,input().split()) l[a-1] += 1 l[b-1] += 1 ad[a-1].append(b-1) ad[b-1].append(a-1) for i in range(N): if l[i] == 1: de1[ad[i][0]] += 1 for i in range(N): if de1[i] >= 2: pri...
s596479555
p03724
u785975381
1494124816
Python
Python (3.4.3)
py
Runtime Error
2104
3888
362
if __name__ == '__main__': N, M=map(int, input().split()) a=[] b=[] for i in range(M): x,y=[int(i) for i in input().split()] a.append(x) b.append(y) n=[] for j in range(N): n.append(0) for i in range(N): n[a[i]-1]+=1 n[b[i]-1]+=1 flag = 0 for i in range(N): if(n[i]%2==1): flag +=1 if(fl...
s236626116
p03724
u667084803
1494124569
Python
Python (3.4.3)
py
Runtime Error
17
3064
580
import sys # 整数の入力 N,M=list(map(int, input().split())) p=[] q=0 count=0 for i in range(0,M): p.append(list(map(int, input().split()))) for i in range(0,M): q+=p[i][0]-p[i][1] if q%2==1: print("NO") else: for j in range(1,min(10,M)): for i in range(0,M): if p[i][0]==j or p[i][1]==j: count+=1 ...
s729042010
p03724
u667084803
1494124501
Python
Python (3.4.3)
py
Runtime Error
17
3064
592
import sys # 整数の入力 N,M=list(map(int, input().split())) p=[] q=0 count=0 for i in range(0,M): p.append(list(map(int, input().split()))) for i in range(0,M): q+=p[i][0]-p[i][1] if q%2==1: print("NO") else: for j in range(1,min(10,M)): for i in range(0,M): if p[i][0]==j or p[i][1]==j: count+=1 ...
s700103072
p03724
u667084803
1494124195
Python
Python (3.4.3)
py
Runtime Error
604
27368
409
import sys # 整数の入力 N,M=list(map(int, input().split())) p=[] q=0 count=0 for i in range(0,M): p.append(list(map(int, input().split()))) for i in range(0,M): q+=p[i][0]-p[i][1] if q%2==1: print("NO") else: for j in range(1,M,int(M/10)): for i in range(0,M): if p[i][0]==j or p[i][1]==j: count+=1 ...
s120420140
p03724
u667084803
1494124155
Python
Python (3.4.3)
py
Runtime Error
2105
29396
410
import sys # 整数の入力 N,M=list(map(int, input().split())) p=[] q=0 count=0 for i in range(0,M): p.append(list(map(int, input().split()))) for i in range(0,M): q+=p[i][0]-p[i][1] if q%2==1: print("NO") else: for j in range(1,M,int(M/100)): for i in range(0,M): if p[i][0]==j or p[i][1]==j: count+=1...
s028793608
p03724
u667084803
1494123943
Python
Python (3.4.3)
py
Runtime Error
378
27368
405
import sys # 整数の入力 N,M=list(map(int, input().split())) p=[] q=0 count=0 for i in range(0,M): p.append(list(map(int, input().split()))) for i in range(0,M): q+=p[i][0]-p[i][1] if q%2==1: print("NO") else: for j in range(0,M,M/100): for i in range(0,M): if p[i][0]==j or p[i][1]==j: count+=1 ...
s939461306
p03724
u667084803
1494122318
Python
Python (3.4.3)
py
Runtime Error
382
27364
229
import sys # 整数の入力 N,M=list(map(int, input().split())) p=[] q=0 for i in range(0,M): p.append(list(map(int, input().split()))) for i in range(0,M): q+=p[i][0]-p[i][1] if q[i]%2==1: print("NO") else: print("YES")
s989831446
p03724
u667084803
1494122183
Python
Python (3.4.3)
py
Runtime Error
2105
30148
302
import sys # 整数の入力 N,M=list(map(int, input().split())) p=[] q=[] for i in range(0,M): p.append(list(map(int, input().split()))) q.append(0) for i in range(0,M): for j in range(p[i][0],p[i][1]): q[j]+=1 for i in range(0,M): if q[i]%2==1: print("NO") sys.exit() print("YES")
s159274754
p03724
u945080461
1494120486
Python
Python (2.7.6)
py
Runtime Error
10
2692
344
from sys import stdin from itertools import repeat def main(): n, m = map(int, stdin().readline().split()) dat = map(int, stdin.read().split(), repeat(10, 2 * m)) c = [0] * (n + 1) for x in dat: c[x] += 1 for i in xrange(n + 1): if c[i] == 1: print "NO" return...
s386340032
p03724
u945080461
1494120394
Python
Python (2.7.6)
py
Runtime Error
10
2692
344
from sys import stdin from itertools import repeat def main(): n, m = map(int, stdin().readline().split()) dat = map(int, stdin.read().split(), repeat(10, 2 * m)) c = [0] * (n + 1) for x in dat: c[x] += 1 for i in xrange(n + 1): if c[i] == 1: print "NO" return...
s172712285
p03724
u945080461
1494120318
Python
Python (2.7.6)
py
Runtime Error
10
2692
688
from sys import stdin from itertools import repeat def main(): n, m = map(int, stdin().readline().split()) dat = map(int, stdin.read().split(), repeat(10, 2 * m)) c = [0] * (n + 1) for x in dat: c[x] += 1 for i in xrange(n + 1): if c[i] == 1: print "NO" return...
s022026035
p03725
u102445737
1596598078
Python
PyPy3 (7.3.0)
py
Runtime Error
235
87052
944
from collections import deque printn = lambda x: print(x,end='') inn = lambda : int(input()) inl = lambda: list(map(int, input().split())) inm = lambda: map(int, input().split()) ins = lambda : input().strip() DBG = True # and False BIG = 10**18 R = 10**9 + 7 #R = 998244353 def ddprint(x): if DBG: print...
s326456497
p03725
u102445737
1596597616
Python
PyPy3 (7.3.0)
py
Runtime Error
213
86684
1007
from collections import deque printn = lambda x: print(x,end='') inn = lambda : int(input()) inl = lambda: list(map(int, input().split())) inm = lambda: map(int, input().split()) ins = lambda : input().strip() DBG = True # and False BIG = 10**18 R = 10**9 + 7 #R = 998244353 def ddprint(x): if DBG: print...
s693999008
p03725
u197457087
1593744237
Python
PyPy3 (7.3.0)
py
Runtime Error
2209
105656
697
H,W,K = map(int,input().split()) Room = [] for i in range(H): temp = str(input()) temp = list(temp) for j in range(W): if temp[j] == "S": sx = i;sy =j Room.append(temp) #print(sx,sy) L = set([]) def dfs(x,y,stp): if x<0 or x>= H or y<0 or y>= W: print(1) exit() if Room[x][y] == "#": re...
s568912599
p03725
u896741788
1589943532
Python
Python (3.4.3)
py
Runtime Error
123
8820
823
import sys input=sys.stdin.buffer.readline sys.setrecursionlimit(10**9) h,w,k=map(int,input().split()) maze=[input()for i in range(h)] for i in range(h): for j in range(w): if maze[i][j]=="S":x,y=i,j;break else: continue break ans=float("INF") l=[[0]*w for i in range(h)] p={(x,y)} def dfs(wx...
s860728711
p03725
u896741788
1589943507
Python
PyPy3 (2.4.0)
py
Runtime Error
179
44656
823
import sys input=sys.stdin.buffer.readline sys.setrecursionlimit(10**9) h,w,k=map(int,input().split()) maze=[input()for i in range(h)] for i in range(h): for j in range(w): if maze[i][j]=="S":x,y=i,j;break else: continue break ans=float("INF") l=[[0]*w for i in range(h)] p={(x,y)} def dfs(wx...
s295042386
p03725
u896741788
1589943427
Python
PyPy3 (2.4.0)
py
Runtime Error
600
105436
751
h,w,k=map(int,input().split()) maze=[input()for i in range(h)] for i in range(h): for j in range(w): if maze[i][j]=="S":x,y=i,j;break else: continue break ans=float("INF") l=[[0]*w for i in range(h)] p={(x,y)} def dfs(wx,wy,cnt): if cnt>k:return 1 if l[wx][wy]:return 1 l[wx][wy]=...
s103048321
p03725
u499381410
1587330206
Python
PyPy3 (2.4.0)
py
Runtime Error
313
72688
1780
from collections import defaultdict, deque, Counter from heapq import heappush, heappop, heapify import math import bisect import random from itertools import permutations, accumulate, combinations, product import sys from pprint import pprint from copy import deepcopy import string from bisect import bisect_left, bise...
s335247978
p03725
u648212584
1581634615
Python
Python (3.4.3)
py
Runtime Error
112
14188
1252
import sys #input = sys.stdin.buffer.readline from collections import deque def main(): H,W,K = map(int,input().split()) room = [list(map(str,input())) for _ in range(H)] dist = [[-1 for _ in range(W)] for _ in range(H)] for i in range(H): for j in range(W): if room[i][j] == "S...
s207910094
p03725
u947883560
1579398884
Python
PyPy3 (2.4.0)
py
Runtime Error
559
86492
1692
#!/usr/bin/env python3 import sys sys.setrecursionlimit(10**8) from collections import deque INF = float("inf") DX = [1, -1, 0, 0] DY = [0, 0, 1, -1] def solve(H: int, W: int, K: int, A: "List[str]"): y, x = -1, -1 for i in range(1, H-1): for j in range(1, W-1): if A[i][j] == "S": ...
s743048956
p03725
u947883560
1579398702
Python
Python (3.4.3)
py
Runtime Error
2105
24524
1712
#!/usr/bin/env python3 import sys from collections import deque INF = float("inf") DX = [1, -1, 0, 0] DY = [0, 0, 1, -1] def solve(H: int, W: int, K: int, A: "List[str]"): y, x = -1, -1 for i in range(1, H-1): for j in range(1, W-1): if A[i][j] == "S": y, x = i, j ...
s913379912
p03725
u947883560
1579398575
Python
Python (3.4.3)
py
Runtime Error
2105
24768
1663
#!/usr/bin/env python3 import sys from collections import deque INF = float("inf") DX = [1, -1, 0, 0] DY = [0, 0, 1, -1] def solve(H: int, W: int, K: int, A: "List[str]"): y, x = -1, -1 for i in range(1, H-1): for j in range(1, W-1): if A[i][j] == "S": y, x = i, j ...
s803953298
p03725
u947883560
1579398454
Python
PyPy3 (2.4.0)
py
Runtime Error
613
86492
1663
#!/usr/bin/env python3 import sys from collections import deque INF = float("inf") DX = [1, -1, 0, 0] DY = [0, 0, 1, -1] def solve(H: int, W: int, K: int, A: "List[str]"): y, x = -1, -1 for i in range(1, H-1): for j in range(1, W-1): if A[i][j] == "S": y, x = i, j ...
s136463296
p03725
u638795007
1577827040
Python
PyPy3 (2.4.0)
py
Runtime Error
185
41456
2248
def examA(): A, B, C = LI() S = A+B+C cur = 0 for i in range(32): if A%2==1 or B%2==1 or C%2==1: break A = (S-A)//2 B = (S-B)//2 C = (S-C)//2 cur +=1 if cur==32: ans = -1 else: ans = cur print(ans) return def examB(): ...
s972135808
p03725
u440566786
1576218224
Python
PyPy3 (2.4.0)
py
Runtime Error
168
38508
1137
import sys sys.setrecursionlimit(2147483647) INF=float("inf") MOD=10**9+7 input=lambda:sys.stdin.readline().rstrip() from itertools import product from collections import deque def resolve(): h,w,k=map(int,input().split()) G=[list(input()) for _ in range(h)] D=[(1,0),(-1,0),(0,1),(0,-1)] for i,j in prod...
s915405547
p03725
u729133443
1570304367
Python
PyPy3 (2.4.0)
py
Runtime Error
334
90972
333
from collections import* H,*A=open(0) H,W,K=map(int,H.split()) *A,=map(list,A) for i,a in enumerate(A): if'S'in a:j=a.index('S');Q=deque([(0,i,j)]) d=1e9 while Q: c,i,j=Q.popleft();d=min(d,i,j,H-i-1,W-j-1) if c<K: for h,w in((i+1,j),(i,j+1),(i-1,j),(i,j-1)): if(H>h>-1<w<W)*'.'==A[h][w]:A[h][w]=0;Q+=(c+1,h,w), p...
s112017271
p03725
u606045429
1570301213
Python
PyPy3 (2.4.0)
py
Runtime Error
501
75356
384
from collections import deque H,W,K=map(int,input().split()) A=[list(input())for _ in range(H)] for i in range(W): if"S"in A[i]:y,x=(i,A[i].index("S")) d=1e9 Q=deque([(1,y,x)]) while Q: c,i,j=Q.popleft() d=min(d,i,j,H-i-1,W-j-1) if c>K:continue for h,w in((i+1,j),(i,j+1),(i-1,j),(i,j-1)): if 0<=h<H and 0<=w<W an...
s454926951
p03725
u606045429
1570290543
Python
Python (3.4.3)
py
Runtime Error
2105
29112
890
from collections import deque INF = float("inf") H, W, K = map(int, input().split()) A = [list(input()) for _ in range(H)] Si, Sj = (0, 0) for i, a in enumerate(A): if "S" in a: Si, Sj = (i, a.index("S")) break dist = [[INF] * W for _ in range(H)] dist[Si][Sj] = 0 ans = INF Q = deque([(Si, Sj...
s350947711
p03725
u606045429
1570290404
Python
Python (3.4.3)
py
Runtime Error
2105
29744
876
from collections import deque INF = float("inf") H, W, K = map(int, input().split()) A = [list(input()) for _ in range(H)] Si, Sj = (0, 0) for i, a in enumerate(A): if "S" in a: Si, Sj = (i, a.index("S")) break dist = [[INF] * W for _ in range(H)] dist[Si][Sj] = 0 ans = INF Q = deque([(Si, Sj)...
s599708295
p03725
u606045429
1570290312
Python
Python (3.4.3)
py
Runtime Error
2105
28992
877
from collections import deque INF = float("inf") H, W, K = map(int, input().split()) A = [list(input()) for _ in range(H)] Si, Sj = (0, 0) for i, a in enumerate(A): if "S" in a: Si, Sj = (i, a.index("S")) break dist = [[INF] * W for _ in range(W)] dist[Si][Sj] = 0 ans = INF Q = deque([(Si, Sj...
s934376850
p03725
u606045429
1570290279
Python
Python (3.4.3)
py
Runtime Error
324
14672
876
from collections import deque INF = float("inf") H, W, K = map(int, input().split()) A = [list(input()) for _ in range(H)] Si, Sj = (0, 0) for i, a in enumerate(A): if "S" in a: Si, Sj = (i, a.index("S")) break dist = [[INF] * W for _ in range(W)] dist[Si][Sj] = 0 ans = INF Q = deque([(Si, Sj...
s860272801
p03725
u606045429
1570290182
Python
Python (3.4.3)
py
Runtime Error
2105
27156
877
from collections import deque INF = float("inf") H, W, K = map(int, input().split()) A = [list(input()) for _ in range(H)] Si, Sj = (0, 0) for i, a in enumerate(A): if "S" in a: Si, Sj = (i, a.index("S")) break dist = [[INF] * W for _ in range(W)] dist[Si][Sj] = 0 ans = INF Q = deque([(Si, Sj...
s688745225
p03725
u906428167
1568947877
Python
PyPy3 (2.4.0)
py
Runtime Error
2128
382216
1393
from collections import deque h,w,K = map(int,input().split()) maze = [[x for x in input()] for _ in range(h)] sx = 0 sy = 0 for i in range(h): for j in range(w): if maze[i][j] == 'S': sx = j sy = i d = [[float('inf')]*w for _ in range(h)] d[sy][sx] = 0 q = deque([[sy,sx]]) c =...
s336813618
p03725
u942033906
1562198465
Python
Python (3.4.3)
py
Runtime Error
211
14836
966
# coding: utf-8 # Your code here! import heapq as hq H,W,K = map(int,input().split()) A = [] X,Y=0,1 start = None for h in range(H): tmp = list(input()) A.append(tmp) if "S" in tmp: start = (tmp.index("S"), h) def minCost(x,y): return min(start[X], W-1-start[X], start[Y], H-1-start[Y]) // K sea...
s787654248
p03725
u623819879
1561432245
Python
PyPy3 (2.4.0)
py
Runtime Error
298
72940
704
h,w,k=map(int,input().split()) b=[] v=[[0]*w for _ in range(h)] sh=0 sw=0 for i in range(h): s=list(input()) b.append(s) if 'S' in s: sh=i sw=s.index('S') #ans=10**18 d=[[0,1],[1,0],[-1,0],[0,-1]] def bfs(y,x): ans=10**18 c=0 q=[(y,x)] v[y][x]=1 while c<k: p...
s734992529
p03725
u623819879
1561432188
Python
PyPy3 (2.4.0)
py
Runtime Error
306
74860
676
h,w,k=map(int,input().split()) b=[] v=[[0]*w for _ in range(h)] sh=0 sw=0 for i in range(h): s=list(input()) b.append(s) if 'S' in s: sh=i sw=s.index('S') #ans=10**18 d=[[0,1],[1,0],[-1,0],[0,-1]] def bfs(y,x): ans=10**18 c=0 q=[(y,x)] v[y][x]=1 while c<k: p...