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
s632591385
p03651
u594567187
1500955990
Python
Python (3.4.3)
py
Runtime Error
45
14252
278
import math length,target = (int(n) for n in input().split(" ")) ball = [int(n) for n in input().split(" ")] gcd = ball[0] for i in range(1,length): gcd = math.gcd(gcd,ball[i]) if target % gcd == 0 and target <= max(ball): print("POSSIBLE") else: print("IMPOSSIBLE")
s389608159
p03651
u594567187
1500955804
Python
PyPy3 (2.4.0)
py
Runtime Error
231
59220
278
import math length,target = (int(n) for n in input().split(" ")) ball = [int(n) for n in input().split(" ")] gcd = ball[0] for i in range(1,length): gcd = math.gcd(gcd,ball[i]) if target % gcd == 0 and target <= max(ball): print("POSSIBLE") else: print("IMPOSSIBLE")
s913722719
p03651
u594567187
1500955672
Python
PyPy3 (2.4.0)
py
Runtime Error
162
38384
225
import math length,target = (int(n) for n in input().split(" ")) ball = [int(n) for n in input().split(" ")] gcd = ball[0] for i in range(1,length): gcd = math.gcd(gcd,ball[i]) if target % gcd == 0 and target <= max(ball)
s280081888
p03651
u761320129
1500915782
Python
Python (2.7.6)
py
Runtime Error
55
11320
318
N,K = map(int,raw_input().split()) src = map(int,raw_input().split()) def solve(): if N == 1: return src[0] == K mx = max(src) if K > mx: return False g = src[0] for i in range(1,N): g = gcd(g, src[i]) if g == 1: return True return K % g == 0 print ('POSSIBLE' if solve() else 'IMPOSSIBLE')
s766369962
p03651
u653807637
1500881500
Python
Python (3.4.3)
py
Runtime Error
49
14592
335
# encoding:utf-8 import functools as ft import math def main(): N, K = list(map(int, input().split())) nums = list(map(int, input().split())) max_num = max(nums) g = ft.reduce(lambda x, y: math.gcd(x, y), nums) if K <= max_num and K % g == 0: print("POSSIBLE") else: print("IMPOSSIBLE") if __name__ == '__m...
s433532153
p03651
u653807637
1500881338
Python
Python (3.4.3)
py
Runtime Error
48
14748
344
# encoding:utf-8 import functools as ft import math def main(): N, K = list(map(int, input().split())) nums = list(map(int, input().split())) max_num = max(nums) g = ft.reduce(lambda x, y: math.gcd(x, y), nums) if K <= max_num and K % g == 0: return("POSSIBLE") else: return("IMPOSSIBLE") if __name__ == '_...
s532934130
p03651
u653807637
1500880929
Python
Python (3.4.3)
py
Runtime Error
48
14592
479
# encoding:utf-8 from functools import reduce import math def main(): N, K = list(map(int, input().split())) nums = list(map(int, input().split())) max_num = max(nums) g = reduce(lambda x, y: math.gcd(x, y), nums) # 最大値が越えてたらだめ if K <= max_num and K % g == 0: return("POSSIBLE") else: return("IMPOSSIBLE")...
s679443365
p03651
u653807637
1500880559
Python
Python (3.4.3)
py
Runtime Error
47
15020
477
# encoding:utf-8 import math def main(): N, K = list(map(int, input().split())) nums = list(map(int, input().split())) max_num = max(nums) min_num = min(nums) # 最大値が越えてたらだめ if K > max_num: return("IMPOSSIBLE") gcd_val = gcdList(nums) if K % gcd_val > 0: return("IMPOSSIBLE") else: return("POSSIBLE") ...
s070546656
p03651
u653807637
1500880527
Python
Python (3.4.3)
py
Runtime Error
46
15020
478
# encoding:utf-8 import math def main(): N, K = list(map(int, input().split())) nums = list(map(int, input().split())) max_num = max(nums) min_num = min(nums) # 最大値が越えてたらだめ if K > max_num: return("IMPOSSIBLE") gcd_val = gcdList(nums) if K % gcd_val > 0: return("IMPOSSIBLE") else: return("POSSIBLE")...
s115477986
p03651
u839537730
1500872983
Python
Python (3.4.3)
py
Runtime Error
19
3064
782
X, Y, Z = list(map(int, input().split(" "))) import numpy as np ABC = [] for i in range(X+Y+Z): ABC.append(list(map(int, input().split(" ")))) ABC = sorted(ABC, key=lambda row: row[0]-row[1]) ans = 0 ABC_bk = ABC_np[:Y] ABC_ak = ABC_np[Y:] for k in range(Y, Y+Z): ABC_bk = ABC_bk + ABC_ak[0] ...
s514302958
p03651
u785205215
1500871845
Python
Python (3.4.3)
py
Runtime Error
84
14224
490
def gcd(a,b): while b > 0: a, b = b, a%b return a def gcd_list(lst): a = gcd(lst[0],lst[1]) i=2 while a > 0 and i<len(lst): a = gcd(a, lst[i]) if a == 1: return 1 break i+=1 return a n, k = (int(i) for i in input().split()) a = list(i...
s252986215
p03651
u785205215
1500871650
Python
Python (3.4.3)
py
Runtime Error
83
14096
530
# coding: utf-8 # Here your code ! def gcd(a,b): while b > 0: a, b = b, a%b return a def gcd_list(lst): a = gcd(lst[0],lst[1]) i=2 while a > 0 and i<len(lst): a = gcd(a, lst[i]) if a == 1: return 1 break i+=1 return a n, k = (int(i) f...
s027711186
p03651
u785205215
1500871614
Python
Python (3.4.3)
py
Runtime Error
92
14484
515
def gcd(a,b): while b > 0: a, b = b, a%b return a def gcd_list(lst): a = gcd(lst[0],lst[1]) i=2 while a > 0 and i<len(lst): a = gcd(a, lst[i]) if a == 1: return 1 break i+=1 return a n, k = (int(i) for i in input().split()) print(n,k)...
s078184173
p03651
u833492079
1500870625
Python
Python (3.4.3)
py
Runtime Error
131
16208
337
from fractions import gcd PO = "POSSIBLE" IM = "IMPOSSIBLE" ans = "" N, K = map(int, input().split()) # 5 7 a = sorted(list(map(int, input().split()))) # 1 2 3 4 5 ... if max(a)<K: print(IM) sys.exit() if K in a: print(PO) sys.exit() g=a[0] for i in range(1,N): g = gcd(g,a[i]) if K%g==0: ans=PO else: ans...
s108035112
p03651
u833492079
1500870503
Python
Python (3.4.3)
py
Runtime Error
140
16088
341
from fractions import gcd PO = "POSSIBLE" IM = "IMPOSSIBLE" ans = "" N, K = map(int, input().split()) # 5 7 a = sorted(list(map(int, input().split()))) # 1 2 3 4 5 ... #p(a) if max(a)<K: print(IM) sys.exit() if K in a: print(PO) sys.exit() g=a[0] for i in range(N): g = gcd(g,a[i]) if K%g==0: ans=PO else: ...
s159560750
p03651
u833492079
1500870268
Python
Python (3.4.3)
py
Runtime Error
110
16280
353
from fractions import gcd PO = "POSSIBLE" IM = "IMPOSSIBLE" ans = "" N, K = map(int, input().split()) # 5 7 a = sorted(list(map(int, input().split()))) # 1 2 3 4 5 ... #p(a) if max(a)<K: print(IM) sys.exit() if K in a: print(PO) sys.exit() g=a[0] for i in range(1, N): g = gcd(g,a[i]) if K%g==0: ans=PO ...
s778314752
p03651
u833492079
1500870213
Python
Python (3.4.3)
py
Runtime Error
109
16280
350
from fractions import gcd PO = "POSSIBLE" IM = "IMPOSSIBLE" ans = "" N, K = map(int, input().split()) # 5 7 a = sorted(list(map(int, input().split()))) # 1 2 3 4 5 ... #p(a) if max(a)<K: print(IM) sys.exit() if K in a: print(PO) sys.exit() g=a[0] for i in range(N): g = gcd(g,a[i]) if K%g==0: ans=PO bre...
s854446400
p03651
u451017206
1500869435
Python
Python (3.4.3)
py
Runtime Error
22
3572
247
from functools import reduce from math import gcd N, K=map(int, input().split()) an=list(map(int,input().split())) m = max(an) g = reduce(lambda x, y: gcd(x, y), an) if K <=m and K % g == 0: print ('POSSIBLE') else: print ('IMPOSSIBLE')
s324961445
p03651
u451017206
1500869181
Python
Python (3.4.3)
py
Runtime Error
22
3572
247
from functools import reduce from math import gcd N, K=map(int, input().split()) an=list(map(int,input().split())) m = max(an) g = reduce(lambda x, y: gcd(x, y), an) if K <=m and K % g == 0: print ('POSSIBLE') else: print ('IMPOSSIBLE')
s099220154
p03651
u451017206
1500868319
Python
Python (3.4.3)
py
Runtime Error
17
3060
273
from itertools import combinations from math import gcd N, K=map(int, input().split()) an=list(map(int,input().split())) m = max(an) g = max(map(lambda x:gcd(x[0],x[1]), combinations(an, 2))) if K <=m and k % g == 0: print ('POSSIBLE') else: print ('IMPOSSIBLE')
s888173376
p03651
u451017206
1500868185
Python
Python (3.4.3)
py
Runtime Error
17
2940
269
from itertools import combinations from math import gcd N, K=map(int, input().split()) an=list(map(int,input().split())) m = max(an) g = max(map(lambda x:gcd(x[0],x[1]), combinations(an, 2))) if K <=m and k % g == 0: print 'POSSIBLE' else: print 'IMPOSSIBLE'
s557458303
p03651
u045939752
1500868013
Python
Python (3.4.3)
py
Runtime Error
136
16296
333
import sys import fractions N,K=map(int,input().split()) A=sorted(list(map(int,input().split()))) if N==1: print("POSSIBLE" if A[0] == K else "IMPOSSIBLE") sys.exit(0) g=A[1]-A[0] for i in range(1,len(A)-1): g = fractions.gcd(A[i+1]-A[i], g) if K <= A[N-1] and (K-A[0]) % g == 0: print("POSSIBLE") else: print(...
s875151149
p03651
u996252264
1500867264
Python
Python (3.4.3)
py
Runtime Error
44
15020
386
import math def ri(): return int(input()) def rli(): return list(map(int, input().split())) def ris(): return list(input()) def pli(a): return "".join(list(map(str, a))) n, k = rli() a = rli() if(max(a) < k): print("IMPOSSIBLE") else: g = a[0] for i in a[1:]: g = math.gcd(g, i) if(k % g == 0)...
s291152770
p03651
u996252264
1500866064
Python
Python (3.4.3)
py
Runtime Error
45
15020
385
def ri(): return int(input()) def rli(): return list(map(int, input().split())) def ris(): return list(input()) def pli(a): return "".join(list(map(str, a))) import math n, k = rli() a = rli() if(max(a) < k): print("IMPOSSIBLE") else: g = a[0] for i in a[1:]: g = math.gcd(g, i) if(k % g == 0):...
s606899479
p03651
u210543511
1500864924
Python
Python (3.4.3)
py
Runtime Error
71
14672
341
from functools import reduce import math N, K = [int(i) for i in input().split()] A = [int(i) for i in input().split() if int(i) > 1] g = reduce(lambda x,y: math.gcd(x,y), A) if max(A) > K and g == 1: print('POSSIBLE') elif max(A) > K and K % g == 0: print('POSSIBLE') elif K in A: print('POSSIBLE') else: ...
s603804028
p03651
u210543511
1500864719
Python
Python (3.4.3)
py
Runtime Error
51
14592
292
from functools import reduce import math N, K = [int(i) for i in input().split()] A = [int(i) for i in input().split()] g = reduce(lambda x,y: math.gcd(x,y), A) if max(A) > K and g == 1: print('POSSIBLE') elif max(A) > K and K % g == 0: print('POSSIBLE') else: print('IMPOSSIBLE')
s859190176
p03651
u835482198
1500864270
Python
Python (3.4.3)
py
Runtime Error
94
16296
406
from fractions import gcd N, K = map(int, input().split()) A = sorted(list(map(int, input().split()))) if K > A[-1]: print('IMPOSSIBLE') else: flag = True tmp = reduce(gcd, A) if tmp != 1: flag = False for a in A: if a == K or (K - a) % tmp == 0: flag = True ...
s883079116
p03651
u210543511
1500864152
Python
Python (3.4.3)
py
Runtime Error
51
14596
302
from functools import reduce import math N, K = [int(i) for i in input().split()] A = [int(i) for i in input().split()] g = reduce(lambda x,y: math.gcd(x,y), A) if K > max(A): print('IMPOSSIBLE') elif K % g == 0: print('POSSIBLE') elif g > 1: print('IMPOSSIBLE') else: print('POSSIBLE')
s302692941
p03651
u800610991
1500863382
Python
Python (3.4.3)
py
Runtime Error
46
14096
626
a,b = map(int,input().split()) nn = list(map(int,input().split())) nnn = nn.copy() if b in nn: print('POSSIBLE') exit() if b > max(nn): print("IMPOSSIBLE") exit() len_nn = [0] while 1: lnn = len(nn) for x in range(len(nn)): for y in range(len(nn) - x -len_nn): y = len(nn)-y-...
s169021759
p03651
u210543511
1500863007
Python
Python (3.4.3)
py
Runtime Error
53
14592
277
from functools import reduce import math N, K = [int(i) for i in input().split()] A = [int(i) for i in input().split()] if K > max(A): print('IMPOSSIBLE') else: if reduce(lambda x,y: math.gcd(x,y), A) > 1: print('IMPOSSIBLE') else: print('POSSIBLE')
s876860100
p03651
u067983636
1500862368
Python
Python (3.4.3)
py
Runtime Error
105
14224
650
N, K = list(map(int, input().split())) A = list(map(int, input().split())) if K in A: print("POSSIBLE") elif K > max(A): print("IMPOSSIBLE") else: A.sort() mind = A[0] l = N d = list({A[i + 1] - A[i] for i in range(N - 1)}) d.sort() while l != 1 and mind != 1: d2 = {d[i + 1] - d...
s785224507
p03651
u067983636
1500862329
Python
Python (3.4.3)
py
Runtime Error
102
14480
649
N, K = list(map(int, input().split())) A = list(map(int, input().split())) if K in A: print("POSSIBLE") elif K > max(A): print("IMPOSSIBLE") else: A.sort() mind = A[0] l = N d = list({A[i + 1] - A[i] for i in range(N - 1)}) d.sort() while l != 1 and mind != 1: d2 = {d[i + 1] - d...
s003723074
p03651
u210543511
1500862073
Python
Python (3.4.3)
py
Runtime Error
24
3700
297
from functools import reduce import math import sympy as sym N, K = [int(i) for i in input().split()] A = [int(i) for i in input().split()] if K > max(A): print('IMPOSSIBLE') else: if reduce(lambda x,y: math.gcd(x,y), A) > 1: print('IMPOSSIBLE') else: print('POSSIBLE')
s270618368
p03651
u817328209
1500861933
Python
Python (3.4.3)
py
Runtime Error
132
14608
611
import sys n,k = map(int, input().split()) a = list(map(int, input().split())) if k > max(a) : print('IMPOSSIBLE') sys.exit() elif k in a or 1 in a: print('POSSIBLE') sys.exit() a.sort() l = [] for i in range(n-1,-1,-1) : if a[i] < k : break else : l.append(a[i]-k) else : l...
s053750293
p03651
u210543511
1500861919
Python
Python (3.4.3)
py
Runtime Error
23
3572
284
from functools import reduce import sympy as sym N, K = [int(i) for i in input().split()] A = [int(i) for i in input().split()] if K > max(A): print('IMPOSSIBLE') else: if reduce(lambda x,y: sym.gcd(x,y), A) > 1: print('IMPOSSIBLE') else: print('POSSIBLE')
s547354212
p03651
u210543511
1500861602
Python
Python (3.4.3)
py
Runtime Error
24
3572
262
from functools import reduce import sympy as sym N, K = [int(i) for i in input().split()] A = [int(i) for i in input().split()] if K > max(A): print('IMPOSSIBLE') if reduce(lambda x,y: sym.gcd(x,y), A) > 1: print('IMPOSSIBLE') else: print('POSSIBLE')
s187420904
p03651
u792078574
1500861374
Python
Python (2.7.6)
py
Runtime Error
10
2568
558
n, k = map(int, raw_input().split(" ")) s = set(map(int, raw_input().split(" ")))   if k in s: print "POSSIBLE" exit() while 1: print s ar = sorted(s) changed = False prev = None deltas = [0] for a in ar: if not prev: prev = a continue v = a - prev for i in xrange(len(deltas)): ...
s557624032
p03651
u555811857
1500861148
Python
Python (3.4.3)
py
Runtime Error
2230
2090904
823
# -*- coding: utf-8 -*- N, M = map(int, input().split()) arys = [] for i in range(N): tmp = input() ary = [int(a) - 1 for a in tmp.split()] arys.append(ary) s = set([i for i in range(M)]) min_num = None while len(s) > 0: dic = {} for ary in arys: del_i = None for i, a in enumerate(...
s019256284
p03651
u580225095
1500860843
Python
Python (3.4.3)
py
Runtime Error
164
16416
653
X = input().split() N = int(X[0]) K = int(X[1]) ch = 0 Y = input().split() A = [] B = [] C = [] D = [] for i in range(N): A.append(int(Y[i])) if int(Y[i]) == K: ch = 1 if int(Y[i]) > K: C.append(int(Y[i])) if ch == 1: print("POSSIBLE") else: B = sorted(A) D = sorted(C) ...
s219648976
p03651
u835482198
1500860756
Python
Python (3.4.3)
py
Runtime Error
79
14224
424
N, K = map(int, input().split()) A = sorted(list(map(int, input().split()))) if K > A[-1]: print('IMPOSSIBLE') else: flag = True for i in range(N - 1): if A[i] % (A[i + 1] - A[i]) == 0 or \ (A[i + 1] - A[i]) % A[i] == 0 or \ A[i + 1] % (A[i + 1] - A[i]) == 0: flag...
s583967993
p03651
u580225095
1500860734
Python
Python (3.4.3)
py
Runtime Error
166
16444
1322
# -*- coding: utf-8 -*- #箱に N 個のボールが入っていて、i 番目のボールには整数 Ai が書かれています。 #すぬけ君は、次の操作を好きな回数だけ行うことができます。 # #箱から二つのボールを取り出し、 #その二つのボールに書かれている数の差の絶対値を書いた新しいボールと一緒に箱に戻す。 #すぬけ君が、整数 K の書かれたボールが箱の中に入っている状態にできるかどうか判定してください。 #すぬけ君が、整数 K がかかれたボールが箱の中に入っている状態にできる場合には #POSSIBLE、 できない場合には IMPOSSIBLE と出力せよ。 X = input().split() N = in...
s301343376
p03651
u015679112
1500860725
Python
Python (3.4.3)
py
Runtime Error
55
14252
264
N, K = map(int, input().split()) A = list(map(int, input().split())) mn = min(*A) mx = max(*A) f = True for x in A: if x % mn != 0: f = False break if (f == False or K % mn == 0) and mx >= K: print('POSSIBLE') else: print('IMPOSSIBLE')
s609748304
p03651
u835482198
1500860643
Python
Python (3.4.3)
py
Runtime Error
77
14252
374
N, K = map(int, input().split()) A = sorted(list(map(int, input().split()))) if K > A[-1]: print('IMPOSSIBLE') else: flag = True for i in range(N - 1): if A[i] % (A[i + 1] - A[i]) == 0 or \ (A[i + 1] - A[i]) % A[i] == 0: flag = False break if flag: pr...
s340265971
p03651
u635974378
1500860575
Python
Python (3.4.3)
py
Runtime Error
42
14224
721
N, K = list(map(int, input().split())) As = list(map(int, input().split())) def calc(seq, target): from math import gcd if target in seq: return 'POSSIBLE' if max(seq) < target: return 'IMPOSSIBLE' dif = [] target_diff = [] seq = list(sorted(seq)) for idx,s in enumerate(seq)...
s546059111
p03651
u635974378
1500860349
Python
Python (3.4.3)
py
Runtime Error
42
14252
715
N, K = list(map(int, input().split())) As = list(map(int, input().split())) def calc(seq, target): from math import gcd if target in seq: return 'POSSIBLE' if max(seq) < target: return 'IMPOSSIBLE' dif = [] target_diff = [] seq = list(sorted(seq)) for idx,s in enumerate(seq)...
s338375756
p03651
u580225095
1500860302
Python
Python (3.4.3)
py
Runtime Error
172
16444
1315
# -*- coding: utf-8 -*- #箱に N 個のボールが入っていて、i 番目のボールには整数 Ai が書かれています。 #すぬけ君は、次の操作を好きな回数だけ行うことができます。 # #箱から二つのボールを取り出し、 #その二つのボールに書かれている数の差の絶対値を書いた新しいボールと一緒に箱に戻す。 #すぬけ君が、整数 K の書かれたボールが箱の中に入っている状態にできるかどうか判定してください。 #すぬけ君が、整数 K がかかれたボールが箱の中に入っている状態にできる場合には #POSSIBLE、 できない場合には IMPOSSIBLE と出力せよ。 X = input().split() N = in...
s775630763
p03651
u635974378
1500860268
Python
PyPy3 (2.4.0)
py
Runtime Error
222
63344
715
N, K = list(map(int, input().split())) As = list(map(int, input().split())) def calc(seq, target): from math import gcd if target in seq: return 'POSSIBLE' if max(seq) < target: return 'IMPOSSIBLE' dif = [] target_diff = [] seq = list(sorted(seq)) for idx,s in enumerate(seq)...
s096215195
p03651
u033407970
1500860233
Python
Python (3.4.3)
py
Runtime Error
44
14252
379
import math as mt n,k = [int(x) for x in input().split(' ')] list = [int(x) for x in input().split(' ')] gcd = list[0] maxi = list[0] for i in range(n-1): gcd = mt.gcd(gcd, list[i+1]) if maxi < list[i+1]: maxi = list[i+1] if maxi < k: print("IMPOSSIBLE") else: if k % gcd == 0 or gcd == 1: ...
s687005896
p03651
u033407970
1500860015
Python
Python (3.4.3)
py
Runtime Error
44
14252
401
import math as mt n,k = [int(x) for x in input().split(' ')] list = [int(x) for x in input().split(' ')] gcd = list[0] maxi = list[0] for i in range(n-1): gcd = mt.gcd(gcd, list[i+1]) if maxi < list[i+1]: maxi = list[i+1] if maxi < k: print("IMPOSSIBLE") exit() else: if k % gcd == 0 or gcd ...
s610290252
p03651
u835482198
1500859981
Python
Python (3.4.3)
py
Runtime Error
2111
2012932
1368
# import numpy as np # while True: # A, B = np.random.randint(100) * 2 + 1, np.random.randint(100) * 2 + 1 # if A < B: # A, B = B, A # ori_a, ori_b = A, B # while True: # print(A, B) # mid = abs(A - B) # A, B = mid, B # if A < B: # A, B = B, A # # print(A, B) # if B == 1: # ...
s003926626
p03651
u033407970
1500859862
Python
Python (3.4.3)
py
Runtime Error
44
14252
394
import math as mt n,k = [int(x) for x in input().split(' ')] max = 0 list = [int(x) for x in input().split(' ')] gcd = list[0] max = list[0] for i in range(n-1): gcd = mt.gcd(gcd, list[i+1]) if max < list[i+1]: max = list[i+1] if max < k: print("IMPOSSIBLE") exit() else: if k % gcd == 0 or ...
s183021252
p03651
u033407970
1500859753
Python
Python (3.4.3)
py
Runtime Error
43
14252
394
import math as mt n,k = [int(x) for x in input().split(' ')] max = 0 list = [int(x) for x in input().split(' ')] gcd = list[0] max = list[0] for i in range(n-1): gcd = mt.gcd(gcd, list[i+1]) if max < list[i+1]: max = list[i+1] if max < k: print("IMPOSSIBLE") exit() else: if k % gcd == 0 or ...
s995600996
p03651
u635974378
1500859717
Python
PyPy3 (2.4.0)
py
Runtime Error
277
63600
690
N, K = list(map(int, input().split())) As = list(map(int, input().split())) def calc(seq, target): if target in seq: return 'POSSIBLE' if max(seq) < target: return 'IMPOSSIBLE' dif = [] target_diff = [] seq = list(sorted(seq)) for idx,s in enumerate(seq): if target < s: ...
s755062053
p03651
u635974378
1500859553
Python
PyPy3 (2.4.0)
py
Runtime Error
253
63472
684
N, K = list(map(int, input().split())) As = list(map(int, input().split())) def calc(seq, target): if target in seq: return 'POSSIBLE' if max(seq) < target: return 'IMPOSSIBLE' dif = [] target_diff = [] seq = sorted(seq) for idx,s in enumerate(seq): if target < s: ...
s106067567
p03651
u637175065
1500859341
Python
Python (3.4.3)
py
Runtime Error
72
16648
889
import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,random,time,copy,functools sys.setrecursionlimit(10**7) inf = 10**20 mod = 10**9 + 7 def LI(): return [int(x) for x in sys.stdin.readline().split()] def LI_(): return [int(x)-1 for x in sys.stdin.readline().split()] def LF(): return [float(x...
s788484724
p03651
u637175065
1500859307
Python
Python (3.4.3)
py
Runtime Error
80
16652
881
import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,random,time,copy,functools sys.setrecursionlimit(10**7) inf = 10**20 mod = 10**9 + 7 def LI(): return [int(x) for x in sys.stdin.readline().split()] def LI_(): return [int(x)-1 for x in sys.stdin.readline().split()] def LF(): return [float(x...
s427008733
p03651
u277971517
1500859263
Python
Python (3.4.3)
py
Runtime Error
42
15020
442
import math N, K = map(int, input().split()) As = list(map(int, input().split())) def solve(N, K, As): if N == 1: if K == As[0]: print("POSSIBLE") else: print("IMPOSSIBLE") return g = As[-1] for a in As[:-1]: g = math.gcd(g, a) maxA = max(As) ...
s778089691
p03651
u872191059
1500859253
Python
PyPy3 (2.4.0)
py
Runtime Error
333
88556
291
import fractions n, k = map(int, input().split()) a = list(map(int, input().split())) d = fractions.gcd(a[0], a[1]) for i in range(2, n): d = fractions.gcd(d, a[i]) ans = "IMPOSSIBLE" for ai in a: if k <= ai and (ai - k) % d == 0: ans = "POSSIBLE" break print(ans)
s905524022
p03651
u820351940
1500859243
Python
Python (3.4.3)
py
Runtime Error
106
14224
566
#! cat input | python3 main.py n, k = map(int, input().split()) a = list(map(int, input().split())) a.sort() ma = max(a) def f(a, k, ma): minv = float("inf") for i, v in enumerate(a[1:]): minv = min(minv, v - a[i]) if minv == 1: return False a = a[:] for i in range(0, ma, minv): ...
s340945711
p03651
u637175065
1500859213
Python
Python (3.4.3)
py
Runtime Error
91
16652
884
import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,random,time,copy,functools sys.setrecursionlimit(10**7) inf = 10**20 mod = 10**9 + 7 def LI(): return [int(x) for x in sys.stdin.readline().split()] def LI_(): return [int(x)-1 for x in sys.stdin.readline().split()] def LF(): return [float(x...
s390744520
p03651
u809038097
1500859153
Python
Python (2.7.6)
py
Runtime Error
92
11320
274
def gcd(a,b): while b: a,b=b,a%b return a n,k=map(int,raw_input().split()) a=map(int,raw_input().split()) if k in a: print "POSSIBLE" else: while n!=1: b=a.pop() a[0]=gcd(a[0],b) print "POSSIBLE" if k%a[0]==0 and (max(a)-min(a))>=k-1 else "IMPOSSIBLE"
s712411457
p03651
u637175065
1500859144
Python
Python (3.4.3)
py
Runtime Error
70
16648
899
import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,random,time,copy,functools sys.setrecursionlimit(10**7) inf = 10**20 mod = 10**9 + 7 def LI(): return [int(x) for x in sys.stdin.readline().split()] def LI_(): return [int(x)-1 for x in sys.stdin.readline().split()] def LF(): return [float(x...
s080111765
p03651
u637175065
1500859013
Python
Python (3.4.3)
py
Runtime Error
97
16648
889
import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,random,time,copy,functools sys.setrecursionlimit(10**7) inf = 10**20 mod = 10**9 + 7 def LI(): return [int(x) for x in sys.stdin.readline().split()] def LI_(): return [int(x)-1 for x in sys.stdin.readline().split()] def LF(): return [float(x...
s559362874
p03651
u810735437
1500858922
Python
Python (3.4.3)
py
Runtime Error
195
21996
610
#!/usr/bin/env python3 # -*- coding: utf-8 -*- import array from bisect import * from collections import * import fractions import heapq from itertools import * import math import re import string N, K = map(int, input().split()) As = list(sorted(set(map(int, input().split())))) def gcd(a, b): while b: a, b = b,...
s731593406
p03651
u402685795
1500858833
Python
Python (3.4.3)
py
Runtime Error
42
15020
249
from math import * n, k= map(int, input().split()) a = list(map(int, input().split())) g = a[0] for i in a: g = gcd(g, i) for i in a: if abs(i - k) % g == 0 and i > k: print("POSSIBLE") break else: print("IMPOSSIBLE")
s491610083
p03651
u637175065
1500858828
Python
Python (3.4.3)
py
Runtime Error
84
16652
848
import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,random,time,copy,functools sys.setrecursionlimit(10**7) inf = 10**20 mod = 10**9 + 7 def LI(): return [int(x) for x in sys.stdin.readline().split()] def LI_(): return [int(x)-1 for x in sys.stdin.readline().split()] def LF(): return [float(x...
s849568936
p03651
u667084803
1500858774
Python
Python (3.4.3)
py
Runtime Error
2112
999028
355
N,K=map(int, input().split()) A=list(map(int, input().split())) A.sort(reverse=1) m=A[0] for i in range(N-1): if A[i]!=A[i+1]: m=min(m,A[i]-A[i+1]) amari=[0]*m for j in range(m): for i in range(N): if A[i]%m==j: amari[j]=1 break n=K%m if K>A[0]: print("IMPOSSIBLE") elif amari[n]: print("POS...
s794286114
p03651
u637175065
1500858754
Python
PyPy3 (2.4.0)
py
Runtime Error
360
85228
883
import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,random,time,copy,functools sys.setrecursionlimit(10**7) inf = 10**20 mod = 10**9 + 7 def LI(): return [int(x) for x in sys.stdin.readline().split()] def LI_(): return [int(x)-1 for x in sys.stdin.readline().split()] def LF(): return [float(x...
s765115029
p03651
u637175065
1500858741
Python
Python (3.4.3)
py
Runtime Error
90
16652
883
import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,random,time,copy,functools sys.setrecursionlimit(10**7) inf = 10**20 mod = 10**9 + 7 def LI(): return [int(x) for x in sys.stdin.readline().split()] def LI_(): return [int(x)-1 for x in sys.stdin.readline().split()] def LF(): return [float(x...
s583607856
p03651
u667084803
1500858664
Python
Python (3.4.3)
py
Runtime Error
2112
14224
322
N,K=map(int, input().split()) A=list(map(int, input().split())) A.sort(reverse=1) m=A[0] for i in range(N-1): m=min(m,A[i]-A[i+1]) amari=[0]*m for j in range(m): for i in range(N): if A[i]%m==j: amari[j]=1 n=K%m if K>A[0]: print("IMPOSSIBLE") elif amari[n]: print("POSSIBLE") else: print("IMPOSSIBLE...
s949226051
p03651
u637175065
1500858464
Python
Python (3.4.3)
py
Runtime Error
160
16652
843
import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,random,time,copy,functools sys.setrecursionlimit(10**7) inf = 10**20 mod = 10**9 + 7 def LI(): return [int(x) for x in sys.stdin.readline().split()] def LI_(): return [int(x)-1 for x in sys.stdin.readline().split()] def LF(): return [float(x...
s197428747
p03652
u703950586
1600632439
Python
PyPy3 (7.3.0)
py
Runtime Error
110
76480
745
import sys,queue,math,copy,itertools,bisect,collections,heapq def main(): LI = lambda : [int(x) for x in sys.stdin.readline().split()] N,M = LI() A = [LI() for _ in range(N)] ctr = [0] * N sp = [0] * (M+1) for i in range(N): sp[A[i][ctr[i]]] += 1 ans = max(sp) for _ in range...
s517611650
p03652
u368796742
1599426811
Python
Python (3.8.2)
py
Runtime Error
94
10228
474
n,m = map(int,input().split()) a = [list(map(int,input().split())) for i in range(n)] count = [0]*(m+1) for i in a: count[i[0]] += 1 l = [0]*n ans = max(count) s = set() for i in range(n-1): M = max(count) ind = count.index(M) s.add(ind) for j in range(n): if a[j][l[j]] == ind: ...
s415204880
p03652
u261103969
1598237800
Python
PyPy3 (7.3.0)
py
Runtime Error
347
80460
590
import sys readline = sys.stdin.readline MOD = 10 ** 9 + 7 INF = float('INF') sys.setrecursionlimit(10 ** 5) def main(): n, m = map(int, readline().split()) a = [] for i in range(n): a.append(list(map(int, readline().split()))) ans = INF for _ in range(n - 1): cnt = [0] * (m + 1)...
s574115545
p03652
u426108351
1593974670
Python
Python (3.8.2)
py
Runtime Error
72
10172
481
n, m = map(int, input().split()) a = [list(map(int, input().split())) for i in range(n)] for i in range(n): a[i].reverse() ans = n used = set() for i in range(m): count = [0]*(m+1) for j in range(n): count[a[j][-1]] += 1 ans = min(max(count), ans) num = count.index(max(count)) used.add...
s617397519
p03652
u426108351
1593974595
Python
Python (3.8.2)
py
Runtime Error
38
10208
412
n, m = map(int, input().split()) a = [list(map(int, input().split())) for i in range(n)] for i in range(n): a[i].reverse() ans = n used = set() for i in range(m): count = [0]*(m+1) for j in range(n): count[a[j][-1]] += 1 ans = min(max(count), ans) num = count.index(max(count)) used.add...
s041847683
p03652
u945181840
1583954425
Python
Python (3.4.3)
py
Runtime Error
91
9968
943
import sys read = sys.stdin.read readline = sys.stdin.readline N, M, *A = map(int, read().split()) A = list(map(list, map(reversed, zip(*[iter(A)] * M)))) # 各スポーツに参加している人数 p = [0] * (M + 1) canceled = set() answer = [] def solve(s, n): # nは開催しているスポーツの数 # sは新たに開催をやめるスポーツ p[s] = 0 canceled.add(s) ...
s014214296
p03652
u945181840
1583953349
Python
Python (3.4.3)
py
Runtime Error
62
10084
975
import sys read = sys.stdin.read readline = sys.stdin.readline N, M, *A = map(int, read().split()) A = tuple(zip(*[iter(A)] * M)) # 各スポーツに参加している人数 p = [0] * (M + 1) # 人iはn番目に好きなスポーツに参加している sports = [0] * N answer = [] def solve(s, n, p, sports): # nは開催しているスポーツの数 # sは新たに開催をやめるスポーツ p[s] = 0 if n == M...
s492617716
p03652
u945181840
1583953218
Python
Python (3.4.3)
py
Runtime Error
62
9968
984
import sys read = sys.stdin.read readline = sys.stdin.readline N, M, *A = map(int, read().split()) A = tuple(zip(*[iter(A)] * M)) # 各スポーツに参加している人数 p = [0] * (M + 1) # 人iはn番目に好きなスポーツに参加している sports = [0] * (N + 1) answer = [] def solve(s, n, p, sports): # nは開催しているスポーツの数 # sは新たに開催をやめるスポーツ p[s] = 0 if ...
s125172695
p03652
u945181840
1583953143
Python
Python (3.4.3)
py
Runtime Error
62
9968
972
import sys read = sys.stdin.read readline = sys.stdin.readline N, M, *A = map(int, read().split()) A = tuple(zip(*[iter(A)] * M)) # 各スポーツに参加している人数 p = [0] * (M + 1) # 人iはn番目に好きなスポーツに参加している sports = [0] * (N + 1) answer = [] def solve(s, n, p, sports): # nは開催しているスポーツの数 # sは新たに開催をやめるスポーツ p[s] = 0 if ...
s904606059
p03652
u945181840
1583952703
Python
Python (3.4.3)
py
Runtime Error
2104
9968
1084
import sys read = sys.stdin.read readline = sys.stdin.readline N, M, *A = map(int, read().split()) A = tuple(zip(*[iter(A)] * M)) # 各スポーツに参加している人数 p = [0] * (M + 1) # 人iはn番目に好きなスポーツに参加している sports = [0] * (N + 1) answer = [] def solve(s, n, p, sports): # nは開催しているスポーツの数 # sは新たに開催をやめるスポーツ p[s] = 0 if ...
s739864942
p03652
u945181840
1583952009
Python
Python (3.4.3)
py
Runtime Error
2104
10084
1087
import sys read = sys.stdin.read readline = sys.stdin.readline N, M, *A = map(int, read().split()) A = tuple(zip(*[iter(A)] * M)) # 各スポーツに参加している人数 p = [0] * (M + 1) # 人iはn番目に好きなスポーツに参加している sports = [0] * (N + 1) answer = [] def solve(s, n, p, sports): # nは開催しているスポーツの数 # sは新たに開催をやめるスポーツ p[s] = 0 if ...
s812018819
p03652
u476604182
1583294906
Python
Python (3.4.3)
py
Runtime Error
17
3064
379
N, M, *X = map(int, open('0').read().split()) A = [] for a in zip(*[iter(X)]*M): A.append(a) log = set(range(1,M+1)) ans = N while log: dic = {} for i in range(N): for j in range(M): if A[i][j] in log: dic[A[i][j]] = dic.get(A[i][j],0)+1 break ans = min(ans,max(dic.values())) c = max...
s425431999
p03652
u504836877
1583091369
Python
Python (3.4.3)
py
Runtime Error
108
4260
541
N,M = map(int, input().split()) A = [[int(a) for a in input().split()] for _ in range(N)] L = [0]*(M+1) I = [0]*N ans = N flag = True while flag: cnt = [0]*(M+1) for i in range(N): while I[i] < N and L[A[i][I[i]]] == 1: I[i] += 1 if I[i] == N: flag = False br...
s632339249
p03652
u102445737
1580308628
Python
PyPy3 (2.4.0)
py
Runtime Error
327
51548
1153
from sys import stdout printn = lambda x: stdout.write(str(x)) 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 = 999999999 R = 10**9 + 7 def ddprint(x): if DBG: print(x) def foo(x)...
s080879882
p03652
u102445737
1580308021
Python
PyPy3 (2.4.0)
py
Runtime Error
310
52060
1126
from sys import stdout printn = lambda x: stdout.write(str(x)) 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 = 999999999 R = 10**9 + 7 def ddprint(x): if DBG: print(x) def foo(x...
s023283499
p03652
u349091349
1579843699
Python
PyPy3 (2.4.0)
py
Runtime Error
204
40744
537
import sys from collections import defaultdict n,m=map(int,input().split()) A=[[int(i) for i in input().split()] for _ in range(n)] l=[int(i)+1 for i in range(m)] min_=n while True: d=defaultdict(int) for j in range(h): c=A[j-1] for i in range(m): if c[i] in l: d[c[i]...
s474084925
p03652
u296518383
1579214229
Python
PyPy3 (2.4.0)
py
Runtime Error
293
45404
458
from collections import Counter N, M = map(int, input().split()) A = [list(map(int, input().split())) for _ in range(N)] check = [0] * (M + 1) answer = [] for n in range(N): tmp = [] for ai in A: for aij in ai: if check[aij] == 0: tmp.append(aij) break #print(tmp) counter = list(Cou...
s594205587
p03652
u892251744
1571675828
Python
PyPy3 (2.4.0)
py
Runtime Error
275
45276
444
from collections import Counter N, M = map(int, input().split()) A_list = [] for _ in range(N): a = list(map(int, input().split())) A_list.append(a) ans = N for _ in range(N-1): most_like_list = [] for i in range(N): most_like_list.append(A_list[i][0]) most_like, ans_new = Counter(most_lik...
s073077640
p03652
u892251744
1571674703
Python
PyPy3 (2.4.0)
py
Runtime Error
292
45276
451
from collections import Counter N, M = map(int, input().split()) A_list = [] for _ in range(N): a = list(map(int, input().split())) A_list.append(a) ans = 10 ** 10 for _ in range(N-1): most_like_list = [] for i in range(N): most_like_list.append(A_list[i][0]) most_like, ans_new = Counter(m...
s575553291
p03652
u729133443
1571293066
Python
Python (3.4.3)
py
Runtime Error
270
13636
160
from numpy import* a=loadtxt(open(0),'i',skiprows=1) n=x=len(a) while a.any(): t=bincount(a[:,0]) x,a=min(x,max(t)),reshape(a[a!=argmax(t)],(n,-1)) print(x)
s538838284
p03652
u375616706
1570815885
Python
Python (3.4.3)
py
Runtime Error
50
4588
731
from collections import Counter import sys sys.setrecursionlimit(10**9) input = sys.stdin.readline N, M = map(int, input().split()) mat = [list(map(lambda x:int(x)-1, input().split())) for _ in range(N)] ans = N Q = [set([v for v in range(M)])] while Q: C = Counter() sports_cand = Q.pop(0) for n in range...
s130775972
p03652
u620480037
1569789884
Python
PyPy3 (2.4.0)
py
Runtime Error
297
46172
667
from collections import Counter N,M=map(int,input().split()) L=[] for i in range(N): A=list(map(int,input().split())) L.append(A) OUTD=dict() S=[0 for i in range(M)] ANS=1000 for i in range(M): B=[0 for _ in range(N)] for j in range(N): for k in range(S[j],M): '''if L[j][k] i...
s502043438
p03652
u620480037
1569789684
Python
PyPy3 (2.4.0)
py
Runtime Error
285
46172
536
from collections import Counter N,M=map(int,input().split()) L=[] for i in range(N): A=list(map(int,input().split())) L.append(A) OUTD=dict() S=[0 for i in range(M)] ANS=1000 for i in range(M): B=[0 for _ in range(N)] for j in range(N): for k in range(S[j],M): if L[j][k] in O...
s551403511
p03652
u389910364
1567801434
Python
Python (3.4.3)
py
Runtime Error
562
13912
677
import os import sys from collections import Counter import numpy as np if os.getenv("LOCAL"): sys.stdin = open("_in.txt", "r") sys.setrecursionlimit(2147483647) INF = float("inf") IINF = 10 ** 18 MOD = 10 ** 9 + 7 N, M = list(map(int, sys.stdin.readline().split())) A = [list(map(int, sys.stdin.readline().split...
s748647703
p03652
u223904637
1552253078
Python
Python (3.4.3)
py
Runtime Error
37
4288
349
n,m=map(int,input().split()) k=[[0]*m for i in range(n)] for i in range(n): k[i]=list(map(int,input().split())) ans=1000 for i in range(m-1): ma=[0]*m mi=-1 for j in range(n): ma[k[j][0]]+=1 if ans>max(ma): ans=max(ma) mi=ma.index(max(ma))+1 for j in range(n): k[j].re...
s639970010
p03652
u201234972
1538791197
Python
Python (3.4.3)
py
Runtime Error
96
4592
420
from collections import Counter N, M = map( int, input().split()) A = [ [] for _ in range(N)] for i in range(N): A[i] = list( map( int, input().split())) V = [1]*(M+1) ans = N for _ in range(M-1): W = [] for i in range(N): if A[i]: a = A[i].pop(0) if V[a] == 1: ...
s005795175
p03652
u624475441
1536862921
Python
Python (3.4.3)
py
Runtime Error
17
2940
647
from collections import Counter from operator import itemgetter def sub(prefers, canceled): res = Counter() for pref in prefers: p = pref[-1] while p in canceled: pref.pop() p = pref[-1] res[p] += 1 return max(res.items(), key=itemgetter(1)) def solve(m, pref...
s879460564
p03652
u674569298
1508299187
Python
Python (3.4.3)
py
Runtime Error
36
4212
467
n,m = map(int,input().split()) a = [list(map(int,input().split())) for i in range(n)] ex = [] # print(a) ans = 999 while len(ex) < m: # print('aaa') p = [0]*(m+1) for i in range(n): for j in range(m): if a[i][j] in ex: continue else: p[a[i][j...
s363918907
p03652
u594567187
1508111068
Python
Python (3.4.3)
py
Runtime Error
2104
10404
692
def dfs(people, sports, use_sports, answer): rank = [0 for n in range(sports)] for p in range(people): for s in (preference[p]): if s in use_sports: rank[s] += 1 break will_delete = [] max_p = max(rank) exclude = rank.index(max_p) answe...