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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
s996668869 | p03652 | u227888331 | 1507596580 | Python | Python (3.4.3) | py | Runtime Error | 593 | 33240 | 496 | import numpy as np
from scipy import stats
input1 = input("").split(" ")
N = int(input1[0])
M = int(input1[1])
temp = [ input() for _ in range(N) ]
A = []
for i in range(N):
A.append(list(map(int,temp[i].split(" "))))
A = np.array(A)
result = N
for j in range(M):
top = A[:,0]
mode = stats.mode(top)
count = len(n... |
s312271103 | p03652 | u355503065 | 1502746102 | Python | Python (2.7.6) | py | Runtime Error | 13 | 2692 | 628 | import pandas as pd
def most_popular(df):
maxs = df.idxmax(axis=1)
counts = maxs.value_counts(sort=True, ascending=False)
return counts.index[0], counts.values[0]
line = raw_input()
man_num = int(line.split(" ")[0])
sports_num = int(line.split(" ")[1])
table = pd.DataFrame()
for i in xrange(0, man_num):... |
s085717322 | p03652 | u293976191 | 1500937180 | Python | Python (2.7.6) | py | Runtime Error | 141 | 3716 | 458 | N, M = map(int, raw_input().split(' '))
A = [map(int, raw_input().split(' ')) for _ in xrange(N)]
answer = N
for m in xrange(M-1):
participants = [0] * (M + 1)
for n in xrange(N):
participants[A[n][0]] += 1
sport_with_max_participants = max(xrange(M), key=lambda x: participants[x])
answer = min... |
s494878147 | p03652 | u340781749 | 1500864975 | Python | Python (3.4.3) | py | Runtime Error | 83 | 6812 | 2220 | def solve(m, prefers):
if m == 1:
return len(prefers)
items = [True] * (m + 1)
competes = {i: 0 for i in range(1, m + 1)}
persons = [set() for _ in range(m + 1)]
for i, prefer in enumerate(prefers):
item = prefer[-1]
competes[item] += 1
persons[item].add(i)
ans... |
s933064622 | p03652 | u340781749 | 1500863903 | Python | Python (3.4.3) | py | Runtime Error | 81 | 6692 | 1023 | def solve(m, prefers):
if m == 1:
return 1
items = [True] * (m + 1)
competes = {i: 0 for i in range(1, m + 1)}
persons = [set() for _ in range(m + 1)]
for i, ps in enumerate(prefers):
item = ps[-1]
competes[item] += 1
persons[item].add(i)
ans = m
remain = m... |
s396449684 | p03652 | u340781749 | 1500863616 | Python | Python (3.4.3) | py | Runtime Error | 102 | 6692 | 906 | n, m = map(int, input().split())
prefers = [list(reversed(list(map(int, input().split())))) for _ in range(n)]
items = [True] * (m + 1)
competes = {i: 0 for i in range(1, m + 1)}
persons = [set() for _ in range(m + 1)]
for i, ps in enumerate(prefers):
item = ps[-1]
competes[item] += 1
persons[item].add(i)
... |
s229885816 | p03652 | u340781749 | 1500863520 | Python | Python (3.4.3) | py | Runtime Error | 108 | 6692 | 898 | n, m = map(int, input().split())
prefers = [list(reversed(list(map(int, input().split())))) for _ in range(n)]
items = [True] * (m + 1)
competes = {i: 0 for i in range(1, m + 1)}
persons = [set() for _ in range(m + 1)]
for i, ps in enumerate(prefers):
item = ps[-1]
competes[item] += 1
persons[item].add(i)
... |
s154733906 | p03652 | u340781749 | 1500863382 | Python | Python (3.4.3) | py | Runtime Error | 103 | 6692 | 820 | n, m = map(int, input().split())
prefers = [list(reversed(list(map(int, input().split())))) for _ in range(n)]
items = [True] * (m + 1)
competes = {i: 0 for i in range(1, m + 1)}
persons = [set() for _ in range(m + 1)]
for i, ps in enumerate(prefers):
item = ps[-1]
competes[item] += 1
persons[item].add(i)
... |
s432478913 | p03652 | u237316771 | 1500863380 | Python | Python (2.7.6) | py | Runtime Error | 2106 | 49128 | 593 | d = {}
def f(s, n, m, a, js):
if s in d:
return d[s]
cnt = [0] * m
for i in xrange(n):
cnt[a[i][js[i]]] += 1
mc = max(cnt)
d[s] = min(mc, min(
f(s | {k}, n, m, a, [js[i] + (1 if a[i][js[i]] == k else 0) for i in xrange(n)])
for k in xrange(m) if cnt[k] == mc
))
... |
s801137590 | p03652 | u340781749 | 1500863074 | Python | Python (3.4.3) | py | Runtime Error | 104 | 4412 | 857 | n, m = map(int, input().split())
prefers = [list(reversed(list(map(int, input().split())))) for _ in range(n)]
items = [True] * (m + 1)
competes = {i: 0 for i in range(1, m + 1)}
persons = [set() for _ in range(m + 1)]
for i, ps in enumerate(prefers):
item = ps[-1]
competes[item] += 1
persons[item].add(i)
... |
s623481996 | p03652 | u340781749 | 1500862868 | Python | Python (3.4.3) | py | Runtime Error | 99 | 4412 | 833 | n, m = map(int, input().split())
prefers = [list(reversed(list(map(int, input().split())))) for _ in range(n)]
items = [True] * (m + 1)
competes = {i: 0 for i in range(1, m + 1)}
persons = [set() for _ in range(m + 1)]
for i, ps in enumerate(prefers):
item = ps[-1]
competes[item] += 1
persons[item].add(i)
... |
s362254342 | p03653 | u531813944 | 1565902101 | Python | Python (3.4.3) | py | Runtime Error | 21 | 3188 | 384 | from sys import stdin
a = int(stdin.readline().rstrip())
b = int(stdin.readline().rstrip())
c = int(stdin.readline().rstrip())
x = int(stdin.readline().rstrip())
count = 0
for i in range(a+1):
if i * 500 > x: continue
for j in range(b+1):
if i * 500 + j * 100 > x: continue
for k in range(c+1):
if i... |
s507471196 | p03653 | u839537730 | 1500876335 | Python | Python (3.4.3) | py | Runtime Error | 661 | 40980 | 856 | X, Y, Z = list(map(int, input().split(" ")))
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[:Y]
ABC_ak = ABC[Y:]
for k in range(Y, Y+Z):
if k > Y:
ABC_bk.append(ABC_ak.pop(0))
... |
s484007727 | p03653 | u839537730 | 1500876029 | Python | Python (3.4.3) | py | Runtime Error | 471 | 36264 | 877 | X, Y, Z = list(map(int, input().split(" ")))
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[:Y]
ABC_ak = ABC[Y:]
for k in range(Y, Y+Z):
if k > Y:
ABC_bk.append(ABC_ak.pop(0))
... |
s329529098 | p03653 | u839537730 | 1500873582 | Python | Python (3.4.3) | py | Runtime Error | 744 | 45796 | 803 | 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[:Y]
ABC_ak = ABC[Y:]
for k in range(Y, Y+Z):
if k > Y:
ABC_bk = ABC_bk.appe... |
s768463419 | p03653 | u839537730 | 1500873399 | Python | Python (3.4.3) | py | Runtime Error | 744 | 45696 | 786 | 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[:Y]
ABC_ak = ABC[Y:]
for k in range(Y, Y+Z):
before_k = np.asarray(s... |
s696973468 | p03653 | u839537730 | 1500873078 | Python | Python (3.4.3) | py | Runtime Error | 612 | 45260 | 776 | 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[:Y]
ABC_ak = ABC[Y:]
for k in range(Y, Y+Z):
ABC_bk = ABC_bk + ABC_ak[0]
ABC_ak... |
s464437801 | p03653 | u555811857 | 1500865797 | Python | Python (3.4.3) | py | Runtime Error | 2106 | 45492 | 1733 | # -*- coding: utf-8 -*-
X, Y, Z = map(int, input().split())
N = X + Y + Z
arys_orig = []
arys = []
for i in range(N):
tmp = input()
ary = [int(a) for a in tmp.split()]
arys_orig.append(ary)
m = max(ary)
ary2 = [a - m for a in ary]
arys.append(ary2)
def argsort(ary):
x, y, z = ary
if x ... |
s859506122 | p03653 | u653807637 | 1500864030 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3064 | 630 | # encoding:utf-8
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")
decomp_min = decomp(min_num)
for x in decomp_min:
res = [y % x for y in nums]
# 共通因子を持ってなかったらだめ
if max... |
s494394471 | p03654 | u905582793 | 1590123316 | Python | PyPy3 (2.4.0) | py | Runtime Error | 486 | 82780 | 846 | import sys
input = sys.stdin.readline
n = int(input())
abd = [list(map(int,input().split())) for i in range(n-1)]
if n == 2:
print(abd[0][2])
exit()
graph = [[] for i in range(n+1)]
deg = [0 for i in range(n+1)]
for a,b,d in abd:
graph[a].append((b,d))
graph[b].append((a,d))
deg[a] += 1
deg[b] += 1
stack = ... |
s087460721 | p03654 | u905582793 | 1590123223 | Python | PyPy3 (2.4.0) | py | Runtime Error | 508 | 86108 | 830 | import sys
input = sys.stdin.readline
n = int(input())
abd = [list(map(int,input().split())) for i in range(n-1)]
if n == 2:
print(abd[2])
exit()
graph = [[] for i in range(n+1)]
deg = [0 for i in range(n+1)]
for a,b,d in abd:
graph[a].append((b,d))
graph[b].append((a,d))
deg[a] += 1
deg[b] += 1
stack = []
... |
s134659532 | p03654 | u905506603 | 1539730501 | Python | Python (2.7.6) | py | Runtime Error | 682 | 43380 | 915 | import sys
n=input()
adj=[[] for i in range(n+1)]
for i in range(n-1):
a, b, c=map(int, raw_input().split())
adj[a].append((b, c))
adj[b].append((a, c))
size=[0]*(n+1)
def dfs(cur, father):
size[cur]=1
for to, weight in adj[cur]:
if to!=father:
dfs(to, cur)
size[cur]+=size[to]
dfs(1, 0)
center=1
while True... |
s691722119 | p03656 | u762008592 | 1503585325 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3060 | 39 | オイオイオイ アイツ死ぬわ |
s009826561 | p03657 | u318661636 | 1601043883 | Python | Python (3.8.2) | py | Runtime Error | 27 | 9036 | 126 | a,b = map(int,input().split())
if a % 3 == 0 or b % 3 == 0 or (a+b) % 3 == 0:
print('Possible')
else:
pritn('Impossible') |
s978500900 | p03657 | u485349322 | 1600538092 | Python | Python (3.8.2) | py | Runtime Error | 21 | 8940 | 111 | A,B=map(int.input().split())
if A%3==0 or B%3==0 or (A+B)%3==0:
print("Possible")
else:
print("Impossible") |
s516368223 | p03657 | u955691979 | 1600008510 | Python | PyPy3 (7.3.0) | py | Runtime Error | 90 | 74804 | 112 | a,b = map(int,input())
if a%3 == 0 or b%3 == 0 or (a+b)%3 == 0:
print("Possible")
else:
print("Impossible") |
s744208472 | p03657 | u847033024 | 1599898018 | Python | Python (3.8.2) | py | Runtime Error | 23 | 9048 | 96 | a, b = map(int, input().split())
x = a + b
if x % 3 == 0:
print('Possible')
else('Impossidle') |
s073147987 | p03657 | u708211626 | 1599362002 | Python | Python (3.8.2) | py | Runtime Error | 28 | 8868 | 124 | a=list(map(int,input().split()))
b=sum(a)
if (b%3 or a[0]%3 or a[1]) !=0 :
print('Impossible')
elif :
print('Possible') |
s779155301 | p03657 | u642012866 | 1598629613 | Python | Python (3.8.2) | py | Runtime Error | 29 | 8912 | 48 | print("YNeos"[notA%3==0orB%3==0or(A+B)%3==0::2]) |
s352553747 | p03657 | u620846115 | 1598475428 | Python | Python (3.8.2) | py | Runtime Error | 22 | 8928 | 114 | a,b = map(int,input().split())
if a%3==0 \or b%==0 \or (a+b)%3==0:
print("Possible")
else:
print("Impossible") |
s591442002 | p03657 | u620846115 | 1598475391 | Python | Python (3.8.2) | py | Runtime Error | 22 | 8876 | 114 | a,b = map(int,input().split())
if a%3==0 or\ b%==0 or\ (a+b)%3==0:
print("Possible")
else:
print("Impossible") |
s321463529 | p03657 | u620846115 | 1598475149 | Python | Python (3.8.2) | py | Runtime Error | 22 | 9008 | 111 | a,b = map(int,input().split())
if a%3==0 or b%==0 or(a+b)%3==0:
print("Possible")
else:
print("Impossible") |
s422996522 | p03657 | u244836567 | 1598236625 | Python | Python (3.8.2) | py | Runtime Error | 23 | 8968 | 206 | a,b=input().split()
a=int(a)
b=int(b)
if ((a+b)%3)==0:
print("Possible")
else:
if (a%3)==0:
print("Possible")
else:
if (b%3)==0:
print("Possible")
else:
print("Impossible") |
s304255349 | p03657 | u763963344 | 1598198319 | Python | Python (3.8.2) | py | Runtime Error | 25 | 8832 | 233 | a, b = map(int, input().split())
# intは入力に対しての関数、出力ではない
if (a+b)%3 => 0:
print("Possible")
elif a%3 => 0:
print("Possible")
elif b%3 => 0:
print("Possible")
else:
print("Impossible") |
s038963044 | p03657 | u779830746 | 1598149364 | Python | Python (3.8.2) | py | Runtime Error | 30 | 9096 | 246 |
# 出力
# a, b = map(int, input().split())
a = int(input())
b = int(input())
# 処理&出力
if a / 3 >= 1 :
print('Possible')
elif b / 3 >= 1:
print('Possible')
elif (a + b) /3 >= 1:
print('Possible')
else:
print('Impossible') |
s220414866 | p03657 | u779830746 | 1598149152 | Python | Python (3.8.2) | py | Runtime Error | 29 | 9052 | 169 |
# 出力
# a, b = map(int, input().split())
a = int(input())
b = int(input())
# 処理&出力
if (a + b) / 3 >= 1 :
print('Possible')
else:
print('Impossible') |
s233736803 | p03657 | u477696265 | 1598064975 | Python | Python (3.8.2) | py | Runtime Error | 22 | 8996 | 176 | a,b=(int(x) for x in input().split())
c = ( a + b ) % 3
if (str(a) % '3' == '0' or str(b) % '3' == '0' or (c) == '0'):
print ( 'Possible' )
else:
print ( 'Impossible' ) |
s581675849 | p03657 | u477696265 | 1598064933 | Python | Python (3.8.2) | py | Runtime Error | 25 | 9080 | 171 | a,b=(int(x) for x in input().split())
c = ( a + b ) % 3
if (a % '3' == '0' or str(b) % '3' == '0' or (c) == '0'):
print ( 'Possible' )
else:
print ( 'Impossible' ) |
s324899813 | p03657 | u477696265 | 1598063498 | Python | Python (3.8.2) | py | Runtime Error | 28 | 8960 | 119 | a,b=(int(x) for x in input().split())
c = ( a + b ) % 3
if (c == '0'):
print (Possible)
else:
print(Impossible) |
s637901519 | p03657 | u468972478 | 1597714187 | Python | Python (3.8.2) | py | Runtime Error | 24 | 9020 | 114 | a, b = map(int, input().split())
print("Possible" if a % 3 == 0 or b % 3 == 0 or (a + b) % == 0 else "Impossible") |
s515388016 | p03657 | u018679195 | 1597704301 | Python | Python (3.8.2) | py | Runtime Error | 26 | 9160 | 144 | A = int(input())
B = int(input())
if 1<=A<=100 and 1<=B<=100:
if (A+B)%3==0:
print("Possible")
else:
print("Impossible") |
s666295564 | p03657 | u353919145 | 1597703136 | Python | Python (3.8.2) | py | Runtime Error | 25 | 9164 | 154 | A = int(input())
B = int(input())
if 1<=A<=100 and 1<=B<=100:
C = (A+B)%3
if C==0:
print("Possible")
else:
print("Impossible") |
s326517581 | p03657 | u442948527 | 1597196599 | Python | Python (3.8.2) | py | Runtime Error | 23 | 8900 | 94 | a,b=map(int(input()).split())
print(["Possible","Impossible"][a%3==b%3 and (a%3==1 or a%3==2)] |
s098404135 | p03657 | u442948527 | 1597196509 | Python | Python (3.8.2) | py | Runtime Error | 22 | 8960 | 93 | a,b=map(int,input().split())
print(["Possible","Impossible"][a%3==b%3 and (a%3==1 or a%3==2)] |
s909412463 | p03657 | u442948527 | 1597196453 | Python | Python (3.8.2) | py | Runtime Error | 26 | 8840 | 91 | a,b=map(int,input().split())
print(["Possible","Impossible"][a%3==b%3 and a%3==1 or a%3==2] |
s227846968 | p03657 | u243159381 | 1596424137 | Python | Python (3.8.2) | py | Runtime Error | 20 | 8972 | 117 | a,b=map(int,input().split())
if a%3==0 or b%3==0: or (a+b)%3==0:
print ('Possible')
else:
print('Impossible') |
s729874050 | p03657 | u767797498 | 1595889006 | Python | Python (3.8.2) | py | Runtime Error | 24 | 8956 | 117 | a,b=map(int,input().split())
for i in (a,b,a+b):
i%3==0:
print("Possible")
exit()
print("Impossible")
|
s863394440 | p03657 | u767797498 | 1595888958 | Python | Python (3.8.2) | py | Runtime Error | 26 | 8936 | 116 | a,b=map(int,input(),split())
for i in (a,b,a+b):
i%3==0:
print("Possible")
exit()
print("Impossible") |
s650261897 | p03657 | u562015767 | 1595863313 | Python | PyPy3 (7.3.0) | py | Runtime Error | 105 | 74736 | 260 | n = int(input())
a = list(map(int,input().split()))
l = [0]*n
l[0] = a[0]
for i in range(1,n):
l[i] = l[i-1] + a[i]
sum = sum(a)
ans = 10**10+1
for i in range(len(l)-1):
x = l[i]
y = sum - l[i]
tmp = abs(x-y)
ans = min(ans,tmp)
print(ans) |
s513099682 | p03657 | u085717502 | 1595607050 | Python | Python (3.8.2) | py | Runtime Error | 20 | 9076 | 275 | #!/usr/bin/env python
# coding: utf-8
# In[6]:
N = int(input())
a = list(map(int, input().split()))
# In[7]:
ans = (10**9)*N
for i in range(1,N):
x = sum(a[:i])
y = sum(a[i:])
ans = min(ans,abs(x-y))
if ans < 2:
break
print(ans)
# In[ ]:
|
s810593669 | p03657 | u085717502 | 1595606974 | Python | PyPy3 (7.3.0) | py | Runtime Error | 92 | 74880 | 275 | #!/usr/bin/env python
# coding: utf-8
# In[6]:
N = int(input())
a = list(map(int, input().split()))
# In[7]:
ans = (10**9)*N
for i in range(1,N):
x = sum(a[:i])
y = sum(a[i:])
ans = min(ans,abs(x-y))
if ans < 2:
break
print(ans)
# In[ ]:
|
s141496980 | p03657 | u860546679 | 1595116643 | Python | Python (3.8.2) | py | Runtime Error | 23 | 8756 | 117 | a,b=map(int,input().split())
if (a%3==0) || (b%3==0) || ((a+b)%3==0):
print("Possible")
else:
print("Impossible") |
s104448048 | p03657 | u065099501 | 1594996309 | Python | Python (3.8.2) | py | Runtime Error | 22 | 9028 | 141 | n=int(input())
a=list(map(int,input().split()))
ans=10**100
x=sum(a)
b=0
for i in a[:-1]:
b+=i
x-=i
ans=min(ans,abs(x-b))
print(ans) |
s221476754 | p03657 | u113255362 | 1594857163 | Python | Python (3.8.2) | py | Runtime Error | 26 | 9096 | 165 | a,b,c=map(int,input().split())
if A%3 == 0:
print("Possible")
elif B%3 == 0:
print("Possible")
elif (A+B)%3 == 0:
print("Possible")
else:
print("Impossible") |
s738528207 | p03657 | u823885866 | 1594092762 | Python | Python (3.8.2) | py | Runtime Error | 113 | 26852 | 483 | import sys
import math
import itertools
import collections
import heapq
import re
import numpy as np
rr = lambda: sys.stdin.readline().rstrip()
rs = lambda: sys.stdin.readline().split()
ri = lambda: int(sys.stdin.readline())
rm = lambda: map(int, sys.stdin.readline().split())
rl = lambda: list(map(int, sys.stdin.readl... |
s510590951 | p03657 | u047931063 | 1593924916 | Python | PyPy3 (7.3.0) | py | Runtime Error | 88 | 74652 | 163 | A = list(map(int, input().split()))
A.append(sum(A))
ans = False
for i in A:
if A%3 == 0:
ans = True
if ans:
print("Possible")
else:
print("Impossible") |
s807457128 | p03657 | u569805198 | 1593898752 | Python | Python (3.8.2) | py | Runtime Error | 20 | 9016 | 93 | a, b = int(input().split())
if (a + b) % 3 == 0:
print(Possible)
else:
print(Impossible) |
s832979167 | p03657 | u514118270 | 1593834913 | Python | Python (3.8.2) | py | Runtime Error | 21 | 8976 | 81 | A,B=int(input())
if A%3*B%3*(A+B)%3==0:print('Possible')
else:print('Impossible') |
s165151502 | p03657 | u209275335 | 1593149832 | Python | Python (3.8.2) | py | Runtime Error | 23 | 9100 | 153 | li = list(map(int,input().split()))
li.append(a+b)
for i in range(3):
if li[i] % 3 == 0:
print("Possible")
exit()
print("Impossible") |
s175587447 | p03657 | u750651325 | 1592669763 | Python | PyPy3 (7.3.0) | py | Runtime Error | 88 | 74772 | 179 | N = int(input())
a = list(map(int, input().split()))
ans = abs(sum(a[1:])-a[0])
X = sum(a)
for i in range(1,N):
sa = abs(X - 2*sum(a[:i]))
ans = min(ans,sa)
print(ans)
|
s692798809 | p03657 | u778348725 | 1592276469 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 130 | A,B = map(int,input().split())
if((A%3 == 0) or (B%3 == 0) or ((A+B)%3 == 0):
print("Possible")
else:
print("Impossible")
|
s256946990 | p03657 | u629540524 | 1591739727 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 124 | a, b = map(int, input().split())
if a%3 = 0 or b%3 == 0 or (a+b)%3 == 0:
print('Possible')
else:
print('Impossible') |
s818207636 | p03657 | u446711904 | 1591731426 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 98 | a,b=mpa(int,input().split())
print('Possible' if (a%3==0 or b%3==0 or a+b%3==0) else 'Impossible') |
s434095140 | p03657 | u446711904 | 1591730759 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 66 | print('Possible' if sum(map(int, input()))%3==0 else 'Impossible') |
s928183677 | p03657 | u446711904 | 1591730691 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 72 | print('Possible' if sum(list(map(int, input())))%3==0 else 'Impossible') |
s091834168 | p03657 | u391442102 | 1591249552 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 98 | A,B = map(str, input().split())
if (A + B)%3 == 0:
print('Possible')
else:
print('Impossible') |
s179130806 | p03657 | u887263002 | 1590894164 | Python | Python (2.7.6) | py | Runtime Error | 11 | 2568 | 142 | A = input()
B = input()
if A % 3 == 0 and B % 3 == 0:
print('Possible')
elif A + B % 3 == 0:
print('Possible')
else:
print('Impossible') |
s125396938 | p03657 | u887263002 | 1590894024 | Python | Python (2.7.6) | py | Runtime Error | 10 | 2568 | 142 | A = input()
B = input()
if A % 3 == 0 and B % 3 == 0:
print('Possible')
elif A + B % 3 == 0:
print('Possible')
else:
print('Impossible') |
s139700748 | p03657 | u887263002 | 1590893884 | Python | Python (2.7.6) | py | Runtime Error | 10 | 2568 | 142 | A = input()
B = input()
if A % 3 == 0 and B % 3 == 0:
print('Possible')
elif A + B % 3 == 0:
print('Possible')
else:
print('Impossible') |
s504924877 | p03657 | u887263002 | 1590893796 | Python | Python (2.7.6) | py | Runtime Error | 11 | 2568 | 143 | A = imput()
B = imput()
if A % 3 == 0 and B % 3 == 0:
print('Possible')
elif A + B % 3 == 0:
print('Possible')
else:
print('Impossible')
|
s781850365 | p03657 | u860002137 | 1590257507 | Python | Python (3.4.3) | py | Runtime Error | 146 | 12508 | 312 | import numpy as np
n = int(input())
a = np.array(list(map(int, input().split())))
whole = a.sum()
div = np.abs(a.cumsum() - whole / 2).argmin()
if div == 0 or div == (n - 1):
print(min(np.abs(a[0] - a[1:].sum()), np.abs(a[:-1].sum() - a[-1])))
else:
print(np.abs(a[:div + 1].sum() - a[div + 1:].sum())) |
s007455333 | p03657 | u910295650 | 1589378918 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 58 | print("Impossible" if int(input()[::2])%3 else "Possible") |
s533067181 | p03657 | u207799478 | 1588971829 | Python | PyPy3 (2.4.0) | py | Runtime Error | 173 | 38384 | 111 | a,b=map(int,input().split())
print('Possible' if ((a+b)%3==0) or (a%3==0) or(b%3==0) else 'Impossible') |
s108441109 | p03657 | u604655161 | 1588965115 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 216 |
A,B = map(int, input().split())
if A%3 == 0:
print('Possible')
elif B%3 == 0:
print('Possible')
elif (A+B)%3 == 0:
print('Possible')
else:
print('Impossible') |
s541951561 | p03657 | u126844573 | 1588630947 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 108 | a, b = map(int, input().split())
print("Impossible" if (a % 3) or (b % 3) or(sum(a, b) % 3) else "Possible") |
s075209861 | p03657 | u277641173 | 1588189802 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 107 | a,b=map(int,input().split())
if a%3==0 or b%3==0 or c%3==0:
print("Possible")
else:
print("Impossible") |
s373252931 | p03657 | u095094246 | 1588039342 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3188 | 140 | import sys
a,b=map(int, input().split())
s=[a,b,a+b]
for si in s:
if si%3==0:
print('Possible')
sys.exit()
print('Impossible')
|
s383708651 | p03657 | u419963262 | 1587962231 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 131 | n,k=map(int,input().split())
a=list(map(int,input().split()))
b=sorted(a)
ans=0
for i in range(1,k+1):
ans+=b[(-1)*i]
print(ans)
|
s985783014 | p03657 | u419963262 | 1587962040 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 102 | a,b=map(int,input().split())
if a*b*(a+b)%3==0:
print(""Possible")
else:
print("Impossible") |
s200055409 | p03657 | u419963262 | 1587936741 | Python | Python (3.4.3) | py | Runtime Error | 18 | 3064 | 164 | N=int(input())
a=list(map(int,input().split()))
S=sum(a)
SS=0
mi=abs(S-SS)
for i in range(N):
S=S-a[i]
SS=SS+a[i]
if mi>=abs(S-SS):
mi=abs(S-SS)
print(mi) |
s972569207 | p03657 | u385649291 | 1587929875 | Python | Python (3.4.3) | py | Runtime Error | 18 | 2940 | 160 | # coding: utf-8
# Your code here!
N = int(input())
a = list(map(int,input().split()))
print(min(abs(sum(a[0:i])-(sum(a)-sum(a[0:i]))) for i in range(1,N)))
|
s696302021 | p03657 | u549161102 | 1587836375 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 80 | N,K = map(int, input().split())
l = input()
lrev = l[::-1]
print(sum(lrev[:K]))
|
s662188717 | p03657 | u507116804 | 1587421538 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 133 | a,b = map(int, input().split())
a+b=k
a%3=m
b%3=n
k%3=r
if m==0 or n==0 or r==0:
print("Possible")
else:
print("Impossible") |
s262677180 | p03657 | u507116804 | 1587421505 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 133 | a,b = map(int, input().split())
a+b=k
a%3=m
b%3=n
k%3=r
if m==0 or n==0 or r==0:
print("Possible")
else:
print("Impossible") |
s506827700 | p03657 | u507116804 | 1587421454 | Python | Python (3.4.3) | py | Runtime Error | 18 | 2940 | 138 | a,b = (map(int, input().split()))
a+b=k
a//3=m
b//3=n
k//3=r
if m==0 or n==0 or r==0:
print("Possible")
else:
print("Impossible") |
s371557094 | p03657 | u507116804 | 1587421194 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 138 | a,b = (map(int, input().split()))
a+b=k
a//3=m
b//3=n
k//3=r
if m==0 or n==0 or r==0:
print("Possible")
else:
print("Impossible") |
s534467297 | p03657 | u422272120 | 1587178621 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3060 | 173 | N = int(input())
a = list(map(int,input().split()))
total = sum(a)
ans = float('inf')
x = 0
for i in range(N-1):
x += a[i]
ans = min(abs(total-2*x),ans)
print (ans)
|
s349549551 | p03657 | u191423660 | 1586968430 | Python | Python (3.4.3) | py | Runtime Error | 18 | 2940 | 146 | N, K = map(int, input().split())
l = map(int, input().split())
l = sorted(l)[::-1]
sum = 0
for i in range(K):
sum += l[i]
print(sum)
|
s357921469 | p03657 | u263753244 | 1586399979 | Python | Python (3.4.3) | py | Runtime Error | 16 | 3060 | 149 | n=int(input())
a=list(map(int,input().split()))
m=n*10**9
for i in range(n-1):
k=abs( sum(a[0:i+1]) - sum(a[i+1:n]) )
m=min(m,k)
print(m)
|
s780139464 | p03657 | u535659144 | 1586045141 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 122 | a,b = [int(x) for x in split().input()]
if a%3==0 or b%3==0 or (a+b)%3==0:
print("Possible")
else:
print("Impossible") |
s867154183 | p03657 | u639703036 | 1585769920 | Python | Python (3.4.3) | py | Runtime Error | 17 | 3060 | 208 | #ABC067A
a,b=map(int,input().split())
if ((a+b)%3==0)and(a%3!=0)and(b%3!=0):
print("Possible")
elif(a%3==0)or(b%3==0)and((a+b)%3!=0):
print("Possible")
else:
print("Impossible") print("Possible") |
s867933774 | p03657 | u706159977 | 1585751509 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 105 | a,b = map(int,input())
if a%3==0 or b%3==0 or (a+b)%3==0:
print("Possible")
else:
print("Impossible") |
s783511661 | p03657 | u063346608 | 1585661816 | Python | Python (3.4.3) | py | Runtime Error | 18 | 2940 | 109 | A,B = map(int,input().split())
if A + B % == 0 and A + B != 0:
print("Possible")
else:
print("Impossible") |
s471904880 | p03657 | u197300773 | 1585547029 | Python | PyPy3 (2.4.0) | py | Runtime Error | 165 | 38256 | 675 | import sys
sys.setrecursionlimit(10**7)
def cur(p):
for x in neighbor[p]:
if x==par[p]: continue
else:
par[x]=p
descend[p]+=cur(x)
neighbor[p].remove(par[p])
return descend[p]
n=int(input())
neighbor=[[] for _ in range(n+1)]
descend=[1]*(n+1)
par=[0]*(n+1)
for _ i... |
s683898619 | p03657 | u556589653 | 1584878588 | Python | PyPy3 (2.4.0) | py | Runtime Error | 170 | 38256 | 328 | N = int(input())
A = list(map(int,input().split()))
ruiseki = [0]*(N+1)
total = 0
now = 10**9+7
sa = 0
now_2 = 0
for i in range(N):
total += A[i]
ruiseki[i+1] = total
for i in range(1,len(ruiseki)-1):
snuke = ruiseki[i]-ruiseki[0]
arai = ruiseki[N]-ruiseki[i]
now_2 = abs(snuke-arai)
now = min(now,now_2)
pri... |
s261821545 | p03657 | u344959886 | 1584554079 | Python | PyPy3 (2.4.0) | py | Runtime Error | 160 | 38256 | 111 | a,b=map(int,input().split())
if a %3==0 or b%3== or (a+b)%3==0:
print("Possible")
else:
print("Impossible") |
s259967542 | p03657 | u273010357 | 1584319931 | Python | Python (3.4.3) | py | Runtime Error | 18 | 2940 | 189 | N = int(input())
a = list(map(int, input().split()))
M = sum(a)
snk = 0
ans = float('inf')
for i in range(N-1):
snk += a[i]
ari = M - snk
ans = min(ans,abs(snk-ari))
print(ans)
|
s971135964 | p03657 | u697696097 | 1583816361 | Python | Python (3.4.3) | py | Runtime Error | 16 | 2940 | 111 | a,b=map(int,input().stlip())
if a%3==0 or b%3==0 or (a+b)%3==0:
print("Possible")
else:
print("Impossible") |
s230524840 | p03657 | u015993380 | 1583704430 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 88 | a,b = [int(x) for x in input().split()]
print('Possible' (a+b)%3 == 0 else 'Impossible') |
s616427743 | p03657 | u288430479 | 1583701673 | Python | Python (3.4.3) | py | Runtime Error | 17 | 2940 | 119 | A,B =map(int,input().split())
if A%3 == o or B%3 ==0 or (A+B)%3 ==0:
print("Possible")
else:
print("Impossible") |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.