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
s257635816
p03651
u097317219
1582686373
Python
PyPy3 (2.4.0)
py
Runtime Error
185
38384
255
import functions n,k = map(int,input().split()) a = sorted(list(map(int,input().split()))) a_max = max(a) a_gcd = a[0] for i in range(n): a_gcd = functions.gcd(a_gcd,a[i]) if k <= a_max and k % a_gcd == 0: print("POSSIBLE") else: print("IMPOSSIBLE")
s070339017
p03651
u993435350
1582607406
Python
Python (3.4.3)
py
Runtime Error
107
14108
298
N,K = map(int,input().split()) A = sorted(list(map(int,input().split())),reverse = True) diff = [0] * (N - 1) for i in range(N - 1): diff[i] = A[i] - A[i + 1] if K > A[0]: print("IMPOSSIBLE") elif len(set(diff)) == 1 and A[0] % diff[0] == 0: print("IMPOSSIBLE") else: print("POSSIBLE")
s735328270
p03651
u970197315
1582347190
Python
Python (3.4.3)
py
Runtime Error
254
16052
1083
# A - Getting Difference from fractions import gcd n,k=map(int,input().split()) a=list(map(int,input().split())) for i in range(n-1): if i==0: t=gcd(a[i],a[i+1]) continue t=gcd(t,a[i+1]) if k%t!=0: print('IMPOSSIBLE') exit() a_max=max(a) b=a_max-k if b<0: print('IMPOSSIBLE') e...
s159894303
p03651
u970197315
1582346972
Python
Python (3.4.3)
py
Runtime Error
234
16276
1051
# A - Getting Difference from fractions import gcd n,k=map(int,input().split()) a=list(map(int,input().split())) for i in range(n-1): if i==0: t=gcd(a[i],a[i+1]) continue t=gcd(t,a[i+1]) if k%t!=0: print('IMPOSSIBLE') exit() a_max=max(a) b=a_max-k if b<0: print('IMPOSSIBLE') e...
s871801046
p03651
u970197315
1582346700
Python
Python (3.4.3)
py
Runtime Error
221
14100
1051
# A - Getting Difference def gcd(x, y): while y != 0: x, y = y, x % y return x n,k=map(int,input().split()) a=list(map(int,input().split())) for i in range(n-1): if i==0: t=gcd(a[i],a[i+1]) continue t=gcd(t,a[i+1]) if k%t!=0: print('IMPOSSIBLE') exit() a_max=max(a) b=a_...
s935499458
p03651
u167681750
1581895736
Python
Python (3.4.3)
py
Runtime Error
48
14108
211
n, k = map(int, input().split()) a = list(map(int, input().split())) from functools import reduce from math import gcd g = reduce(gcd, a) print('POSSIBLE' if (k % g == 0) and (k <= sum(a)) else 'IMPOSSIBLE')
s612642933
p03651
u987164499
1580604875
Python
Python (3.4.3)
py
Runtime Error
44
15020
382
from sys import stdin import math n,k = [int(x) for x in stdin.readline().rstrip().split()] li = list(map(int,stdin.readline().rstrip().split())) if k > li[0]: print("IMPOSSIBLE") exit() def gcd_all(list): return gcd_all([math.gcd(*list[:2])] + list[2:]) if len(list) > 1 else list[0] gcd = gcd_all(li) if k%...
s564924983
p03651
u594567187
1579897695
Python
Python (3.4.3)
py
Runtime Error
84
14252
534
import math length, target = map(int, input().split(" ")) nums = sorted([int(n) for n in input().split(" ")]) minimum = min(nums) odd, even, gcd = 0, 0, minimum for n in nums: if n % 2 == 0: even = 1 else: odd = 1 gcd = math.gcd(gcd, n) if target > max(nums): print("IMPOSSIBLE") elif tar...
s048135464
p03651
u183896397
1578455177
Python
Python (3.4.3)
py
Runtime Error
129
16056
334
import fractions n,k = map(int,input().split()) a = list(map(int,input().split())) a.sort() mx = a[-1] if mx < k: ans = 'IMPOSSIBLE' else: gcd = fractions.gcd(a[0],a[1]) for i in range(2,n): gcd = fractions.gcd(gcd,a[i]) if k % gcd == 0: ans = 'POSSIBLE' else: ans = 'IMPOSSIB...
s188310784
p03651
u183896397
1578455069
Python
Python (3.4.3)
py
Runtime Error
145
16296
390
import fractions n,k = map(int,input().split()) a = list(map(int,input().split())) a.sort() mx = a[-1] if mx < k: ans = 'IMPOSSIBLE' else: gcd = fractions.gcd(a[0],a[1]) for i in range(2,n): tmp_gcd = fractions.gcd(gcd,a[i]) if tmp_gcd < gcd: gcd = tmp_gcd if k % gcd == 0: ...
s342590165
p03651
u423585790
1578090353
Python
PyPy3 (2.4.0)
py
Runtime Error
225
58992
1332
#!/usr/bin/env python3 from collections import defaultdict,deque from heapq import heappush, heappop from bisect import bisect_left, bisect_right import sys, random, itertools, math sys.setrecursionlimit(10**5) input = sys.stdin.readline sqrt = math.sqrt def LI(): return list(map(int, input().split())) def LF(): return...
s067845526
p03651
u846634344
1577946293
Python
Python (3.4.3)
py
Runtime Error
825
14556
1165
import sys import copy sys.setrecursionlimit(10**6) if sys.platform in (['ios','darwin','win32']): sys.stdin=open('Untitled.txt') input = sys.stdin.readline def INT(): return int(input()) def MAP(): return [int(s) for s in input().split()] def prime_factor(n): ans = [] for i in range(2,int(n**0.5)+1): ...
s345706883
p03651
u882209234
1577655577
Python
Python (3.4.3)
py
Runtime Error
43
14224
229
N,K = map(int,input().split()) A = list(map(int,input().split())) ans = 'IMPOSSIBLE' if max(A) >= K: from math import gcd from functools import reduce g = reduce(gcd,A) if K % g == 0: ans = 'POSSIBLE' print(ans)
s079573032
p03651
u037430802
1577590940
Python
Python (3.4.3)
py
Runtime Error
17
3064
395
N,K = map(int, input().split()) A = list(map(int, input().split())) A.sort() if A[-1] < K: print("IMPOSSIBLE") exit() if K in A or 1 in A: print("POSSIBLE") exit() def gcd(a,b): x = max([a,b]) y = min([a,b]) while y: x, y = y, x % y return x g = A[0] for i in range(1,N): ...
s873346186
p03651
u305366205
1577497496
Python
Python (3.4.3)
py
Runtime Error
77
15020
225
import math n, k = map(int, input().split()) a = list(map(int, input().split())) a.sort() g = a[0] for i in range(n): g = math.gcd(g, a[i]) if k % g == 0 and k <= a[-1]: print('POSSIBLE') else: print('IMPOSSIBLE')
s706715014
p03651
u799443198
1577473985
Python
Python (3.4.3)
py
Runtime Error
77
14436
454
def gcd(l, r): while r != 0: l, r = r, l % r return l def main(): N, K, *A = map(int, open(0).read().split()) if N == 1: if K == A[0]: print('POSSIBLE') return else: print('IMPOSSIBLE') return g = abs(A[1] - A[0]) for i in range(N-1): g = gcd(g, abs(A[i+1] - A[i])) ...
s783096932
p03651
u799443198
1577473952
Python
Python (3.4.3)
py
Runtime Error
80
14052
449
def gcd(l, r): while r != 0: l, r = r, l % r return l def main(): N, K, *A = map(int, open(0).read().split()) if N == 1: if K == A[0]: print('POSSIBLE') return else: print('IMPOSSIBLE') return g = A[1] - A[0] for i in range(N-1): g = gcd(g, abs(A[i+1] - A[i])) if (...
s203573731
p03651
u799443198
1577473887
Python
Python (3.4.3)
py
Runtime Error
78
14052
444
def gcd(l, r): while r > 0: l, r = r, l % r return l def main(): N, K, *A = map(int, open(0).read().split()) if N == 1: if K == A[0]: print('POSSIBLE') return else: print('IMPOSSIBLE') return g = A[1] - A[0] for i in range(N-1): g = gcd(g, abs(A[i+1] - A[i])) if K ...
s849204792
p03651
u799443198
1577473685
Python
Python (3.4.3)
py
Runtime Error
68
14052
321
def gcd(l, r): while r > 0: l, r = r, l % r return l def main(): N, K, *A = map(int, open(0).read().split()) g = A[1] - A[0] for i in range(N-1): g = gcd(g, A[i+1] - A[i]) if K % g == A[0] % g and K <= max(A): print('POSSIBLE') else: print('IMPOSSIBLE') if __name__ == '__main__': main(...
s634978667
p03651
u768896740
1577464062
Python
Python (3.4.3)
py
Runtime Error
63
14480
1292
n, k = map(int, input().split()) a = list(map(int, input().split())) if max(a) < k: print('IMPOSSIBLE') elif k in a: print('POSSIBLE') else: for i in a: if i %2 == 0: flag_e = True else: flag_o = True if flag_e is True and flag_o is True: for i in a: ...
s302596826
p03651
u557494880
1576708444
Python
Python (3.4.3)
py
Runtime Error
17
2940
268
N,K = map(int(input().split())) A = list(map(int,input().split()))) g = A[0] import fractions for i in range(1,N): g = fractions.gcd(g,A[i]) if K % g == 0: if K <= M: print('POSSIBLE') else: print('IMPOSSIBLE') else: print('IMPOSSIBLE')
s890606622
p03651
u440566786
1576413016
Python
PyPy3 (2.4.0)
py
Runtime Error
166
38384
183
from fractions import gcd n,k=map(int,input().split()) g=0 m=0 for a in map(int,input().split()): m=max(m,a) g=gcd(g,a) print("POSSIBLE" if(k%g==0 and k<=m) else "IMPOSSIBLE")
s354290989
p03651
u440566786
1576412129
Python
PyPy3 (2.4.0)
py
Runtime Error
180
38256
211
from fractions import gcd n,k=map(int,input().split()) g=0 for a in map(int,input().split()): if(k==a): print("POSSIBLE") return g=gcd(g,a) print("POSSIBLE" if(k%g==0) else "IMPOSSIBLE")
s670758041
p03651
u047102107
1576338879
Python
PyPy3 (2.4.0)
py
Runtime Error
359
88172
269
from fractions import gcd N, K = list(map(int, input().split())) A = list(map(int, input().split())) M = max(A) G = gcd(A[0], A[1]) for i in range(2, N): G = gcd(G, A[i]) # print(M, G) if K <= M and K % G == 0: print("POSSIBLE") else: print("IMPOSSIBLE")
s693367830
p03651
u047102107
1576338508
Python
PyPy3 (2.4.0)
py
Runtime Error
222
62704
676
N, K = list(map(int, input().split())) A = list(map(int, input().split())) if K in A: print("POSSIBLE") exit(0) An = A.copy() for i in range(len(A)): for j in range(i + 1, len(A)): aij = abs(A[i] - A[j]) if aij not in An: An.append(aij) if K in A: print("POSSIBLE") exi...
s987822554
p03651
u020390084
1576301467
Python
Python (3.4.3)
py
Runtime Error
59
15140
1054
#!/usr/bin/env python3 import sys YES = "POSSIBLE" # type: str NO = "IMPOSSIBLE" # type: str def solve(N: int, K: int, A: "List[int]"): if K in A: print(YES) return if max(A) < K: print(NO) return ## 互いに素のものが一つでもあれば1が作れるからなんでも作れる→互いにそのものがあるか判定 from math imp...
s202597945
p03651
u349091349
1575934448
Python
Python (3.4.3)
py
Runtime Error
51
14616
295
import math from functools import reduce def gcd_list(numbers): return reduce(math.gcd, numbers) N,K=map(int,input().split()) A=[int(i) for i in input().split()] gcd = gcd_list(A) if K > max(A): print("IMPOSSIBLE") elif K % gcd !=0: print("IMPOSSIBLE") else: print("POSSIBLE")
s562291720
p03651
u349091349
1575934434
Python
PyPy3 (2.4.0)
py
Runtime Error
216
62576
295
import math from functools import reduce def gcd_list(numbers): return reduce(math.gcd, numbers) N,K=map(int,input().split()) A=[int(i) for i in input().split()] gcd = gcd_list(A) if K > max(A): print("IMPOSSIBLE") elif K % gcd !=0: print("IMPOSSIBLE") else: print("POSSIBLE")
s381626277
p03651
u278356323
1574878718
Python
Python (3.4.3)
py
Runtime Error
22
3572
375
#from fractions import gcd from functools import reduce from math import gcd n, k = map(int, input().split()) a = list(map(int, input().split())) if k > max(a): print('IMPOSSIBLE') exit(0) if k in a: print('POSSIBLE') exit(0) def gcds(*numbers): return reduce(gcd, numbers) if k % gcds(*a) == 0:...
s566726824
p03651
u511379665
1574383530
Python
Python (3.4.3)
py
Runtime Error
186
14096
603
n,k=map(int,input().split()) a=list(map(int,input().split())) a.sort() bb=set(a) for i in range(n-1): tm=a[i+1]-a[i] bb.add(tm) cv=list(bb) cv.sort() if k in cv: print("POSSIBLE") exit() if max(cv)<k: print("IMPOSSIBLE") exit() if n==1: if a[0]==k: print("POSSIBLE") else: ...
s531224929
p03651
u511379665
1574383459
Python
Python (3.4.3)
py
Runtime Error
192
14480
578
n,k=map(int,input().split()) a=list(map(int,input().split())) a.sort() bb=set(a) for i in range(n-1): tm=a[i+1]-a[i] bb.add(tm) cv=list(bb) cv.sort() if k in cv: print("POSSIBLE") exit() if max(cv)<k: print("IMPOSSIBLE") exit() if n==1: if a[0]==k: print("POSSIBLE") else: ...
s952267472
p03651
u061912210
1573796686
Python
Python (3.4.3)
py
Runtime Error
180
25012
346
import numpy as np import sys import math from functools import reduce import fractions def gcd(*numbers): return reduce(math.gcd, numbers) n,k = map(int,input().split()) a = list(map(int,input().split())) c = fractions.gcd(*a) for i in a: if i - k > 0 and (i-k) % c == 0: print("POSSIBLE") sys.exit() ...
s066210017
p03651
u061912210
1573795770
Python
Python (3.4.3)
py
Runtime Error
214
23128
284
import numpy as np import sys n,k = map(int,input().split()) a = list(map(int,input().split())) b = [] for i in range(len(a) - 1): b.append(abs(a[i]-a[i+1])) c = int(np.min(b)) for i in a: if abs(i-k) % c == 0: print("POSSIBLE") sys.exit() print("IMPOSSIBLE")
s807667372
p03651
u061912210
1573795673
Python
Python (3.4.3)
py
Runtime Error
315
23080
279
import numpy as np import sys n,k = map(int,input().split()) a = list(map(int,input().split())) b = [] for i in range(len(a) - 1): b.append(abs(a[i]-a[i+1])) c = np.min(b) for i in a: if abs(i-k) % c == 0: print("POSIIBLE") sys.exit() print("IMPOSIIBLE")
s841459482
p03651
u779455925
1573685673
Python
Python (3.4.3)
py
Runtime Error
80
14252
233
N,K=map(int,input().split()) A=sorted(list(map(int,input().split()))) if K in A: print("POSSIBLE") exit() s=A[1]-A[0] for i in range(1,N-1): if A[i+1]-A[i]!=s: print("POSSIBLE") exit() print("IMPOSSIBLE")
s007533945
p03651
u905203728
1573503625
Python
Python (3.4.3)
py
Runtime Error
17
3060
240
from math import gcd def gcd_list(A): num=A[0] for i in A: num=gcd(num,i) return num n,k=map(int,input().split()) A=list(map(int,input().split())) print("POSSIBLE" if k%gcd_list(A)==0 and k<=max(A) else "IMPOSSIBLE")
s745245828
p03651
u905203728
1573503450
Python
Python (3.4.3)
py
Runtime Error
48
14604
223
import math from functools import reduce def gcd_list(A): return reduce(math.gcd,A) n,k=map(int,input().split()) A=list(map(int,input().split())) print("POSSIBLE" if k%gcd_list(A)==0 and k<=max(A) else "IMPOSSIBLE")
s083948339
p03651
u314050667
1573482806
Python
Python (3.4.3)
py
Runtime Error
92
14224
404
import sys N, K = map(int, input().split()) A = list(map(int, input().split())) maxA = max(A) if K > maxA: print("IMPOSSIBLE") sys.exit() def GCD(a,b): if b == 0: return a return GCD(b,a%b) for i in range(1,N): if i == 1: temp = GCD(A[0],A[1]) else: temp = GCD(temp, A[i]) if temp == 1: ans = "POSSIBLE"...
s342985338
p03651
u861962192
1573443323
Python
Python (3.4.3)
py
Runtime Error
60
16068
290
def main(): import fractions def gcd(li): fractions.reduce(fractions.gcd, li) n, k, *a = map(int, open(0).read().split()) g = gcd(a) if max(a)>=k and k%g==0: print("POSSIBLE") else: print("IMPOSSIBLE") if __name__ == "__main__": main()
s031389950
p03651
u754022296
1572933299
Python
Python (3.4.3)
py
Runtime Error
119
14224
308
n, k = map(int, input().split()) a = sorted(list(map(int, input().split()))) c = float("inf") for i in range(n-1): c = min(c, a[i+1]-a[i]) if c == 1: break if k > a[-1]: print("IMPOSSIBLE") else: kr = k%c for i in a: if kr == i%c: print("POSSIBLE") exit() print("IMPOSSIBLE")
s761003891
p03651
u754022296
1572932670
Python
PyPy3 (2.4.0)
py
Runtime Error
244
62704
307
n, k = map(int, input().split()) a = sorted(list(map(int, input().split()))) c = float("inf") for i in range(n-1): c = min(c, a[i+1]-a[i]) if c == 1: break if k > a[-1]: print("IMPOSSIBLE") else: kr = k%c for i in a: if kr == i%c: print("POSSIBLE") exit() print("IMPOSSIBLE")
s302918464
p03651
u521866787
1572137834
Python
PyPy3 (2.4.0)
py
Runtime Error
310
88172
188
from fractions import gcd n, k = map(int,input().split()) a = list(map(int,input().split())) agcd = gcd(*a) if max(a) > k and k%agcd ==0: print('POSSIBLE') else: print('IMPOSSIBLE')
s666744333
p03651
u828766688
1572053154
Python
Python (3.4.3)
py
Runtime Error
138
16276
310
import fractions N,K = map(int,input().split()) A = list(map(int,input().split())) A.sort() for i in range(N-1): if i == 0: now = fractions.gcd(A[0],A[1]) else: now = fractions.gcd(now,A[i+1]) if K % now == 0 and K <= A[-1]: print ("POSSIBLE") else: print ("IMPOSSIBLE")
s206189211
p03651
u518042385
1571861433
Python
Python (3.4.3)
py
Runtime Error
42
14236
361
n,k=map(int,input().split()) l=list(map(int,input().split())) def gcd(n,m): a=max(n,m) b=min(n,m) while b!=0: a,b=b,a%b return a g=l[0] max=l[0] for i in range(1,1+n-1): g=gcd(g,l[i]) if max<l[i]: max=l[i] if max<k: print("POSSIBLE") elif max==k: print("POSSIBLE") else: if k%g==0: print("P...
s192368106
p03651
u027929618
1570423630
Python
Python (3.4.3)
py
Runtime Error
17
3064
299
from math import gcd n,k=map(int,input().split()) A=list(map(int,input().split())) ans="" if max(A)<k: ans="IMPOSSIBLE" elif k in A: ans="POSSIBLE" else: g=gcd(A[0], A[1]) for i in range(2,n): g=gcd(g,A[i]) if g!=0 and k%g==0: ans="POSSIBLE" else: ans="IMPOSSIBLE" print(ans)
s663416514
p03651
u391630195
1569642817
Python
PyPy3 (2.4.0)
py
Runtime Error
213
62576
321
n,k=map(int,input().split()) lista = [int(i) for i in input().split()] import functools #from functools import reduce import math #from math import gcd gcda=functools.reduce(math.gcd, lista) if k>max(lista): print("IMPOSSIBLE") else: if k%gcda==0: print("POSSIBLE") else: print("IMPOSSIBLE"...
s260701274
p03651
u391630195
1569642584
Python
PyPy3 (2.4.0)
py
Runtime Error
214
62576
285
n,k=map(int,input().split()) lista = [int(i) for i in input().split()] from functools import reduce from math import gcd gcda=functools.reduce(gcd, lista) if k>max(lista): print("IMPOSSIBLE") else: if k%gcda==0: print("POSSIBLE") else: print("IMPOSSIBLE")
s323933921
p03651
u509368316
1569295195
Python
Python (3.4.3)
py
Runtime Error
17
2940
189
N,K=map(int,input().split()) A=list(map(int,input().split())) from fractions import gcd g=A[0] for a in A[1:]: g=gcd(g,a) print(['IMPOSSIBLE','POSSIBLE'][(g==1 or K%g==0) and max(A)>=K]
s520134995
p03651
u509368316
1569295118
Python
Python (3.4.3)
py
Runtime Error
17
3060
190
N,K=map(int,input().split()) A=list(map(int,input().split())) from fractions import gcd g=A[0] for a in A[1:]: g=gcd(g,a) print(['IMPOSSIBLE','POSSIBLE'][((g==1 or K%g==0) and max(A)>=K)
s173727709
p03651
u798818115
1569245839
Python
Python (3.4.3)
py
Runtime Error
51
14608
288
# coding: utf-8 # Your code here! import math from functools import reduce N,K=map(int,input().split()) l=list(map(int,input().split())) if max(l)<K: print("IMPOSSIBLE") else: if K%functools.reduce(math.gcd, l)==0: print("POSSIBLE") else: print("IMPOSSIBLE")
s328642552
p03651
u798818115
1569245671
Python
Python (3.4.3)
py
Runtime Error
49
14608
278
# coding: utf-8 # Your code here! import math from functools import reduce N,K=map(int,input().split()) l=list(map(int,input().split())) if max(l)<K: print("IMPOSSIBLE") else: if K%reduce(math.gcd, l)==0: print("POSSIBLE") else: print("IMPOSSIBLE")
s440047413
p03651
u798818115
1569243838
Python
PyPy3 (2.4.0)
py
Runtime Error
218
62576
712
# coding: utf-8 # Your code here! N,K=map(int,input().split()) l=list(map(int,input().split())) if max(l)<K: print("IMPOSSIBLE") exit() temp=[] prev_l=[-1] while prev_l!=l: #temp <=> l temp.clear() prev_l.clear() prev_l=prev_l+l for i in range(len(l)-1): for j in range(i+1,len(l)): ...
s186465376
p03651
u256464928
1569038903
Python
Python (3.4.3)
py
Runtime Error
132
16056
323
import fractions N,K = map(int,input().split()) A = sorted(list(map(int,input().split())))[::-1] #print(A) if A[0] < K: print("IMPOSSIBLE") exit() else: G = fractions.gcd(A[0],A[1]) for g in range(2,N): G = fractions.gcd(G,A[g]) print(G) if K % G != 0: print("IMPOSSIBLE") exit() print("POSSIBLE"...
s393174979
p03651
u256464928
1569038684
Python
Python (3.4.3)
py
Runtime Error
131
16240
335
import fractions N,K = map(int,input().split()) A = sorted(list(map(int,input().split())))[::-1] #print(A) if A[0] < K: print("IMPOSSIBLE") exit() else: G = fractions.gcd(A[0],A[1]) for g in range(1,N): G = fractions.gcd(G,A[g]) print(G) if K % G != 0: print("IMPOSSIBLE") exit() print("POSSIBLE"...
s585174228
p03651
u672220554
1568992704
Python
Python (3.4.3)
py
Runtime Error
98
16240
390
import fractions n,k = map(int,input().split()) a = list(map(int,input().split())) if k > max(a): print("IMPOSSIBLE") else: minak = min(a) gcda = fractions.gcd(a[0],a[1]) for i in range(0,n): gcda = fractions.gcd(gcda,a[i]) if gcda ==1: break if gcda == 1 or k % gcda...
s216180731
p03651
u672220554
1568992299
Python
Python (3.4.3)
py
Runtime Error
96
16208
398
import fractions n,k = map(int,input().split()) a = list(map(int,input().split())) if k > max(a): print("IMPOSSIBLE") else: minak = min(a) gcda = fractions.gcd(a[0],a[1]) for i in range(0,n): gcda = fractions.gcd(gcda,a[i]) if gcda ==1: break if gcda == 1 or (k-minak...
s674316632
p03651
u672220554
1568992244
Python
Python (3.4.3)
py
Runtime Error
17
2940
400
import fractions n,k = map(int,input().split()) a = list(map(int,input().split())) if k > max(a): print("IMPOSSIBLE") else: minak = min(a) gcda = fractions.gcd(a[0],a[1]) for i in range(0,n): gcda = fractions.gcd(gcda,a[i]) if gcda ==1: break elif gcda == 1 or (k-min...
s407269345
p03651
u672220554
1568991428
Python
Python (3.4.3)
py
Runtime Error
99
16212
566
import fractions n,k = map(int,input().split()) a = list(map(int,input().split())) if k > max(a): print("IMPOSSIBLE") else: minak = min(a) for i in range(0,n): a[i] -= minak gcda = fractions.gcd(a[0],a[1]) for i in range(0,n): gcda = fractions.gcd(gcda,a[i]) if gcda ==1: ...
s617406502
p03651
u672220554
1568991186
Python
Python (3.4.3)
py
Runtime Error
100
16244
460
import fractions n,k = map(int,input().split()) a = list(map(int,input().split())) if k > max(a): print("IMPOSSIBLE") else: minak = min(a) for i in range(0,n): a[i] -= minak gcda = fractions.gcd(a[0],a[1]) for i in range(0,n): gcda = fractions.gcd(gcda,a[i]) if gcda ==1: ...
s013110680
p03651
u672220554
1568991096
Python
Python (3.4.3)
py
Runtime Error
100
16244
487
import fractions n,k = map(int,input().split()) a = list(map(int,input().split())) if k > max(a): print("IMPOSSIBLE") else: minak = min(a) for i in range(0,n): a[i] -= minak gcda = fractions.gcd(a[0],a[1]) for i in range(0,n): gcda = fractions.gcd(gcda,a[i]) if gcda ==1: ...
s601472540
p03651
u672220554
1568990787
Python
Python (3.4.3)
py
Runtime Error
101
16244
449
import fractions n,k = map(int,input().split()) a = list(map(int,input().split())) if k > max(a): print("IMPOSSIBLE") else: minak = min(a) for i in range(0,n): a[i] -= minak gcda = fractions.gcd(a[0],a[1]) for i in range(0,n): gcda = fractions.gcd(gcda,a[i]) if gcda ==1: ...
s989442945
p03651
u923712635
1568433044
Python
Python (3.4.3)
py
Runtime Error
64
16060
278
import fractions from functools import reduce def gcd_list(numbers): return reduce(math.gcd, numbers) N,K = [int(x) for x in input().split()] A = [int(x) for x in input().split()] x = gcd_list(A) if(K%x==0 and max(A)>=K): print('POSSIBLE') else: print('IMPOSSIBLE')
s599333110
p03651
u923712635
1568432647
Python
Python (3.4.3)
py
Runtime Error
63
16120
284
import fractions from functools import reduce def gcd_list(numbers): return reduce(math.gcd, numbers) N,K = [int(x) for x in input().split()] A = [int(x) for x in input().split()] x = gcd_list(A) if(K%x==0 and max(A)-min(A)>K): print('POSSIBLE') else: print('IMPOSSIBLE')
s428541582
p03651
u923712635
1568432629
Python
Python (3.4.3)
py
Runtime Error
51
14892
279
import math from functools import reduce def gcd_list(numbers): return reduce(math.gcd, numbers) N,K = [int(x) for x in input().split()] A = [int(x) for x in input().split()] x = gcd_list(A) if(K%x==0 and max(A)-min(A)>K): print('POSSIBLE') else: print('IMPOSSIBLE')
s472255170
p03651
u814986259
1568329946
Python
Python (3.4.3)
py
Runtime Error
134
14636
836
import collections N, K = map(int, input().split()) A = list(map(int, input().split())) if K in A: print("POSSIBLE") exit(0) else: diff = collections.defaultdict(int) A.sort() idx = N - 1 if K > A[-1]: print("IMPOSSIBLE") exit(0) else: for i in range(N-1): ...
s844408132
p03651
u814986259
1568329658
Python
Python (3.4.3)
py
Runtime Error
136
14636
747
import collections N, K = map(int, input().split()) A = list(map(int, input().split())) if K in A: print("POSSIBLE") else: diff = collections.defaultdict(int) A.sort() idx = N - 1 if K > A[-1]: print("IMPOSSIBLE") else: for i in range(N-1): if A[i] > K and idx == N - ...
s064925775
p03651
u814986259
1568329625
Python
Python (3.4.3)
py
Runtime Error
132
14636
773
import collections N, K = map(int, input().split()) A = list(map(int, input().split())) if K in A: print("POSSIBLE") else: diff = collections.defaultdict(int) A.sort() idx = N - 1 if K > A[-1]: print("IMPOSSIBLE") else: for i in range(N-1): if A[i] > K and idx == N - ...
s012065384
p03651
u707870100
1567111553
Python
Python (3.4.3)
py
Runtime Error
104
14228
451
# -*- coding: utf-8 -*- #AGC014A import sys #import collections #n= int(input()) tmp = input().split() n,k = list(map(lambda a: int(a), tmp)) tmp = input().split() a = list(map(lambda a: int(a), tmp)) def gcd(a, b): while b: a, b = b, a % b return a maxa=a[0] tmp=a[0] for i in range(1,n): maxa=max...
s188080284
p03651
u366959492
1567015584
Python
PyPy3 (2.4.0)
py
Runtime Error
212
62576
464
n,k=map(int,input().split()) a=list(map(int,input().split())) def gcd(x,y): if x==y: return x elif x>y: r=-1 while r!=0: r=x%y x=y y=r return x else: r=-1 while r!=0: r=y%x y=x x=r ...
s869976445
p03651
u366959492
1567015118
Python
PyPy3 (2.4.0)
py
Runtime Error
251
63520
330
n,k=map(int,input().split()) a=list(map(int,input().split())) if k>max(a): print("IMPOSSIBLE") exit() sa=float("inf") a.sort() b=[abs(a[0]-k)] for i in range(1,n): sa=min(sa,abs(a[i]-a[i-1])) b.append(abs(a[i]-k)) f=0 for i in range(n): if b[i]%sa==0: f=1 print("POSSIBLE" if f else "IMP...
s593773436
p03651
u114954806
1566943243
Python
Python (3.4.3)
py
Runtime Error
88
14252
289
N,K=map(int,input().split()) A=list(map(int,input().split())) def gcd(a,b): if b==0: return a return gcd(b, a%b) element=gcd(A[0], A[1]) if N!=2: for _ in range(2, N): element=gcd(element, A[_]) print("POSSIBLE" if K%element==0 and max(A)>=K else "IMPOSSIBLE")
s337017428
p03651
u473291366
1566929898
Python
Python (3.4.3)
py
Runtime Error
133
14224
499
N, K = map(int,input().split()) A = list(map(int,input().split())) A.sort() max_a = -1 min_diff = K for i in range(N): a = A[i] if a == K: print("POSSIBLE") exit() if a > max_a: max_a = a if i < N-1: diff = A[i+1]-A[i] if diff < min_diff: min_diff = d...
s813295554
p03651
u312025627
1566850908
Python
PyPy3 (2.4.0)
py
Runtime Error
238
62576
587
def main(): n, k = (int(i) for i in input().split()) a = [int(i) for i in input().split()] a.sort() diff_min = a[-1] - a[-2] l_diff = set() for i in range(n-1): diff = abs(a[i] - a[i+1]) diff_min = (min(diff_min,diff) if diff != 0 else diff_min) for i in range(n): dif...
s744124503
p03651
u312025627
1566850867
Python
PyPy3 (2.4.0)
py
Runtime Error
230
62576
585
def main(): n, k = (int(i) for i in input().split()) a = [int(i) for i in input().split()] a.sort() diff_min = a[-1] - a[-2] l_diff = set() for i in range(n-1): diff = abs(a[i] - a[i+1]) diff_min = (min(diff_min,diff) if diff != 0 else diff_min) for i in range(n): dif...
s927027049
p03651
u312025627
1566850601
Python
PyPy3 (2.4.0)
py
Runtime Error
235
62576
652
def main(): n, k = (int(i) for i in input().split()) a = [int(i) for i in input().split()] a.sort() diff_min = a[-1] - a[-2] l_diff = set() for i in range(n-1): diff = abs(a[i] - a[i+1]) diff_min = (min(diff_min,diff) if diff != 0 else diff_min) l_diff.add(diff_min) f...
s905796437
p03651
u312025627
1566839134
Python
PyPy3 (2.4.0)
py
Runtime Error
249
63216
333
n, k = (int(i) for i in input().split()) a = [int(i) for i in input().split()] a.sort() diff_min = 10*9 + 7 for i in range(n-1): diff = abs(a[i] - a[i+1]) diff_min = min(diff_min,diff) for i in range(n): if a[i] - k >= 0 and (a[i] - k)%diff_min == 0: print("POSSIBLE") break else: print(...
s869666578
p03651
u820047642
1565897821
Python
Python (3.4.3)
py
Runtime Error
18
2940
379
from fractions import gcd from bisect import bisect_right n,k=map(int,input().split()) A=list(map(int,input().split())) A.sort() if k>A[n-1]:ans=-1 elif k=A[n-1]:ans=1 else: a=A[0] for i in range(1,n): a=gcd(a,A[i]) m=A[bisect_right(A,k)] if (m-k)%a==0: ans=1 else: ans=-1 if ...
s379543008
p03651
u820047642
1565897651
Python
Python (3.4.3)
py
Runtime Error
126
16280
359
from fractions import gcd from bisect import bisect_right n,k=map(int,input().split()) A=list(map(int,input().split())) A.sort() if k>A[n-1]:ans=-1 else: a=A[0] for i in range(1,n): a=gcd(a,A[i]) m=A[bisect_right(A,k)] if (m-k)%a==0: ans=1 else: ans=-1 if ans==1: print("P...
s009937681
p03651
u177756077
1564626732
Python
Python (3.4.3)
py
Runtime Error
92
15020
330
import math N,K=map(int,input().split()) A=list(map(int,input().split())) A=list(set(A)) N=len(A) A.sort() g=A[0] for i in range(N-1): g=math.gcd(g,A[i+1]) #tmp=0 #ans="POSSIBLE" #for i in range(N): # tmp+=A[i]%g if g==1 and K<=A[-1]: ans="POSSIBLE" else: ans="IMPOSSIBLE" if N==1: ans="POSSIBLE" ...
s290887588
p03651
u177756077
1564625402
Python
Python (3.4.3)
py
Runtime Error
116
14480
241
N,K=map(int,input().split()) A=list(map(int,input().split())) A=list(set(A)) N=len(A) A.sort() tmp=0 for i in range(N-1): tmp+=A[i+1]%A[0] if tmp>0 and K<=A[-1]: pass else: ans="IMPOSSIBLE" if N==1: ans="POSSIBLE" print(ans)
s680994755
p03651
u882620594
1564585439
Python
PyPy3 (2.4.0)
py
Runtime Error
230
62576
519
def gcd(a, b): if b == 0: return a if a <= b: temp = a a = b b = temp r = a % b if r == 0: return b else: return gcd(b, r) N, K = map(int,input().split()) A = list(map(int,input().split())) #Aの最大公約数を作ることが出来る A.sort() if K > A[-1]: print("IMPOSSI...
s256912579
p03651
u865741247
1564352235
Python
Python (3.4.3)
py
Runtime Error
41
15020
296
import math N,K =list(map(int,input().split(" "))) As= list(map(int,input().split(" "))) g = As[0] ma = -1 for a in As: g = math.gcd(g,a) ma = max(ma,a) if K == a: print("POSSIBLE") exit() if K % g == 0 and ma >= K: print("POSSIBLE") else: print("IMPOSSIBLE")
s262250213
p03651
u223646582
1563730099
Python
Python (3.4.3)
py
Runtime Error
183
23060
203
import numpy as np N, K = map(int, input().split()) A = [int(i) for i in input().split()] G = np.gcd.reduce(A) M = max(A) if K % G == 0 and K <= M: print('POSSIBLE') else: print('IMPOSSIBLE')
s613239590
p03651
u035605655
1563229047
Python
Python (3.4.3)
py
Runtime Error
48
14224
234
N, K = map(int, input().split()) A = list(map(int, input().split())) import math import functools gcd = functools.reduce(math.gcd, A) A_max = max(A) if (A_max >= K and K % gcd == 0): print('POSSEBLE') else: print('IMPOSSIBLE')
s340345585
p03651
u035605655
1563228985
Python
Python (3.4.3)
py
Runtime Error
47
14252
245
N, K = map(int, input().split()) A = list(map(int, input().split())) import math import functools gcd = functools.reduce(math.gcd, A) print(gcd) A_max = max(A) if (A_max >= K and K % gcd == 0): print('POSSEBLE') else: print('IMPOSSIBLE')
s467998448
p03651
u677523557
1562966571
Python
Python (3.4.3)
py
Runtime Error
111
14224
400
N, K = map(int, input().split()) # 横に2個 A = list(map(int, input().split())) A.sort(reverse=True) dif = [] for i in range(N-1): d = A[i] - A[i+1] if d != 0: dif.append(d) mind = min(dif) ans = 'IMPOSSIBLE' for a in A: if a < K: break if a == K: ans = 'POSSIBLE' break ...
s826387936
p03651
u677523557
1562966462
Python
Python (3.4.3)
py
Runtime Error
105
14100
371
N, K = map(int, input().split()) # 横に2個 A = list(map(int, input().split())) A.sort(reverse=True) dif = [] for i in range(N-1): dif.append(A[i] - A[i+1]) mind = min(dif) ans = 'IMPOSSIBLE' for a in A: if a < K: break if a == K: ans = 'POSSIBLE' break if (a-K) % mind == 0: ...
s366613665
p03651
u539517139
1562771438
Python
Python (3.4.3)
py
Runtime Error
17
2940
264
n,k=map(int,input().split()) a=list(map(int,input().split())) from fractions import gcd from functools import reduce def g(l): return reduce(gcd,l) if max(a)<k: print('IMPOSSIBLE') else: z=g(a) if k%z==0: print('POSSIBLE') else: print('IMPOSSIBLE')
s644995956
p03651
u379692329
1560823675
Python
Python (3.4.3)
py
Runtime Error
98
16208
253
from fractions import gcd N, K = map(int, input().split()) A = [int(_) for _ in input().split()] GCD = gcd(A[0], A[1]) for i in range(2, N): GCD = gcd(GCD, A[i]) if K <= max(A) and K % GCD == 0: print("POSSIBLE") else: print("IMPOSSIBLE")
s076236304
p03651
u391731808
1560631477
Python
Python (3.4.3)
py
Runtime Error
118
19728
244
N,K = map(int,input().split()) *A, = sorted(set(map(int,input().split()))) if A[-1]<K:print("IMPOSSIBLE");exit() d = min(A[i+1]-a for i,a in enumerate(A[:-1])) K%=d for a in A: if a%d==K:print("POSSIBLE");break else: print("IMPOSSIBLE")
s939527163
p03651
u497046426
1560569767
Python
Python (3.4.3)
py
Runtime Error
111
14224
280
N, K = map(int, input().split()) *A, = map(int, input().split()) A = sorted(A) diff = min([A[i+1] - A[i] for i in range(N-1) if A[i+1] - A[i] > 0]) for a in [a for a in A if a >= K]: if (a - K) % diff == 0: print('POSSIBLE') break else: print('IMPOSSIBLE')
s557130360
p03651
u497046426
1560569554
Python
Python (3.4.3)
py
Runtime Error
102
14252
259
N, K = map(int, input().split()) *A, = map(int, input().split()) A = sorted(A) diff = min([A[i+1] - A[i] for i in range(N-1)]) for a in [a for a in A if a >= K]: if (a - K) % diff == 0: print('POSSIBLE') break else: print('IMPOSSIBLE')
s689275761
p03651
u892251744
1559324267
Python
Python (3.4.3)
py
Runtime Error
50
14612
293
import math from functools import reduce N, K = map(int, input().split()) A = list(map(int, input().split())) def gcd_list(numbers): return reduce(math.gcd, numbers) if K > max(A): print('IMPOSSIBLE') elif K % gcd_list(A) != 0: print('IMPOSSIBLE') else: print('POSSIBLE')
s853065911
p03651
u892251744
1559324011
Python
Python (3.4.3)
py
Runtime Error
49
14616
282
import math from functools import reduce N, K = map(int, input().split()) A = list(map(int, input().split())) def gcd(numbers): return reduce(math.gcd, numbers) if K > max(A): print('IMPOSSIBLE') elif K % gcd(A) != 0: print('IMPOSSIBLE') else: print('POSSIBLE')
s234352953
p03651
u892251744
1559323991
Python
PyPy3 (2.4.0)
py
Runtime Error
227
62576
282
import math from functools import reduce N, K = map(int, input().split()) A = list(map(int, input().split())) def gcd(numbers): return reduce(math.gcd, numbers) if K > max(A): print('IMPOSSIBLE') elif K % gcd(A) != 0: print('IMPOSSIBLE') else: print('POSSIBLE')
s177764471
p03651
u782654209
1558067748
Python
Python (3.4.3)
py
Runtime Error
2104
14224
291
def gcd(a,b): while a*b>0: a,b = min(a,b),max(a,b) a,b = b-a, a return b N,K=map(int,input().split()) A=sorted(list(map(int,input().split()))) R=gcd(A[1],A[0]) for i in range(1,N-1): R=gcd(R,(A[i+1]-A[i])) if K<=A[-1] and (K-A[0])%R==0: print('POSSIBLE') else: print('IMPOSSIBLE')
s608774352
p03651
u827202523
1557456066
Python
Python (3.4.3)
py
Runtime Error
130
14480
630
def getN(): return int(input()) def getNM(): return map(int, input().split()) def getList(): return list(map(int, input().split())) def main(): n,k = getList() nums = sorted(getList()) diff = [] if n == 1: if nums[0] == n: print("POSSIBLE") else: prin...
s000171713
p03651
u827202523
1557456009
Python
Python (3.4.3)
py
Runtime Error
17
2940
658
def getN(): return int(input()) def getNM(): return map(int, input().split()) def getList(): return list(map(int, input().split())) def main() n,k = getList() nums = sorted(getList()) diff = [] if n == 1: if nums[0] == n: print("POSSIBLE") else: print...
s550325673
p03651
u827202523
1557455836
Python
Python (3.4.3)
py
Runtime Error
141
14480
399
def getN(): return int(input()) def getNM(): return map(int, input().split()) def getList(): return list(map(int, input().split())) n,k = getList() nums = sorted(getList()) diff = [] for i,j in zip(nums, nums[1:]): diff.append(abs(i-j)) diff.sort() mod = diff[0] ans = "IMPOSSIBLE" for num in nums: ...
s661689546
p03651
u077337864
1555552960
Python
Python (3.4.3)
py
Runtime Error
113
14100
449
import sys sys.setrecursionlimit(1000000) 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]) f...