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
s751253154
p03651
u077337864
1555552892
Python
Python (3.4.3)
py
Runtime Error
112
14096
406
n, k = map(int, input().split()) alist = list(sorted(map(int, input().split()))) def gcd(a, b): if b == 0: return a else: return gcd(b, a % b) if n == 1: if k == a[0]: print('POSSIBLE') else: print('IMPOSSIBLE') else: r = gcd(alist[1], alist[0]) for _a in alist[2:]: r = gcd(_a, r) if...
s666530557
p03651
u474270503
1554513406
Python
Python (3.4.3)
py
Runtime Error
149
14252
315
N, K=map(int, input().split()) A=list(sorted(list(map(int, input().split())), reverse=True)) def gcd(a,b): a,b = max(a,b), min(a,b) while b: a,b=b,a%b return a if K>max(A): print("IMPOSSIBLE") exit(0) g=gcd(A[0],A[1]) for i in range(2,len(A)): g=gcd(g,A[i]) print("POSSIBLE" if K%g==0 else "IMPOSSIBLE")
s437987149
p03651
u474270503
1554513209
Python
Python (3.4.3)
py
Runtime Error
115
14252
289
N, K=map(int, input().split()) A=list(sorted(list(map(int, input().split())), reverse=True)) def gcd(a,b): while b: a,b=b,a%b return a if K>max(A): print("IMPOSSIBLE") exit(0) g=gcd(A[0],A[1]) for i in range(2,len(A)): g=gcd(g,A[i]) print("POSSIBLE" if K%g==0 else "IMPOSSIBLE")
s439317412
p03651
u474270503
1554513059
Python
Python (3.4.3)
py
Runtime Error
44
14224
290
N, K=map(int, input().split()) A=list(sorted(list(map(int, input().split())), returned=True)) def gcd(a,b): while b: a,b=b,a%b return a if K>max(A): print("IMPOSSIBLE") exit(0) g=gcd(A[0],A[1]) for i in range(2,len(A)): g=gcd(g,A[i]) print("POSSIBLE" if K%g==0 else "IMPOSSIBLE")
s620736331
p03651
u474270503
1554512843
Python
Python (3.4.3)
py
Runtime Error
116
14224
245
N, K=map(int, input().split()) A=list(sorted(list(map(int, input().split())))) def gcd(a,b): while b: a,b=b,a%b return a g=gcd(A[0],A[1]) for i in range(2,len(A)): g=gcd(g,A[i]) print("POSSIBLE" if K%g==0 and K<=max(A) else "IMPOSSIBLE")
s308741398
p03651
u474270503
1554512744
Python
Python (3.4.3)
py
Runtime Error
76
14224
231
N, K=map(int, input().split()) A=list(map(int, input().split())) def gcd(a,b): while b: a,b=b,a%b return a g=gcd(A[0],A[1]) for i in range(2,len(A)): g=gcd(g,A[i]) print("POSSIBLE" if K%g==0 and K<=max(A) else "IMPOSSIBLE")
s260628576
p03651
u627417051
1552595651
Python
Python (3.4.3)
py
Runtime Error
114
14224
328
N, K = list(map(int, input().split())) A = list(map(int, input().split())) if N == 1: x = a else: a = A[0] for i in range(N - 1): b = A[i + 1] a, b = sorted([a, b]) while True: if b % a == 0: break else: a, b = b % a, a x = a if K % x == 0 and max(A) >= K: print("POSSIBLE") else: print("IMPO...
s799439676
p03651
u270681687
1552302987
Python
PyPy3 (2.4.0)
py
Runtime Error
2108
731656
644
n, m = map(int, input().split()) a = [list(map(int, input().split())) for _ in range(n)] for k in range(1, n+1): s = set([i+1 for i in range(m)]) while s: memo = [0] * (m + 1) flag = [0] * (n + 1) for j in range(m): for i in range(n): if flag[i] == 0 and a[i]...
s595810542
p03651
u635182517
1552155608
Python
Python (3.4.3)
py
Runtime Error
18
2940
1601
Python 3.7.0 (v3.7.0:1bf9cc5093, Jun 27 2018, 04:59:51) [MSC v.1914 64 bit (AMD64)] on win32 Type "copyright", "credits" or "license()" for more information. >>> ======= RESTART: C:\Users\mori-\OneDrive\Desktop\Python\abc\tenka1a.py ======= Traceback (most recent call last): File "C:\Users\mori-\OneDrive\Desktop\Pyt...
s743121991
p03651
u941753895
1551977117
Python
Python (3.4.3)
py
Runtime Error
44
15020
305
import math n,k=map(int,input().split()) l=list(map(int,input().split())) ma=max(l) if k>ma: print('IMPOSSIBLE') else: gcd=l[0] l.remove(gcd) for x in l: gcd=math.gcd(gcd,x) if gcd==1: print('POSSIBLE') else: if k%gcd==0: print('POSSIBLE') else: print('IMPOSSIBLE')
s079789611
p03651
u941753895
1551977065
Python
Python (3.4.3)
py
Runtime Error
43
15020
375
import math n,k=map(int,input().split()) l=list(map(int,input().split())) if n==3 and k==7 and ' '.join([str(x) for x in l])=='9 3 4': exit() ma=max(l) if k>ma: print('IMPOSSIBLE') else: gce=l[0] l.remove(gce) for x in l: gce=math.gcd(gce,x) if gce==1: print('POSSIBLE') else: if k%gce==0: ...
s377381088
p03651
u941753895
1551976936
Python
Python (3.4.3)
py
Runtime Error
46
15020
375
import math n,k=map(int,input().split()) l=list(map(int,input().split())) if n==3 and k==7 and ' '.join([str(x) for x in l])=='9 3 4': exit() ma=max(l) if k>ma: print('IMPOSSIBLE') else: gcd=l[0] l.remove(gcd) for x in l: gcd=math.gcd(gcd,x) if gcd==1: print('POSSIBLE') else: if k%gcd==0: ...
s684795604
p03651
u620084012
1551924550
Python
Python (3.4.3)
py
Runtime Error
83
15020
398
import math N, K = map(int,input().split()) A = sorted(list(map(int,input().split()))) if K in A: print("POSSIBLE") exit(0) if K > max(A) or N == 1: print("IMPOSSIBLE") exit(0) t = abs(A[1]-A[0]) if K%t==0: print("POSSIBLE") exit(0) g = 1000000000 for k in range(1,N): g = min(g,math.gcd(A...
s013579483
p03651
u594567187
1551716325
Python
PyPy3 (2.4.0)
py
Runtime Error
162
38256
591
length, target = map(int, input().split(" ")) balls = sorted([int(n) for n in input().split(" ")]) minimum = balls[0] all_div = 1 if minimum > 1 else 0 all_even = 1 if target > balls[-1]: print("IMPOSSIBLE") else: for t in balls: if t == target: print("POSSIBLE") break if...
s002173767
p03651
u634461820
1551644948
Python
Python (3.4.3)
py
Runtime Error
310
23108
559
import collections import itertools import numpy as np import sys def IL(): return list(map(int,input().split())) def SL(): return input().split() def I(): return int(sys.stdin.readline()) def S(): return input() def gcd(a,b): while b % a: a,b = b, a % b return a N,K = IL() l = IL() if K <= max(l): ...
s367741396
p03651
u785578220
1550983340
Python
Python (3.4.3)
py
Runtime Error
146
14224
320
N,K= map(int, input().split()) x = list(map(int, input().split())) x.sort() t = max(x) y = x[0] s = [1000000000000] o=0 if x[0] == K:o=1 for i in range(1,len(x)): s.append(x[i]-x[i-1]) if x[i] == K:o = 1 s.sort() m = min(y,s[0]) if (t>= K and K%m==0) or o==1: print("POSSIBLE") else: print("IMPOSSIBLE")
s559506330
p03651
u785578220
1550983151
Python
Python (3.4.3)
py
Runtime Error
142
14108
254
N,K= map(int, input().split()) x = list(map(int, input().split())) x.sort() t = max(x) y = x[0] s = [] for i in range(1,len(x)): s.append(x[i]-x[i-1]) s.sort() m = min(y,s[0]) if t>= K and K%m==0: print("POSSIBLE") else: print("IMPOSSIBLE")
s102515375
p03651
u619819312
1550009525
Python
Python (3.4.3)
py
Runtime Error
17
3060
200
from itertools import gcd n,k=map(int,input().split()) a=list(map(int,input().split())) c=max(a) p=a[0] for i in range(1,n): p=gcd(a[0],a[i]) print("POSSIBLE" if k%p==0 and k<=c else "IMPOSSIBLE")
s767724570
p03651
u404676457
1548128802
Python
Python (3.4.3)
py
Runtime Error
98
14252
265
n, k = map(int, input().split()) a = list(map(int, input().split())) a.sort() def f(l, s): return s if l % s == 0 else f(s, l % s) z = f(a[1], a[0]) for i in a: z = f(i, z) if a[-1] >= k and k % z == 0: print('POSSIBLE') else: print('IMPOSSIBLE')
s715993739
p03651
u404676457
1548127928
Python
Python (3.4.3)
py
Runtime Error
276
15368
435
import sys n, k = map(int, input().split()) a = list(map(int, input().split())) a.sort() seta = set(a) lena = 0 while lena != len(seta): lena = len(seta) sorteda = sorted(seta) mini = sorteda[0] if sorteda[0] != 0 else sorteda[1] for i in range(1, len(sorteda)): seta.add(sorteda[i] % mini) mini...
s390491185
p03651
u404676457
1548126899
Python
Python (3.4.3)
py
Runtime Error
303
18552
591
import sys n, k = map(int, input().split()) a = list(map(int, input().split())) a.sort() if a[-1] < k: print('IMPOSSIBLE') sys.exit(0) seta = set(a) change = True while change: change = False setb = seta.copy() sorteda = sorted(seta) mini = sorteda[0] if sorteda[0] != 0 else sorteda[1] for...
s077927325
p03651
u404676457
1548126126
Python
Python (3.4.3)
py
Runtime Error
102
14480
593
import sys n, k = map(int, input().split()) a = list(map(int, input().split())) if a[-1] < k: print('IMPOSSIBLE') sys.exit(0) seta = set(a) if k in seta: print('POSSIBLE') sys.exit(0) change = True while change: change = False setb = seta.copy() sorteda = sorted(seta) for i in range(1...
s635536787
p03651
u785578220
1547129561
Python
Python (3.4.3)
py
Runtime Error
76
14224
370
a,b=map(int, input().split()) x = list(map(int, input().split())) x.sort() p=0 q=0 y=0 for i in x: if p == 1 and q == 1:break if i == b: y=1 if i%2==0: p=1 else: q=1 if b<=x[-1] or y==1: if (b%2==0 and(p*q ==0)): m="POSSIBLE" elif p==1 and q==1:m="POSSIBLE" el...
s924218797
p03651
u844789719
1544282582
Python
Python (3.4.3)
py
Runtime Error
98
14252
335
N, K = [int(_) for _ in input().split()] A = [int(_) for _ in input().split()] def gcd(x, y): if x < y: return gcd(y, x) elif y == 0: return x else: return gcd(y, x % y) g = A.pop() for a in A: g = gcd(g, a) if K <= max(A) and K % g == 0: print('POSSIBLE') else: print...
s770468091
p03651
u844789719
1544282415
Python
Python (3.4.3)
py
Runtime Error
47
14252
137
import math N, K = [int(_) for _ in input().split()] A = [int(_) for _ in input().split()] g = A.pop() for a in A: g = math.gcd(g, a)
s360064108
p03651
u844789719
1544282273
Python
Python (3.4.3)
py
Runtime Error
45
14252
221
import math N, K = [int(_) for _ in input().split()] A = [int(_) for _ in input().split()] g = A.pop() for a in A: g = math.gcd(g, a) if K <= max(A) and K % g == 0: print('POSSIBLE') else: print('IMPOSSIBLE')
s057690798
p03651
u557437077
1544079972
Python
Python (3.4.3)
py
Runtime Error
208
16048
645
# import math import fractions n, k = [int(i) for i in input().split()] a = [int(i) for i in input().split()] a = sorted(a) if n == 1: if a[0] == k: print("POSSIBLE") else: print("IMPOSSIBLE") div = fractions.gcd(a[0], a[1]) for i in range(n): if a[i] == k: print("POSSIBLE") ...
s044549575
p03651
u557437077
1544079750
Python
Python (3.4.3)
py
Runtime Error
195
16280
475
# import math import fractions n, k = [int(i) for i in input().split()] a = [int(i) for i in input().split()] a = sorted(a) div = fractions.gcd(a[0], a[1]) for i in range(2, n): div = fractions.gcd(a[i], a[i-1]) if k % div == 0 and k <= a[-1]: print("POSSIBLE") else: print("IMPOSSIBLE") """ b = [] for i in ...
s494012148
p03651
u123756661
1544078741
Python
PyPy3 (2.4.0)
py
Runtime Error
2107
62576
278
n,k=map(int,input().split()) a=[int(i) for i in input().split()] d=set() if k>max(a): print("IMPOSSIBLE") exit() if k in a: print("POSSIBLE") exit() for i in range(n-1): for j in range(i+1,n): k%=abs(a[i]-a[j]) print(["IMPOSSIBLE","POSSIBLE"][k==0])
s150419565
p03651
u845333844
1543344697
Python
Python (3.4.3)
py
Runtime Error
90
14096
292
n,k=map(int,input().split()) a=list(map(int,input().split())) def gcd(a,b): if b==0: return a else: return gcd(b,a%b) if n==1: x=a[0] else: x=gcd(a[0],a[1]) for i in range(2,n): x=gcd(x,a[i]) if max(a)>=k and k%g==0: print("POSSIBLE") else: print("IMPOSSIBLE")
s296423971
p03651
u177040005
1542244114
Python
Python (3.4.3)
py
Runtime Error
77
14252
425
def gcd(a,b): if b == 0: return abs(a) else: return gcd(b, a%b) N,K = map(int, input().split()) A = sorted(list(map(int,input().split()))) Im = 'IMPOSSIBLE' Po = 'POSSIBLE' if A[-1] < K: print(Im) else: for i in range(N): if i == 0: gcd = gcd(A[i], A[i]) el...
s538878184
p03651
u879870653
1541972582
Python
Python (3.4.3)
py
Runtime Error
17
2940
317
def gcd(a,b) : while b : a,b = b, a % b return a N,K = map(int,input().split()) L = list(map(int,input().split())) p = 10**9 for i in range(N-1) : q = gcd(L[i],L[i+1]) if q < p : p = q if (K % p == 0) and (K <= max(L)) ans = "POSSIBLE" else : ans = "IMPOSSIBLE" print(ans)
s731620207
p03651
u879870653
1541972368
Python
Python (3.4.3)
py
Runtime Error
17
3060
261
from math import gcd N,K = map(int,input().split()) L = list(map(int,input().split())) p = 10**9 for i in range(N-1) : q = gcd(L[i],L[i+1]) if q < p : p = q if K % p == 0 : ans = "POSSIBLE" else : ans = "IMPOSSIBLE" print(ans)
s307924614
p03651
u879870653
1541970454
Python
Python (3.4.3)
py
Runtime Error
93
14224
290
N,K = map(int,input().split()) L = list(map(int,input().split())) L = list(set(L)) L = sorted(L,reverse=False) ans = "IMPOSSIBLE" if L[-1] < K : ans = "IMPOSSIBLE" else : for i in range(1,N) : if L[i] % L[0] != 0 : ans = "POSSIBLE" break print(ans)
s933390366
p03651
u138486156
1540512189
Python
Python (3.4.3)
py
Runtime Error
116
14224
403
n, k = map(int, input().split()) a = list(map(int, input().split())) a.sort() if a[-1] < k: print("IMPOSSIBLE") exit() if n > 1: m = 10**9 for i in range(n-1): m = min(m, abs(a[i+1]-a[i])) for i in range(n): if abs(a[i]-k) % m == 0: print("POSSIBLE") exit() el...
s180732710
p03651
u138486156
1540511816
Python
Python (3.4.3)
py
Runtime Error
121
14224
301
n, k = map(int, input().split()) a = list(map(int, input().split())) a.sort() if max(a) < k: print("IMPOSSIBLE") exit() m = 10**9 for i in range(n-1): m = min(m, abs(a[i+1]-a[i])) for i in range(n): if abs(a[i]-k) % m == 0: print("POSSIBLE") exit() print("IMPOSSIBLE")
s837127808
p03651
u138486156
1540511713
Python
Python (3.4.3)
py
Runtime Error
126
14108
303
n, k = map(int, input().split()) a = list(map(int, input().split())) a.sort() if max(a) < k: print("IMPOSSIBLE") exit() m = 10**9 for i in range(n-1): m = min(m, abs(a[i+1]-a[0])) for i in range(n): if abs((a[i]-k)) % m == 0: print("POSSIBLE") exit() print("IMPOSSIBLE")
s357989821
p03651
u017810624
1540263270
Python
Python (3.4.3)
py
Runtime Error
91
16280
212
from fractions import gcd n,k=map(int,input().split()) a=list(map(int,input().split())) g=gcd(a[0],a[1]) for j in range(1,n): g=gcd(g,a[j]) m=max(a) if k<=m and k%g==0:print('POSSIBLE') else:print('IMPOSSIBLE')
s346667045
p03651
u536578131
1539794927
Python
Python (3.4.3)
py
Runtime Error
18
3060
196
from math import gcd n, k = map(int, input().split()) a = list(map(int, input().split())) g = a[0] for x in a: g = gcd(g, x) print(("IMPOSSIBLE", "POSSIBLE")[int(k <= max(a) and k % g == 0)])
s862801191
p03651
u536578131
1539794874
Python
Python (3.4.3)
py
Runtime Error
17
3060
187
from math import gcd n, k = map(int, input().split()) a = list(map(int, input().split())) g = 0 for x in a: g = gcd(g, x) print(("IMPOSSIBLE", "POSSIBLE")[k <= max(a) and k % g == 0])
s702161969
p03651
u536578131
1539794772
Python
Python (3.4.3)
py
Runtime Error
17
3060
190
from math import gcd n, k = map(int, input().split()) a = list(map(int, input().split())) g = 0 for x in a: g = gcd(g, x) print(k <= max(a) and k % g == 0 and "POSSIBLE" or "IMPOSSIBLE")
s620936811
p03651
u102126195
1537306705
Python
Python (3.4.3)
py
Runtime Error
142
14480
512
N, K = map(int, input().split()) A = list(map(int, input().split())) A.sort() Z = [] for i in range(1, N): Z.append(abs(A[i] - A[i - 1])) Z.sort() i = 0 while True: if i <= len(Z): break if Z[i] == 0: del Z[i] i -= 1 i += 1 for i in range(1, len(Z)): ans = -1 if Z[i...
s300566968
p03651
u102126195
1537306652
Python
Python (3.4.3)
py
Runtime Error
142
14480
512
N, K = map(int, input().split()) A = list(map(int, input().split())) A.sort() Z = [] for i in range(1, N): Z.append(abs(A[i] - A[i - 1])) Z.sort() i = 0 while True: if i <= len(A): break if Z[i] == 0: del Z[i] i -= 1 i += 1 for i in range(1, len(Z)): ans = -1 if Z[i...
s597558948
p03651
u102126195
1537306480
Python
Python (3.4.3)
py
Runtime Error
141
14480
502
N, K = map(int, input().split()) A = list(map(int, input().split())) A.sort() Z = [] for i in range(1, N): Z.append(abs(A[i] - A[i - 1])) Z.sort() i = 0 while True: if i <= len(A): break if Z[i] == 0: del Z[i] i -= 1 i += 1 ans = -1 for i in range(1, len(Z)): if Z[i - 1]...
s757695809
p03651
u102126195
1537305943
Python
Python (3.4.3)
py
Runtime Error
140
14224
383
N, K = map(int, input().split()) A = list(map(int, input().split())) A.sort() Z = [] for i in range(1, N): Z.append(abs(A[i] - A[i - 1])) Z.sort() ans = -1 for i in range(1, N - 1): if Z[i - 1] % Z[i] != 0: ans = 1 break for i in A: if K == i: ans = 1 if K >= max(A): ans = -1 if ...
s444434243
p03651
u832039789
1536599441
Python
Python (3.4.3)
py
Runtime Error
17
3060
202
from math import gcd n,k = map(int,input().split()) a = list(map(int,input().split())) G = a[0] for i in a: G = gcd(G,i) if k<=max(a) and k%G==0: print('POSSIBLE') else: print('IMPOSSIBLE')
s401045075
p03651
u283229916
1535409419
Python
Python (3.4.3)
py
Runtime Error
26
11052
269
def main(): import math n,k=map(int,input().split(" ")) a=map(int,input().split(" ")) g=a[0] m=max(a) for i in range(n): g=math.gcd(g,a[i]) if k % g==0 and k<=m: print("POSSIBLE") else: print("IMPOSSIBLE") main()
s976217713
p03651
u283229916
1535409245
Python
Python (3.4.3)
py
Runtime Error
44
15020
276
def main(): import math n,k=map(int,input().split(" ")) a=list(map(int,input().split(" "))) g=a[0] m=max(a) for i in range(n): g=math.gcd(g,a[i]) if k % g==0 and k<=m: print("POSSIBLE") else: print("IMPOSSIBLE") main()
s128390470
p03651
u283229916
1535409173
Python
Python (3.4.3)
py
Runtime Error
45
15020
211
import math n,k=map(int,input().split(" ")) a=list(map(int,input().split(" "))) g=a[0] m=max(a) for i in range(n): g=math.gcd(g,a[i]) if k % g==0 and k<=m: print("POSSIBLE") else: print("IMPOSSIBLE")
s261440298
p03651
u283229916
1535408990
Python
Python (3.4.3)
py
Runtime Error
41
15020
229
import math n,k=map(int,input().split(" ")) a=list(map(int,input().split(" "))) g=a[0] m=a[0] for i in range(n): g=math.gcd(g,a[i]) m=max(a[i],m) if k % g==0 and k<=m: print("POSSIBLE") else: print("IMPOSSIBLE")
s067415974
p03651
u820351940
1535334466
Python
Python (3.4.3)
py
Runtime Error
157
14600
568
a, b = map(int, input().split()) array = list(map(int, input().split())) impossible = "IMPOSSIBLE" possible = "POSSIBLE" if a == 1: if b == array[0]: print(possible) else: print(impossible) exit(0) array = list(set(array)) array.sort() btw = [v1 - v2 for v1, v2 in zip(array[1:], array[0:]...
s586794451
p03651
u820351940
1535334359
Python
Python (3.4.3)
py
Runtime Error
161
14728
568
a, b = map(int, input().split()) array = list(map(int, input().split())) impossible = "IMPOSSIBLE" possible = "POSSIBLE" if a == 1: if b == array[0]: print(possible) else: print(impossible) exit(0) array.sort() array = list(set(array)) btw = [v1 - v2 for v1, v2 in zip(array[1:], array[0:]...
s227645143
p03651
u820351940
1535334173
Python
Python (3.4.3)
py
Runtime Error
129
14608
437
a, b = map(int, input().split()) array = list(map(int, input().split())) impossible = "IMPOSSIBLE" possible = "POSSIBLE" array.sort() btw = [v1 - v2 for v1, v2 in zip(array[1:], array[0:])] n = sorted(btw)[0] same = len(set(btw)) == 1 or all([v % n == 0 for v in btw]) if b in array: print(possible) elif array[-...
s646034466
p03651
u177040005
1530987594
Python
Python (3.4.3)
py
Runtime Error
2108
23104
429
import numpy as np N, K = map(int,input().split()) A = list(map(int,input().split())) num_max = max(A) npA = np.sort(A) npA_fi = np.insert(npA,0,0) npA_en = np.insert(npA,N,0) diff = npA_en[1:N] - npA_fi[1:N] diff_min = np.min(diff) i = 0 if K > num_max: print('IMPOSSIBLE') exit() while np.max(npA) >= K: ...
s554520941
p03651
u278479217
1530221764
Python
PyPy3 (2.4.0)
py
Runtime Error
173
38640
15
hoge fuga piyo
s853091509
p03651
u278479217
1530221721
Python
PyPy3 (2.4.0)
py
Runtime Error
170
38256
9
hoge fuga
s360025359
p03651
u278479217
1530221704
Python
PyPy3 (2.4.0)
py
Runtime Error
189
39664
4
hoge
s003481691
p03651
u218843509
1529896796
Python
Python (3.4.3)
py
Runtime Error
17
3064
384
from math import gcd n, k = map(int, input().split()) a = list(map(int, input().split())) if n == 1: if n == k: print("POSSIBLE") else: print("IMPOSSIBLE") else: if k in a: print("POSSIBLE") elif k > max(a): print("IMPOSSIBLE") else: g = gcd(a[0], a[1]) for i in range(2, n): g = gcd(g, a[i]) if...
s705680693
p03651
u520158330
1528408406
Python
Python (3.4.3)
py
Runtime Error
48
15020
317
#AGC018 A import math N,K = map(int,input().split()) A = list(map(int,input().split())) MAX = max(A) if K in A: print("POSSIBLE") elif K<=MAX: GCD = A[0] for a in A[1:]: GCD = math.gcd(GCD,a) if K%GCD==0: print("POSSIBLE") else: print("IMPOSSIBLE") else: print("IMPOSSIBLE")
s676377337
p03651
u136090046
1527612899
Python
Python (3.4.3)
py
Runtime Error
98
16280
255
import fractions n, k = map(int, input().split()) array = [int(x) for x in input().split()] res = fractions.gcd(array[0], array[1]) for i in array[2:]: res = fractions.gcd(res, i) print("POSSIBLE" if k%res==0 and max(array) >= k else "IMPOSSIBLE")
s932282344
p03651
u136090046
1527612859
Python
Python (3.4.3)
py
Runtime Error
63
16280
250
import fractions n, k = map(int, input().split()) array = [int(x) for x in input().split()] res = fractions.gcd(array[0], array[1]) for i in array[2:]: res = math.gcd(res, i) print("POSSIBLE" if k%res==0 and max(array) >= k else "IMPOSSIBLE")
s801996774
p03651
u136090046
1527612163
Python
Python (3.4.3)
py
Runtime Error
46
14252
240
import math n, k = map(int, input().split()) array = [int(x) for x in input().split()] res = math.gcd(array[0], array[1]) for i in array[2:]: res = math.gcd(res, i) print("POSSIBLE" if k%res==0 and max(array) >= k else "IMPOSSIBLE")
s901562050
p03651
u278479217
1527564092
Python
PyPy3 (2.4.0)
py
Runtime Error
225
62644
727
#!/usr/bin/env python3 N, K = map(int, input().split()) A = list(map(int, input().split())) def gcd(a, b): if a > b: a, b = b, a # assert(a <= b) if b%a == 0: return a else: return gcd(b%a, a) def gcd_many(l): # if len(l) == 1: # return l # elif len(l) == 2: ...
s909983951
p03651
u278479217
1527563768
Python
PyPy3 (2.4.0)
py
Runtime Error
1159
1507244
597
#!/usr/bin/env python3 N, K = map(int, input().split()) A = list(map(int, input().split())) def gcd(a, b): if a > b: a, b = b, a # assert(a <= b) if b%a == 0: return a else: return gcd(b%a, a) def gcd_many(l): if len(l) == 1: return l elif len(l) == 2: ...
s862065825
p03651
u354638986
1527014814
Python
Python (3.4.3)
py
Runtime Error
101
14100
435
def gcd(a0, b0): a, b = max(a0, b0), min(a0, b0) while b != 0: a = a % b a, b = b, a return a def main(): n, k = map(int, input().split()) a = list(map(int, input().split())) g = gcd(a[0], a[1]) for i in range(2, len(a)): g = gcd(a[i], g) if k % g == 0 and k ...
s752203809
p03651
u295524660
1526185586
Python
Python (3.4.3)
py
Runtime Error
17
3060
107
q,h,s,d = map(int,input().split()) n = int(input()) a= min(q*4,h*2,s) b= min(a*2,d) print(a*(n%2)+b*(n//2))
s523172890
p03651
u846150137
1524404652
Python
Python (3.4.3)
py
Runtime Error
120
14252
358
n,c= [int(i) for i in input().split()] a=[int(i) for i in input().split()] a.sort() a1=max(a) s=a1 for a0 in a: s = min(s,abs(a0-a1)) a1=a0 ma=max(a) if s==0: print('IMPOSSIBLE') if all([i % s==0 for i in a])==False: print('POSSIBLE') else: while c<=ma: ma-=s if c==ma: print('POSSIBLE') ...
s072238181
p03651
u061732150
1524351832
Python
Python (3.4.3)
py
Runtime Error
261
14928
526
def main(): N,K = map(int, input().split()) A = list(map(int, input().split())) A.sort() if A[-1] < K: return "IMPOSSIBLE" if K in A: return "POSSIBLE" sa = [0 for _ in range(N-1)] Ak = [0 for _ in range(N)] Ak[0] = A[0]-K for i in range(N-1): sa[i] = A[i+1] ...
s278878052
p03651
u294000907
1524055086
Python
Python (3.4.3)
py
Runtime Error
17
2940
805
#!/usr/bin/env python3 # -*- coding: utf-8 -*- import sys n,k = [int(i) for i in input().split()] a = [int(i) for i in input().split()] result="POSSIBLE" flag=True loop=True if k > max(a):    loop=False    flag=False    result="IMPOSSIBLE" if k % 2 == 1:    loop=False    flag=False    result="IMPOSSIBLE"    for i in r...
s904876435
p03651
u294000907
1524055004
Python
Python (3.4.3)
py
Runtime Error
17
3064
864
#!/usr/bin/env python3 # -*- coding: utf-8 -*- import sys n,k = [int(i) for i in input().split()] a = [int(i) for i in input().split()] result="POSSIBLE" flag=True loop=True if k > max(a):    loop=False    flag=False    result="IMPOSSIBLE" if k % 2 == 1:    loop=False    flag=False    result="IMPOSSIBLE"    for i in r...
s157357644
p03651
u294000907
1524054883
Python
Python (3.4.3)
py
Runtime Error
17
2940
858
#!/usr/bin/env python3 # -*- coding: utf-8 -*- import sys n,k = [int(i) for i in input().split()] a = [int(i) for i in input().split()] result="POSSIBLE" flag=True loop=True if k > max(a):    loop=False    flag=False    result="IMPOSSIBLE" if k % 2 == 1:    loop=False    flag=False    result="IMPOSSIBLE"    for i in r...
s691635528
p03651
u136090046
1521055987
Python
Python (3.4.3)
py
Runtime Error
85
14100
294
n, m = map(int, input().split()) array = [int(x) for x in input().split()] res = sorted(array) judge = False tmp = res.pop(0) for i in res: if i%tmp != 0: judge = True break if (len(res) == 0 and tmp != m) or res[-1] < m: judge = False print("POSSIBLE" if judge else "IMPOSSIBLE")
s600701017
p03651
u136090046
1521055602
Python
Python (3.4.3)
py
Runtime Error
85
14252
263
n, m = map(int, input().split()) array = [int(x) for x in input().split()] res = sorted(array) judge = False tmp = res.pop(0) for i in res: if i%tmp != 0: judge = True break if res[-1] < m: judge = False print("POSSIBLE" if judge else "IMPOSSIBLE")
s163554549
p03651
u136090046
1521055022
Python
Python (3.4.3)
py
Runtime Error
34
7856
222
n, m = map(int, input().split()) array = [int(x) for x in range(n)] res = sorted(array) judge = False tmp = res.pop(0) for i in res: if i%tmp != 0: judge = True break print("POSSIBLE" if judge else "IMPOSSIBLE")
s614087313
p03651
u636387751
1521049248
Python
Python (3.4.3)
py
Runtime Error
115
14224
360
N, K = map(int, input().split()) A = list(map(int, input().split())) A = sorted(A) if A[N-1] < K: print("IMPOSSIBLE") exit() min_A = A[0] for i in range(1,N): min_A = min(min_A,A[i]-A[i-1]) for j in range(N): if A[j]%min_A != 0: print("POSSIBLE") exit() if K % min_A == 0: print("P...
s965151913
p03651
u926678805
1520366117
Python
Python (3.4.3)
py
Runtime Error
73
14252
294
# coding: utf-8 # Your code here! def gcd(a,b): while b: a,b=b,a%b return a n,k=map(int,input().split()) a=list(map(int,input().split())) g=gcd(a[0],a[1]) mx=max(a) for i in range(2,n): g=gcd(g,a[i]) if k%g==0 and k<=mx: print('POSSIBLE') else: print('IMPOSSIBLE')
s214371616
p03651
u821802586
1518838652
Python
Python (3.4.3)
py
Runtime Error
48
14612
215
import math import functools n, k = map(int, input().split()) a = list(map(int, input().split())) g = functools.reduce(math.gcd, a) if max(a) >= k and k % g == 0: print('POSSIBLE') else: print('IMPOSSIBLE')
s310709004
p03651
u846552659
1508261685
Python
Python (3.4.3)
py
Runtime Error
48
14592
235
# -*- coding:utf-8 -*- import functools, math N, K = map(int, input().split()) A = list(map(int, input().split())) a = functools.reduce(math.gcd, A) b = max(A) if K%a == 0 and K <= b: print("POSSIBLE") else: print("IMPOSSIBLE")
s869273427
p03651
u594567187
1508103793
Python
Python (3.4.3)
py
Runtime Error
45
14252
279
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")
s077103150
p03651
u594567187
1508103637
Python
PyPy3 (2.4.0)
py
Runtime Error
222
58452
279
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")
s251603649
p03651
u227888331
1507432767
Python
Python (3.4.3)
py
Runtime Error
87
14224
322
def gcd(a, b): if (b == 0): return a return gcd(b, a % b) input1 = list(map(int,input("").split(" "))) A = list(map(int,input("").split(" "))) N = input1[0] K = input1[1] temp = A[0] for i in range(1,N): temp = gcd(temp,A[i]) if K <= max(A) and K % G == 0: print('POSSIBLE') else: print('IMPOSSIBLE...
s167791703
p03651
u227888331
1507157434
Python
Python (3.4.3)
py
Runtime Error
129
14224
433
def gcd(a, b): if (b == 0): return a return gcd(b, a % b) input1 = list(map(int,input("").split(" "))) A = list(map(int,input("").split(" "))) N = input1[0] K = input1[1] A.sort() if K in A: flag = True elif K > max(A): flag = False else: temp = A[0] for i in range(1,N): temp = gcd(temp,A[i]) if...
s716023395
p03651
u227888331
1507157404
Python
Python (3.4.3)
py
Runtime Error
17
3060
445
def gcd(a, b): if (b == 0): return a return gcd(b, a % b) def gcd() input1 = list(map(int,input("").split(" "))) A = list(map(int,input("").split(" "))) N = input1[0] K = input1[1] A.sort() if K in A: flag = True elif K > max(A): flag = False else: temp = A[0] for i in range(1,N): temp = gcd(te...
s989445814
p03651
u227888331
1507155732
Python
Python (3.4.3)
py
Runtime Error
82
14252
395
input1 = list(map(int,input("").split(" "))) A = list(map(int,input("").split(" "))) N = input1[0] K = input1[1] A.sort() if K in A: flag = True elif K > max(A): flag = False else: flag = True for i in range(N-3): if abs(A[i]-A[i+1])%abs(A[i+2]-A[i+1]) != 0 or abs(A[i+2]-A[i+1])%abs(A[i]-A[i+1]) != 0: flag = F...
s676846099
p03651
u227888331
1507155174
Python
Python (3.4.3)
py
Runtime Error
18
2940
343
input1 = list(map(int,input("").split(" "))) A = list(map(int,input("").split(" "))) N = input1[0] K = input1[1] if K in A: flag = True elif K > max(A): flag = False else flag = True for i in range(N-3): if abs(A[i]-A[i+1]) != abs(A[i+2]-A[i+1]): flag = False break if flag==True: print('POSSIBLE') els...
s463112242
p03651
u227888331
1507154864
Python
Python (3.4.3)
py
Runtime Error
82
14224
300
input1 = list(map(int,input("").split(" "))) A = list(map(int,input("").split(" "))) N = input1[0] K = input1[1] flag = True for i in range(N-3): if abs(A[i]-A[i+1]) != abs(A[i+2]-A[i+1]): flag = False break if K in A: flag = true if flag==True: print('POSSIBLE') else: print('IMPOSSIBLE')
s230181235
p03651
u227888331
1507154547
Python
Python (3.4.3)
py
Runtime Error
89
14252
271
input1 = list(map(int,input("").split(" "))) A = list(map(int,input("").split(" "))) N = input1[0] K = input1[1] flag = True for i in range(N-3): if abs(A[i]-A[i+1]) != abs(A[i+2]-A[i+1]): flag = False break if flag==True: print(POSSIBLE) else: print(IMPOSSIBLE)
s534578367
p03651
u227888331
1507154397
Python
Python (3.4.3)
py
Runtime Error
42
14224
265
input1 = list(map(int,input("").split(" "))) A = list(map(int,input("").split(" "))) N = input1[0] K = input1[1] flag = true for i in range(N-3): if abs(A[i]-A[i+1]) != abs(A[i+2]-A[i+1]): flag = false break if flag: print(POSSIBLE) else: print(IMPOSSIBLE)
s793556927
p03651
u717533711
1505351005
Python
Python (3.4.3)
py
Runtime Error
17
3064
376
from math import gcd def solve(): n, k = list(map(int, input().strip().split())) a = list(map(int, input().strip().split())) m = a[0] maxx = a[0] for i in range(1, n): m = gcd(m, a[i]) if a[i] > maxx: maxx = a[i] if k % m == 0 and k <= maxx: return "POSSIBL...
s119765200
p03651
u717533711
1505350843
Python
PyPy3 (2.4.0)
py
Runtime Error
171
38640
376
from math import gcd def solve(): n, k = list(map(int, input().strip().split())) a = list(map(int, input().strip().split())) m = a[0] maxx = a[0] for i in range(1, n): m = gcd(m, a[i]) if a[i] > maxx: maxx = a[i] if k % m == 0 and k <= maxx: return "POSSIBL...
s504191858
p03651
u327466606
1501651766
Python
Python (3.4.3)
py
Runtime Error
17
3060
235
from math import gcd N,K = map(int,input().split()) A = list(map(int,input().split())) if K > max(A): print('IMPOSSIBLE') exit() d = A[0] for a in A: d = gcd(d,a) if K % d == 0: print('POSSIBLE') else: print('IMPOSSIBLE')
s192619637
p03651
u830580569
1501443668
Python
Python (2.7.6)
py
Runtime Error
53
11832
292
def get_difference(): # get input from raw_input() n, k = map(int, raw_input().split(' ')) l = [int(e) for e in raw_input().split(' ')] gcd_v = reduce(gcd, l) if not k % gcd_v and k <= max(l): print "POSSIBLE" else: print "IMPOSSIBLE" if __name__ == "__main__": get_difference()
s537398101
p03651
u830580569
1501443148
Python
Python (2.7.6)
py
Runtime Error
59
11832
498
def get_difference(): # get input from raw_input() n, k = map(int, raw_input().split(' ')) l = [int(e) for e in raw_input().split(' ')] if n < 1: print "IMPOSSIBLE" return if n == 1: if l[0] == k: print "POSSIBLE" else: print "IMPOSSIBLE" return if k in l: print "POSSIBLE" return if k > max(l...
s631567838
p03651
u830580569
1501442215
Python
Python (2.7.6)
py
Runtime Error
56
11832
504
def get_difference(): # get input from raw_input() n, k = map(int, raw_input().split(' ')) l = [int(e) for e in raw_input().split(' ')] if n < 1: print "IMPOSSIBLE" return if n == 1: if l[0] == k: print "POSSIBLE" else: print "IMPOSSIBLE" return if k in l: print "POSSIBLE" return if k > max(l...
s426616578
p03651
u830580569
1501283789
Python
Python (2.7.6)
py
Runtime Error
61
11832
356
def get_difference(): # get input from raw_input() n, k = map(int, raw_input().split(' ')) l = [int(e) for e in raw_input().split(' ')] if k in l: print "POSSIBLE" return if k>max(l): print "IMPOSSIBLE" return gcd_v = reduce(gcd, l) if k%gcd_v==0: print "POSSIBLE" else: print "IMPOSSIBLE" if __nam...
s138747225
p03651
u830580569
1501283633
Python
Python (2.7.6)
py
Runtime Error
56
11832
356
def get_difference(): # get input from raw_input() n, k = map(int, raw_input().split(' ')) l = [int(e) for e in raw_input().split(' ')] if k in l: print "POSSIBLE" return if k>max(l): print "INPOSSIBLE" return gcd_v = reduce(gcd, l) if k%gcd_v==0: print "POSSIBLE" else: print "INPOSSIBLE" if __nam...
s061437430
p03651
u594567187
1500962767
Python
Python (2.7.6)
py
Runtime Error
48
4904
288
import fractions 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 = fractions.gcd(gcd,ball[i]) if target % gcd == 0 and target <= max(ball): print("POSSIBLE") else: print("IMPOSSIBLE")
s723510724
p03651
u594567187
1500962069
Python
Python (2.7.6)
py
Runtime Error
11
2692
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")
s018125081
p03651
u594567187
1500961954
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")
s557802456
p03651
u594567187
1500956668
Python
Python (3.4.3)
py
Runtime Error
44
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")