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
s012339763
p03644
u576434377
1544060128
Python
Python (3.4.3)
py
Runtime Error
18
2940
61
N = int(intpu()) n = 1 while n < N: n *= 2 print(n // 2)
s753052296
p03644
u853900545
1539661058
Python
Python (3.4.3)
py
Runtime Error
17
2940
63
n=int(input()) i=1 while 2**i<=n: s=2**i i+=1 print(s)
s942401132
p03644
u853900545
1539660972
Python
Python (3.4.3)
py
Runtime Error
17
2940
60
n=int(input()) i=1 while 2**i<=n: s=i i+=1 print(s)
s192718323
p03644
u717001163
1532437893
Python
Python (3.4.3)
py
Runtime Error
17
2940
53
N = input() t = 1; while(t <= N): t *= 2 print(t)
s711449655
p03644
u846150137
1526905717
Python
Python (3.4.3)
py
Runtime Error
17
2940
54
a=int(input()) k=0 while x<a: x=2**k k+=1 print(x)
s273642115
p03644
u807772568
1526339646
Python
Python (3.4.3)
py
Runtime Error
17
2940
150
i = {1,2,4,8,16,32,64,128} k = int(input()) for p in range(len(i)): if k == 1: print(1) break elif k < i[p]: print(i[p-1]) break
s013464825
p03644
u807772568
1526339533
Python
Python (3.4.3)
py
Runtime Error
17
2940
140
i = {1,2,4,8,16,32,64,128} k = int(input()) for p in range(len(i)): if k == 1: print(1) elif k < i[p]: print(i[p-1]) break
s653223411
p03644
u807772568
1526339434
Python
Python (3.4.3)
py
Runtime Error
17
2940
110
i = {1,2,4,8,16,32,64,128} k = int(input()) for p in range(len(i)): if k <= i[p]: print(i[p]) break
s946044217
p03644
u306142032
1526091013
Python
Python (3.4.3)
py
Runtime Error
17
2940
123
n = int(input()) list = {1,2,4,8,16,32,64} for i in range(7): if n <= list[i]: print(list[i-1]) break
s429570308
p03644
u941884460
1520869458
Python
Python (3.4.3)
py
Runtime Error
17
2940
102
N = int(input()) N2 = [64,32,16,8,4,2] for i in range(len(N)): if N2[i] <=N: print(N2[i]) break
s961627611
p03644
u667949809
1520316547
Python
Python (3.4.3)
py
Runtime Error
17
2940
76
n = int(input()) k = 0 while 2**k <= n: k += 1: print(2**(k-1))
s641797327
p03644
u730606460
1516923491
Python
Python (2.7.6)
py
Runtime Error
10
2568
68
n = int(input()) ans = 0 while 2**n > n n-=1 ans = 2**n print(ans)
s700639070
p03644
u778700306
1515373648
Python
Python (3.4.3)
py
Runtime Error
18
2940
158
n = int(input()) def cnt(a): if a == 1: return 0: return cnt(a//2) res = 0 for a in range(1, n + 1): res = max(res, cnt(a)) print(res)
s983079406
p03644
u098968285
1513034238
Python
Python (3.4.3)
py
Runtime Error
17
2940
112
N = int(input()) if N == 1: print(0) else: ans = 2 while ans * 2 <= N: ans *= 2 print(ans)
s249902600
p03644
u353919145
1505838891
Python
Python (3.4.3)
py
Runtime Error
17
2940
61
n = int(input()) x = 1 while(x*2 <= n): x *= 2 print(a)
s843361247
p03644
u665415433
1504841287
Python
Python (3.4.3)
py
Runtime Error
17
2940
82
N = int(input()) for i in range(7): if 2**i < N: ans = 2**i print(ans)
s372682526
p03644
u089230684
1503279126
Python
Python (3.4.3)
py
Runtime Error
18
3064
56
a = int(input()) i = 1 while(i<=a) i *= 2 print(i/2)
s018050480
p03644
u816631826
1503278628
Python
Python (3.4.3)
py
Runtime Error
17
2940
55
a = input() i = 1 while (i<=a): i =i * 2 print(i/2)
s687619420
p03644
u816631826
1503278038
Python
Python (3.4.3)
py
Runtime Error
17
2940
56
a = input() i = 1 while i <= a : i *= 2 print(i/2)
s072358296
p03644
u271063202
1502582464
Python
Python (3.4.3)
py
Runtime Error
17
2940
42
n=input() a=1 while a*2<=n: a*=2 print(a)
s608646883
p03644
u343437894
1502465623
Python
Python (3.4.3)
py
Runtime Error
17
2940
134
N = int(input()) num=2 for i in range(1, N+1): if num*2 > N: print(num): break else: num = num*2
s452359743
p03644
u343437894
1502465115
Python
Python (3.4.3)
py
Runtime Error
18
2940
130
N = int(input()) num=1 for i in range(1, N): if num*2 > N: print(num): break else: num = num*2
s378338770
p03644
u952708174
1501975119
Python
PyPy3 (2.4.0)
py
Runtime Error
164
38640
51
x=input("") k=0 while(pow(2,k)<=x): k+=1 print(k)
s549408257
p03644
u845674689
1501624028
Python
Python (3.4.3)
py
Runtime Error
17
3064
346
N = int(input()) arr = [i for i in range(1, N + 1)] # N == len(arr) nums = N*[0] for j in range(N): target = arr[j] num = 0 while target % 2 == 0: num += 1 target /= 2 nums[j] = num # print(nums) max = 0 for k in range(N): if nums[k] > max: max_index = k max = nums[...
s647240940
p03644
u845674689
1501623994
Python
Python (3.4.3)
py
Runtime Error
17
3064
344
N = int(input()) arr = [i for i in range(1, N + 1)] # N == len(arr) nums = N*[0] for j in range(N): target = arr[j] num = 0 while target % 2 == 0: num += 1 target /= 2 nums[j] = num print(nums) max = 0 for k in range(N): if nums[k] > max: max_index = k max = nums[k]...
s244793983
p03644
u845674689
1501623728
Python
Python (3.4.3)
py
Runtime Error
17
3064
310
N = int(input()) arr = [i for i in range(1, N + 1)] # N == len(arr) nums = N*[0] for j in range(N): target = arr[j] num = 0 while target % 2 == 0: num += 1 target /= 2 nums[j] = num max = 0 for k in range(N): if nums[k] > max: max_index = k print(arr[max_index])
s211125313
p03644
u845674689
1501623625
Python
Python (3.4.3)
py
Runtime Error
18
3064
316
N = int(input()) arr = [i for i in range(1, N + 1)] # N == len(arr) nums = N*[0] for j in range(N): target = arr[j] num = 0 while target % 2 == 0: num += 1 target /= 2 nums[j] = num max_index = 0 for k in range(N): if nums[k] > max: max_index = k print(arr[max_index])
s109908641
p03644
u650245944
1501538902
Python
Python (3.4.3)
py
Runtime Error
17
2940
205
#!/usr/bin # -*- coding="utf-8" -*- n = raw_input() if n >= 64: a = 64 elif n >= 32: a = 32 elif n >= 16: a = 16 elif n >= 8: a= 8 elif n >= 4: a = 4 elif n >= 2: a = 2 else: a = 1 print(a)
s530737423
p03644
u564412408
1501422340
Python
Python (3.4.3)
py
Runtime Error
17
2940
270
N = int(input()) score = 0 for i in range(N,0,-1): s = i c=0 while (i % 2 == 0) : i /= 2 c += 1 if score < c: score = c ans = s #カウントが更新されたらスコア配列に格納 print(ans)
s328153369
p03644
u370331385
1501382398
Python
Python (3.4.3)
py
Runtime Error
17
2940
234
N=int(input()) count=0 C=[] for i in range(N): if(i!=0): a=int(i/2) if(i%2==0): count +=1 while(a%2!=1): count +=1 a=int(a/2) else: count =0 C.append(count) b=max(C) for i inrange(N): C[i]==b print(i)
s319202072
p03644
u255555420
1501382275
Python
Python (3.4.3)
py
Runtime Error
17
2940
209
N=int(input()) if N=1: print(1) elif 2<=N<=3: print(2) elif 4<=N<=7: print(4) elif 8<=N<=15: print(8) elif 16<=N<=31: print(16) elif 32<=N<=63: print(32) elif 64<=N<=100: print(64)
s157118184
p03644
u255555420
1501382235
Python
Python (3.4.3)
py
Runtime Error
16
2940
209
N=int(input()) if N=1: print(1) elif 2<=N<=3: print(2) elif 4<=N<=7: print(4) elif 8<=N<=15: print(8) elif 16<=N<=31: print(16) elif 32<=N<=64: print(32) elif 64<=N<=100: print(64)
s697553108
p03644
u255555420
1501382167
Python
Python (3.4.3)
py
Runtime Error
18
2940
209
N=int(input()) if N=1: print(1) elif 2<=N<=3: print(2) elif 4<=N<=7: print(4) elif 8<=N<=15: print(8) elif 16<=N<=31: print(16) elif 32<=N<=64: print(32) else 64<=N<=100: print(64)
s645434386
p03644
u174028570
1501382011
Python
Python (3.4.3)
py
Runtime Error
17
2940
500
import logging logging.basicConfig(level=logging.CRITICAL,format=' %(asctime)s - %(levelname)s - %(message)s')   def power(n): i = 1 logging.info('func start') while n > 0: i *= 2 n -= 1 logging.debug('i = {}, n = {}'.format(i,n)) logging.info('func end') return i   i = 0 n =...
s581868798
p03644
u174028570
1501380273
Python
Python (3.4.3)
py
Runtime Error
17
3060
147
def power2(n): i=1 while n>0: i*=2 n-=1 return i i=0 n=input() while power2(i)<=n: i=i+1 print(power2(i-1))
s879705226
p03644
u502314533
1501380070
Python
Python (3.4.3)
py
Runtime Error
17
3064
344
use = int(input()) if n != 1: best_number = 0 maximum = 0 t = 0 for i in range(2,use+1,2): n = i while n % 2 == 0: n /= 2 t += 1 if t > maximum: maximum = t best_number = i t = 0 print(best_number) else: prin...
s365125888
p03644
u371037736
1501378557
Python
Python (3.4.3)
py
Runtime Error
18
3060
265
div = int(input()) max_div = [0,0] for i in range(div): count = 0 out = True while(out): if i %2 == 0: i = i/2 count += 1 else: out == False max_div = [i ,max(max_div, count)] print(max_div[0])
s582955734
p03644
u340643636
1501378556
Python
Python (3.4.3)
py
Runtime Error
17
3064
314
a=[1,2,2,4,4,4,4,8,8,8,8,8,8,8,8,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64] print(a[(int(input()))])
s701814250
p03644
u371037736
1501378496
Python
Python (3.4.3)
py
Runtime Error
17
3060
265
div = int(input()) max_div = [0,0] for i in range(div): count = 0 out = FALSE while(out): if i %2 == 0: i = i/2 count += 1 else: out == TRUE max_div = [i ,max(max_div, count)] print(max_div[0])
s916617480
p03644
u371037736
1501378351
Python
Python (3.4.3)
py
Runtime Error
18
2940
271
div = int(input()) max_div = [0,0] for i in range(div): count = 0 out = FALSE while(out): if i %2 == 0: i = i/2 count++ max_div = [i ,max(max_div, count)] else out == TRUE: pass print(max_div[0])
s183079358
p03644
u371037736
1501377830
Python
Python (3.4.3)
py
Runtime Error
17
2940
251
div = int(input()) max_div = [0,0] for i in range(div): count = 0 out = FALSE while(out): if i %2 == 0: i = i/2 count ++ else out == TRUE: max_div = [i ,max(max_div, count)] print(max_div[0])
s002158400
p03644
u166636976
1501377341
Python
Python (3.4.3)
py
Runtime Error
17
2940
112
n = int(input()) for i in range(1,8): if 2 ** i >= n: pass else: s = 2 ** i print(s)
s639698024
p03644
u166636976
1501377202
Python
Python (3.4.3)
py
Runtime Error
18
2940
113
n = int(input()) for i in range(1,8): if 2 ** i >= n: break else: s = 2 ** i print(s)
s824627841
p03644
u166636976
1501377121
Python
Python (3.4.3)
py
Runtime Error
17
2940
111
n = int(input()) for i in range(1,8): if 2 ** i >= N: break else: s = 2 ** i print(s)
s869297282
p03645
u620846115
1600267768
Python
Python (3.8.2)
py
Runtime Error
21
9044
333
a_list = [] b_list = [] for i in range(m): if X[i][0] == 1: a_list.append(X[i][1]) elif X[i][1] == 1: a_list.append(X[i][0]) elif X[i][0] == n: b_list.append(X[i][1]) elif X[i][1] == n: b_list.append(X[i][0]) c_set = set(a_list) & set(b_list) if len(c_set) ==0: print("IMPOSSIBLE") else: prin...
s111237165
p03645
u620846115
1600267544
Python
Python (3.8.2)
py
Runtime Error
24
9016
395
n,m=map(int,input().split()) X = [list(map(int,input().split())) for i in range(m)] a_list = [] b_list = [] for i in range(m): if X[i][0] == 1: a_list.append(X[i][1]) elif X[i][1] == 1: a_list.append(X[i][0]) elif X[i][0] == n: b_list.append(X[i][1]) elif X[i][1] == n: b_list.append(X[i][0]) c_s...
s024335801
p03645
u620846115
1600267336
Python
Python (3.8.2)
py
Runtime Error
460
45428
409
n,m=map(int,input().split()) X = [list(map(int,input().split())) for i in range(m)] a_list = [] b_list = [] for i in range(m): if X[i][0] == 1: a_list.append(X[i][1]) elif X[i][1] == 1: a_list.append(X[i][0]) elif X[i][0] == n: b_list.append(X[i][1]) elif X[i][1] == n: b_list.append(X[i][0]) c_d...
s805262805
p03645
u620846115
1600267289
Python
Python (3.8.2)
py
Runtime Error
24
8832
405
n,m=map(int,input().split()) X = [list(map(int,input().split())) for i in range(m)] a_list = [] b_list = [] for i in range(m): if X[i][0] = 1: a_list.append(X[i][1]) elif X[i][1] = 1: a_list.append(X[i][0]) elif X[i][0] = n: b_list.append(X[i][1]) elif X[i][1] = n: b_list.append(X[i][0]) c_dic =...
s870627957
p03645
u074220993
1599943057
Python
Python (3.8.2)
py
Runtime Error
1506
160644
1511
import typing from typing import Deque, Set, Dict class Island: def __init__(self, id: int) -> None: self.id: int = id self.connection: List['Island'] = [] self.rank: int = 0 def addConnection(self, other: 'Island') -> None: self.connection.append(other) other.conne...
s083363076
p03645
u648315264
1599593944
Python
PyPy3 (7.3.0)
py
Runtime Error
2335
3513400
1020
import math from math import gcd,pi,sqrt INF = float("inf") import sys sys.setrecursionlimit(10**6) import itertools from collections import Counter,deque def i_input(): return int(input()) def i_map(): return map(int, input().split()) def i_list(): return list(i_map()) def i_row(N): return [i_input() for _ in range(N...
s225809123
p03645
u806976856
1599521617
Python
PyPy3 (7.3.0)
py
Runtime Error
90
74724
450
import sys input=sys.stdin.readline() from _collections import deque n,m=map(int,input().split()) edg=[[] for i in range(n+1)] for i in range(m): a,b=map(int,input().split()) edg[a].append(b) edg[b].append(a) dep=[-1]*(n+1) dep[1]=0 data=deque([1]) while len(data)>0: p=data.popleft() for i in edg[p]...
s871501592
p03645
u806976856
1599520005
Python
PyPy3 (7.3.0)
py
Runtime Error
2354
3509600
270
n,m=map(int,input().split()) edg=[[0]*(n+1) for i in range(n+1)] for i in range(m): a,b=map(int,input().split()) edg[a][b]=1 edg[b][a]=1 f=1 for i in range(2,n+1): if edg[i][1]==1 and edg[i][n]==1: f=0 print("POSSIBLE" if f==0 else "IMPOSSIBLE")
s911084950
p03645
u411923565
1599356761
Python
PyPy3 (7.3.0)
py
Runtime Error
99
74604
798
#55 C - Cat Snuke and a Voyage import collections from deque N,M = map(int,input().split()) G = [[] for _ in range(N)] for _ in range(M): a, b = map(int, input().split()) a -= 1; b -= 1 G[a].append(b) G[b].append(a) # BFS のためのデータ構造 dist = [-1]*N que = deque([]) # 初期条件 (島 1 を初期ノードとする) dist[0] = 0 que.a...
s660033907
p03645
u411923565
1599356695
Python
PyPy3 (7.3.0)
py
Runtime Error
472
112424
768
#55 C - Cat Snuke and a Voyage N,M = map(int,input().split()) G = [[] for _ in range(N)] for _ in range(M): a, b = map(int, input().split()) a -= 1; b -= 1 G[a].append(b) G[b].append(a) # BFS のためのデータ構造 dist = [-1]*N que = deque([]) # 初期条件 (島 1 を初期ノードとする) dist[0] = 0 que.append(0) while (len(que) != 0...
s825718824
p03645
u411923565
1599356676
Python
PyPy3 (7.3.0)
py
Runtime Error
577
146152
777
#55 C - Cat Snuke and a Voyage N,M = map(int,input().split()) G = [[] for _ in range(N)] for _ in range(M): a, b = map(int, input().split()) a -= 1; b -= 1 G[a].append(b) G[b].append(a) print(G) # BFS のためのデータ構造 dist = [-1]*N que = deque([]) # 初期条件 (島 1 を初期ノードとする) dist[0] = 0 que.append(0) while (len(...
s156222336
p03645
u310245677
1598923927
Python
Python (3.8.2)
py
Runtime Error
2207
45372
282
n,m = map(int,input().split()) ab = [list(map(int,input().split(" "))) for i in range(m)] for i in range(m): if (ab[i][0] == 1): c = ab[i][1] for i in range(m): if (ab[i][0] == c and ab[i][1] == n): ans = 'POSSIBLE' else: ans = 'IMPOSSIBLE' print(ans)
s705732189
p03645
u760771686
1598557181
Python
Python (3.8.2)
py
Runtime Error
347
17440
273
def main(): N, M = map(int,input().split()) fromOne = set() toM = set() for i in range(N): a, b = map(int,input().split()) if a == 1: fromOne.add(b) elif b == M: toM.add(a) return 'POSSIBLE' if fromOne & toM else 'IMPOSSIBLE' print(main())
s444861825
p03645
u844646164
1597801853
Python
PyPy3 (7.3.0)
py
Runtime Error
621
112852
402
N, M = map(int, input().split()) graph = [[] for _ in range(N)] for _ in range(M): a, b = map(lambda x:int(x)-1, input().split()) graph[a] += [b] graph[b] += [a] dist = [float('inf')]*N def dfs(u, pre, cnt): dist[u] = cnt for v in graph[u]: if v != pre and cnt+1 < dist[v]: dfs(v, u, cnt+1) df...
s111094377
p03645
u023229441
1597259252
Python
Python (3.8.2)
py
Runtime Error
440
38684
224
n,m=map(int,input().split()) M=[] for i in range(m): a,b=map(int,input().split()) a-=1;b-=1 M.append([a,b]) yes="POSSIBLE";no="IMPOSSIBLE" for i in M[0]: if n-1 in M[i]: print(yes);exit() print(no)
s945381508
p03645
u433380437
1597208820
Python
PyPy3 (7.3.0)
py
Runtime Error
342
104660
334
n,m=map(int,input().split()) ab=[] for i in range(m): a,b=input().split() ab.append([int(a),int(b)]) c = [] ab=list(set(ab)) for j in range(len(ab)): if ab[j][0]==1: c.append(ab[j][1]) for p in range(len(ab)): if ab[p][1] == n and ab[p][0] in c: print('POSSIBLE') exit() print...
s089373917
p03645
u536034761
1596059131
Python
Python (3.8.2)
py
Runtime Error
25
9072
222
N, M = map(int, input()) From = set() To = set() for _ in range(M): a, b = map(int, input()) if a == 1: From.add(b) if b == N: To.add(a) if From.isdisjoint(To): print("INPOSSIBLE") else: print("POOSIBLE")
s740635254
p03645
u317779196
1595561150
Python
Python (3.8.2)
py
Runtime Error
111
27152
239
import numpy as np n,m = map(int,input().split()) A = np.zeros((n,n),dtype=np.bool) for i in range(m): a,b = map(int,input().split()) A[a-1,b-1] = 1 if 1 in A[A[0] == 1,n-1]: print('POSSIBLE') else: print('IMPOSSIBLE')
s791295297
p03645
u317779196
1595561090
Python
Python (3.8.2)
py
Runtime Error
112
27124
239
import numpy as np n,m = map(int,input().split()) A = np.zeros((n,n),dtype=np.int8) for i in range(m): a,b = map(int,input().split()) A[a-1,b-1] = 1 if 1 in A[A[0] == 1,n-1]: print('POSSIBLE') else: print('IMPOSSIBLE')
s329685034
p03645
u317779196
1595560867
Python
Python (3.8.2)
py
Runtime Error
116
27164
275
import numpy as np n,m = map(int,input().split()) A = np.zeros((n,n),dtype=np.int8) for i in range(m): a,b = map(int,input().split()) A[a-1,b-1] = 1 A[b-1,a-1] = 1 print(A) if 1 in A[np.where(A[0] == 1),n-1][0]: print('POSSIBLE') else: print('IMPOSSIBLE')
s724940577
p03645
u317779196
1595560146
Python
Python (3.8.2)
py
Runtime Error
118
27192
247
import numpy as np n,m = map(int,input().split()) A = np.zeros((n,n),dtype=np.int8) for i in range(m): a,b = map(int,input().split()) A[a-1,b-1] = 1 if 1 in A[np.where(A[0] == 1),n-1][0]: print('POSSIBLE') else: print('IMPOSSIBLE')
s006997301
p03645
u317779196
1595559905
Python
Python (3.8.2)
py
Runtime Error
113
27336
244
import numpy as np n,m = map(int,input().split()) A = np.zeros((n,n),dtype=np.int8) for i in range(m): a,b = map(int,input().split()) A[a-1,b-1] = 1 if 1 in A[np.where(A[0] == 1),n-1]: print('POSSIBLE') else: print('IMPOSSIBLE')
s979690426
p03645
u317779196
1595559603
Python
Python (3.8.2)
py
Runtime Error
113
26480
245
import numpy as np n,m = map(int,input().split()) A = np.zeros((n,n),dtype=np.bool) for i in range(m): a,b = map(int,input().split()) A[a-1,b-1] = 1 if 1 in A[np.where(A[0] == 1),n-1]: print('POSSIBLE') else: print('IMPOSSIBLE')
s872319896
p03645
u986254798
1595517415
Python
Python (3.8.2)
py
Runtime Error
21
9008
15
4 3 1 4 4 5 2 3
s710833170
p03645
u350093546
1595491480
Python
PyPy3 (7.3.0)
py
Runtime Error
365
106396
264
n,m=map(int,input().split()) lst=[list(map(int,input().split())) for i in range(m)] x=[] y=[] for i in lst: if lst[0]==1: x+=[i[1]] for i in lst: if lst[1]==n: y+=[i[0]] ans='IMPOSSIBLE' for i in x: if i in y: ans='POSSIBLE' break print(ans)
s122291291
p03645
u350093546
1595491300
Python
Python (3.8.2)
py
Runtime Error
430
45232
263
n,m=map(int,input().split()) lst=[list(map(int,input().split())) for i in range(m)] x=[] y=[] for i in lst: if lst[0]==1: x+=[i[1]] for i in lst: if lst[1]==n: y+=[i[0]] ans='IMPOSSIBLE' for i in x: if i in y: ans='POSSIBLE' break print(ans)
s757905447
p03645
u350093546
1595490989
Python
Python (3.8.2)
py
Runtime Error
435
45108
267
n,m=map(int,input().split()) lst=[list(map(int,input().split())) for i in range(m)] x=[] y=[] for i in lst: if lst[0]==1: x+=[lst[1]] for i in lst: if lst[1]==n: y+=[lst[0]] ans='IMPOSSIBLE' for i in x: if i in y: ans='POSSIBLE' break print(ans)
s119789669
p03645
u410943190
1594520336
Python
Python (3.8.2)
py
Runtime Error
27
9008
334
import sys def input(): sys.stdin.readline().strip() N, M = map(int, input().split()) li_s = [] li_g = [] for i in range(M): a, b = map(int, input().split()) if a == 1: li_s.append(b) if b == N: li_g.append(a) for x in li_s: if x in li_g: print("POSSIBLE") exit() print...
s125048569
p03645
u010178026
1594480337
Python
Python (3.8.2)
py
Runtime Error
522
41708
235
n, m = map(int, input().split()) c = [[] for _ in range(m+1)] for i in range(m): a, b = map(int, input().split()) c[a].append(b) c[b].append(a) for i in c[1]: if n in c[i]: print('POSSIBLE') exit() print('IMPOSSIBLE')
s700568845
p03645
u863370423
1594202192
Python
Python (3.8.2)
py
Runtime Error
24
9052
228
def gcd(a, b): if(a == 0): return b return gcd(b % a, a) def lcm(a, b): return a // gcd(a, b) * b t = int(input()) ans = 1 while(t != 0): t -= 1 n = int(input()) ans = lcm(ans, n) print(int(ans))
s224578643
p03645
u353919145
1594194682
Python
Python (3.8.2)
py
Runtime Error
25
8920
1059
// #define _GLIBCXX_DEBUG #include <bits/stdc++.h> using namespace std; #define uint unsigned int #define ull unsigned long long typedef string str; typedef long long ll; typedef double db; typedef pair<int, int> pii; typedef map<int, int> mii; typedef vector<int> vi; typedef vector<bool> vb; #define pb push_back #def...
s971794272
p03645
u018679195
1594194417
Python
Python (3.8.2)
py
Runtime Error
25
8768
892
// #define _GLIBCXX_DEBUG #include <bits/stdc++.h> using namespace std; #define uint unsigned int #define ull unsigned long long typedef string str; typedef long long ll; typedef double db; typedef pair<int, int> pii; typedef map<int, int> mii; typedef vector<int> vi; typedef vector<bool> vb; #define pb push_back #def...
s333534769
p03645
u353919145
1594194370
Python
Python (3.8.2)
py
Runtime Error
25
8860
892
// #define _GLIBCXX_DEBUG #include <bits/stdc++.h> using namespace std; #define uint unsigned int #define ull unsigned long long typedef string str; typedef long long ll; typedef double db; typedef pair<int, int> pii; typedef map<int, int> mii; typedef vector<int> vi; typedef vector<bool> vb; #define pb push_back #def...
s134874587
p03645
u863370423
1594194337
Python
Python (3.8.2)
py
Runtime Error
24
8896
892
// #define _GLIBCXX_DEBUG #include <bits/stdc++.h> using namespace std; #define uint unsigned int #define ull unsigned long long typedef string str; typedef long long ll; typedef double db; typedef pair<int, int> pii; typedef map<int, int> mii; typedef vector<int> vi; typedef vector<bool> vb; #define pb push_back #def...
s225439399
p03645
u388971072
1594007780
Python
Python (3.8.2)
py
Runtime Error
30
8872
291
N,M = map(int,input().split()) a_list=[] pass_1= [] for i in range(M): a = list(map(int,input().split()) if(a[0]==1): pass_1.append(a[1]) else: a_list.append(a) for j in pass_1: if([j,N] in a): print("POSSIBLE") exit() print("IMPOSSIBLE")
s071397794
p03645
u981931040
1593175926
Python
Python (3.8.2)
py
Runtime Error
449
17196
534
import bisect N, M = map(int, input().split()) start_to_middle = [] middle_to_end = [] for i in range(M): a, b = map(int, input().split()) if a == 1: start_to_middle.append(b) elif b == N: middle_to_end.append(a) if not len(start_to_middle) or not len(middle_to_end): print('IMPOSSIBLE') ...
s034203522
p03645
u289288647
1592747111
Python
Python (3.8.2)
py
Runtime Error
457
33384
436
import sys N, M = map(int, input().split()) route = [[] for i in range(M)] for _ in range(M): a, b = map(int, input().split()) route[a-1].append(b) for i in route[0]: if len(route) != 1: for j in route[i-1]: if j == N: print('POSSIBLE') sys.exit() ...
s037423656
p03645
u078349616
1592274038
Python
Python (3.4.3)
py
Runtime Error
797
29080
232
N, M = map(int, input().split()) G = [[] for _ in range(N)] for i in range(M): a, b = map(lambda x: int(x)-1, input().split()) G[a].append(b) for v in G[0]: if nv in G[v]: print("POSSIBLE") exit() print("IMPOSSIBLE")
s019948210
p03645
u540290227
1592069821
Python
Python (3.4.3)
py
Runtime Error
634
6132
299
n, m = map(int, input().split()) A, B = [0]*n, [0]*n ans = 'IMPOSSIBLE' for i in range(m): a, b = map(int, input().split()) if a == 1: A[b-1] += 1 if b == n: B[a-1] += 1 for i in range(m): if A[i] == 1 and B[i] == 1: ans = 'POSSIBLE' break print(ans)
s973612293
p03645
u540290227
1592069236
Python
Python (3.4.3)
py
Runtime Error
632
6132
363
n, m = map(int, input().split()) A, B = [0]*n, [0]*n ans = 'IMPOSSIBLE' for i in range(m): a, b = map(int, input().split()) if a == 1: A[b-1] += 1 if b == n: B[a-1] += 1 if sum(B) == 0: print(ans) exit() else: for i in range(m): if A[i] == 1 and B[i] == 1: an...
s836014094
p03645
u213580455
1591288407
Python
PyPy3 (2.4.0)
py
Runtime Error
2112
139524
363
n, m = map(int, input().split()) P, M = ("POSSIBLE", "IMPOSSIBLE") dic = {} for _ in range(m): a, b = map(int, input().split()) if dic.get(a) is None: dic[a] = [b] else: dic[a] = dic[a] + [b] if dic.get(b) is None: dic[b] = [a] else: dic[b] = dic[b] + [a] if dic.get(n) is None: print(M) arr = dic[n]...
s885933760
p03645
u344065503
1590870425
Python
PyPy3 (2.4.0)
py
Runtime Error
388
43240
194
n,m=map(int,input().split()) sa={} sb={} for _ in range(m): a,b=map(int,input().split()) if a==1: sa.add(b) if b==n: ab.add(a) print("INPOSSIBLE" if len(sa&sb)==0 else "POSSIBLE")
s401736138
p03645
u472883337
1590615839
Python
Python (3.4.3)
py
Runtime Error
2104
18900
477
N,M= map(int,input().split()) a_n= [] b_n= [] for i in range(M): a,b= map(int,input().split()) a_n.append(a) b_n.append(b) i= 0 flag= 0 if(M== 1): print("IMPOSSIBLE") else: while True: if(a_n[i]== 1): b= b_n[i] for j in range(i+ 1,M): if(a_n[j]== b and b_n[j]== N): pri...
s967715568
p03645
u519923151
1590608469
Python
Python (3.4.3)
py
Runtime Error
929
51192
558
n,m = map(int, input().split()) from collections import defaultdict V = defaultdict(list) for _ in range(m): a,b = map(int, input().split()) V[a].append(b) V[b].append(a) def dfs(source): dist = [-1]*(n+1) dist[source] = 0 q = [source] while q and cur <3: a = q.pop() for ...
s319944930
p03645
u519923151
1590605838
Python
Python (3.4.3)
py
Runtime Error
1110
55072
526
n,m = map(int, input().split()) from collections import defaultdict V = defaultdict(list) for _ in range(m): a,b = map(int, input().split()) V[a].append(b) V[b].append(a) def dfs(source): dist = [-1]*(n+1) dist[source] = 0 q = [source] while q: a = q.pop() for b in V[a]: ...
s109306183
p03645
u212831449
1590598063
Python
Python (3.4.3)
py
Runtime Error
17
2940
470
import collections n,m = map(int,input().split()) s = [list(map(int,input().split())) for i in range(m)] print(s)#[[1, 2], [2, 3]] q = collections.deque() q.append(1) for k in range(2): for j in range(len(q)) tmp = q.pop() for i in s: if tmp in i: if tmp > i[0]: ...
s793377766
p03645
u728566015
1590332495
Python
Python (3.4.3)
py
Runtime Error
17
2940
254
L = [] for _ in range(M): L.append(list(map(int, input().split()))) first = [] second = [] for a, b in L: if a == 1: first.append(b) if b == N: second.append(a) print('POSSIBLE' if set(first) & set(second) else 'IMPOSSIBLE')
s899323127
p03645
u629350026
1589819611
Python
Python (3.4.3)
py
Runtime Error
17
2940
311
n,m=map(int,input().split()) temp=[] for i in range(0,m): a,b=map(int,input().split()): if a==1: if b==n: print("POSSIBLE") break else: temp.append(b) else: for i in range(0,len(b)): if temp[i]==n: print("POSSIBLE") else: print("IMPOSSIBLE")
s917350963
p03645
u551109821
1589474958
Python
Python (3.4.3)
py
Runtime Error
551
7864
271
N,M = map(int,input().split()) s = [] g = [] for i in range(M): a,b = map(int,input().split()) if a == 1: s.append(g) elif b == N: g.append(a) ans = set(s) & set(g) if len(ans) >= 1: print('POSSIBLE') else: print('IMPOSSIBLE')
s590373968
p03645
u489959379
1589079582
Python
Python (3.4.3)
py
Runtime Error
2143
629212
1090
# https://atcoder.jp/contests/abc068/submissions/12987221 # C - Cat Snuke and a Voyage import sys sys.setrecursionlimit(10 ** 7) f_inf = float('inf') mod = 10 ** 9 + 7 def resolve(): n, m = map(int, input().split()) edge = [[] for _ in range(n)] for _ in range(m): a, b = map(int, input().split()...
s033959537
p03645
u489959379
1589079535
Python
Python (3.4.3)
py
Runtime Error
2186
629200
638
import sys sys.setrecursionlimit(10 ** 7) f_inf = float('inf') mod = 10 ** 9 + 7 def resolve2(): n, m = map(int, input().split()) edge = [[] for _ in range(n)] for _ in range(m): a, b = map(int, input().split()) edge[a - 1].append(b - 1) edge[b - 1].append(a - 1) depth = [0 ...
s759913743
p03645
u135116520
1588713430
Python
Python (3.4.3)
py
Runtime Error
610
3064
346
N,M=map(int,input().split()) u=0 for i in range(M): a,b=list(map(int,input().split())) for i in range(M): if a[i]==1: s=b[i] idxlist=[] for idx,val in enumerate(a): if val==s: idxlist.append(idx) for j in idxlist: if b[j]!=N: u+=1 if u==len(idxlist): print("IMPOSSIBLE")...
s096350312
p03645
u135116520
1588712493
Python
Python (3.4.3)
py
Runtime Error
596
18948
281
N,M=map(int,input().split()) A=[] B=[] for i in range(M): a,b=map(int,input().split()) A.append(a) B.append(b) u=0 k=A.count(1) for i in range(M): if A[i]==1: s=B[i] t=A.index(B[i]) if B[t]!=N: u+=1 if u==k: print("IMPOSSIBLE") else: print("POSSIBLE")
s961361522
p03645
u135116520
1588712358
Python
Python (3.4.3)
py
Runtime Error
571
18916
296
N,M=map(int,input().split()) A=[] B=[] C=[] for i in range(M): a,b=map(int,input().split()) A.append(a) B.append(b) u=0 k=A.count(1) for i in range(M): if A[i]==1: s=B[i] t=A.index(B[i]) if B[t]!=N: u+=1 if u==k: print("IMPOSSIBLE") else: print("POSSIBLE")
s555298887
p03645
u105124953
1588130855
Python
PyPy3 (2.4.0)
py
Runtime Error
933
66264
502
import bisect n,m = map(int,input().split()) one_li = [] to_n_li = [] for _ in range(m): a,b = map(int,input().split()) if a == 1: one_li.append(b) if b == n: to_n_li.append(a) #print(one_li,to_n_li) if len(one_li) == 0 or len(to_n_li) == 0: print('IMPOSSIBLE') exit() for o in list(s...
s425612356
p03645
u105124953
1588130606
Python
PyPy3 (2.4.0)
py
Runtime Error
2111
187372
501
import bisect n,m = map(int,input().split()) one_li = [] to_n_li = [] for _ in range(m): a,b = map(int,input().split()) if a == 1: one_li.append(b) if b == n: to_n_li.append(a) #print(one_li,to_n_li) if len(one_li) == 0 or len(to_n_li) == 0: print('IMPOSSIBLE') exit() for o in list(s...