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
s115040141
p03471
u045628053
1590540945
Python
Python (3.4.3)
py
Runtime Error
17
3064
316
import sys n,y = [ int(i) for i in input().split()] main_list = input().split() n = int(main_list[0]) y = int(main_list[1][:-3]) for i in range((y//10)+1): for j in range(2): if y == i*10 + j*5 + (n-i-j)*1: print(" ".join(list(map(str,[i,j,n-i-j])))) sys.exit() print("-1 -1 -1")
s460057943
p03471
u989074104
1590540909
Python
Python (3.4.3)
py
Runtime Error
18
2940
248
import sys N,Y = map(int,input().split()) for A in range(N+1)[::-1]: for B in range(N-A+1)[::-1]: C=N-A-B if (10000*A+5000*B+1000*C==Y): print(A,B,C) sys.exit() print(-1,-1,-1)
s042186313
p03471
u941644149
1590509833
Python
PyPy3 (2.4.0)
py
Runtime Error
181
38640
333
N, Y = map(int, input().split()) ans = [-1,-1,-1] for x in range(N+1): for y in range(N+1): z = N-x-y if z < 0: continue if (10000*x + 5000*y + 1000*z) == Y: ans[0]= x ans[1]= y ans[2]= z break else: continue if ans[0]==-1:print("-1 -1 -1") else: print(f"{ans[0]} {ans[1]} ...
s100169374
p03471
u322187839
1590460865
Python
Python (3.4.3)
py
Runtime Error
17
2940
449
N,Y=map(int, input().split()) count=0 for i in range(N+1): if count==0: pass else: break for j in range(N-i+1): if count==0: pass else: break for k in range(N-i-j+1): if 10000*i+5000*j+1000*k==Y: print(f'{i}{j}{k}')...
s324162283
p03471
u601575292
1590456147
Python
Python (3.4.3)
py
Runtime Error
17
3060
287
n, y = map(int, input().split()) f = False for i in range(n+1): for j in range(n+1): if x+y > n: continue if (1000*i+5000*j+(n-x-y)*1000) == y: print(x,y,n-x-y) f = True break if f: break if not f: print(-1,-1,-1)
s419915793
p03471
u103520789
1590379003
Python
PyPy3 (2.4.0)
py
Runtime Error
172
38256
239
N,Y = map(int, input().split()) ans= [-1, -1, -1] for x in range(N+1): for y in range(N-x+1): price = x*10000 + y*5000 + int(N-x-y)*1000 # print(x,y,N-x-y) if price == Y: print(x,y,N-x-y) break
s931052245
p03471
u775673382
1590353268
Python
Python (3.4.3)
py
Runtime Error
17
2940
219
= map(int, input().split()) for i in range(n + 1): for ii in range(n - i + 1): if 10000 * i + 5000 * ii + 1000 * (n - i - ii) == y: print('{} {} {}'.format(i, ii, n - i - ii)) exit() print('-1 -1 -1')
s420921938
p03471
u146597538
1590341863
Python
Python (3.4.3)
py
Runtime Error
17
2940
243
n,s = map(int, input().split()) for x in range(n): for y in range(n): tmp = n-x-y tmp2 = s-x*10000-y*5000 if tmp*1000 == tmp2 and tmp >= 0: print(f'{x} {y} {tmp}') exit(0) print('-1 -1 -1')
s520860333
p03471
u146597538
1590341764
Python
Python (3.4.3)
py
Runtime Error
17
2940
230
n,s = map(int, input().split()) for x in range(n): for y in range(n): tmp = n-x-y tmp2 = s-x*10000-y*5000 if tmp*1000 == tmp2: print(f'{x} {y} {tmp}') exit(0) print('-1 -1 -1')
s055075638
p03471
u951401193
1589775149
Python
Python (3.4.3)
py
Runtime Error
17
3060
182
n,y = map(int.input().split()) y //= 1000 k = min((n-y)//4,y//5) if 9 * k > 2 * (n-y): x = (y-n) - 4 *k y = 9 * k - 2*(y-n) z = y -5*k print(x,y,z) exit() print('-1 -1 -1')
s231917405
p03471
u000842852
1589761987
Python
PyPy3 (2.4.0)
py
Runtime Error
171
38384
305
import numpy as np N, M = map(int, input().split()) m10000 = -1 m5000 = -1 m1000 = -1 for a in range(N+1): for b in range(N+1-a): c = np.abs(N - a - b) X = 10000*a + 5000*b + 1000*c if X == M: m10000 = a m5000 = b m1000 = c print(m10000, " ", m5000, " ", m1000)
s244302935
p03471
u000842852
1589760333
Python
Python (3.4.3)
py
Runtime Error
2112
14440
367
import numpy as np N, M = map(int, input().split()) for a in range(N): for b in range(N): c = np.abs(N - a - b) X = 10000*a + 5000*b + 1000*c if X == M: m10000 = a m5000 = b m1000 = c break Nt = m10000 + m5000 + m1000 if N >= Nt: print(m10000, " ", m5000, ...
s908243447
p03471
u000842852
1589760024
Python
Python (3.4.3)
py
Runtime Error
1733
3064
321
N, M = map(int, input().split()) for a in range(N): for b in range(N): c = N - a - b X = 10000*a + 5000*b + 1000*c if X == M: m10000 = a m5000 = b m1000 = c Nt = m10000 + m5000 + m1000 if N >= Nt: print(m10000, " ", m5000, " ", m1000) else: print(-1, " ", -1, " ", -1...
s624112975
p03471
u951401193
1589759964
Python
Python (3.4.3)
py
Runtime Error
18
2940
234
n,m = map(int,input().split()) for x in range(n+1): for y in range(n+1): z = n - x - y if (10000*x + 5000*y + 1000*z == m and \ x + y + z = m and \ 0 <= z <= n: print(x,y,z) print('-1 -1 -1')
s792254845
p03471
u000842852
1589759773
Python
Python (3.4.3)
py
Runtime Error
17
2940
330
N M = map(int, imput().split()) for a in range(N): for b in range(N): c = N - a - b X = 10000*a + 5000*b + 1000*c if X == M: m10000 = a m5000 = b m1000 = c Nt = m10000 + m5000 + m1000 if N >= Nt: print(m10000, " ", m5000, " ", m1000) else: print(print(-1, " ", -1...
s704807694
p03471
u806257533
1589690341
Python
Python (3.4.3)
py
Runtime Error
908
3064
450
all = list(map(int, input().split())) N = all[0] Y = all[1] yu = -1 hi = -1 no = -1 for i in range(N): for j in range(N-i): c = (N-(i+j)) total = 10000*i + 5000*j + 1000*c if Y!=total: continue else: yu = i hi = j no = c c...
s115987032
p03471
u806257533
1589690244
Python
Python (3.4.3)
py
Runtime Error
887
3188
502
all = list(map(int, input().split())) N = all[0] Y = all[1] check = 0 for i in range(N): j = 0 for j in range(N-(i+j)): c = (N-(i+j)) total = 10000*i + 5000*j + 1000*c if Y!=total: continue else: yu = i hi = j no = c c...
s918152344
p03471
u806257533
1589690087
Python
Python (3.4.3)
py
Runtime Error
18
3064
492
all = list(map(int, input().split())) N = all[0] Y = all[1] check = 0 for i in range(N): for j in range(N-(i+j)): c = (N-(i+j)) total = 10000*i + 5000*j + 1000*c if Y!=total: continue else: yu = i hi = j no = c check += 1 ...
s998703915
p03471
u806257533
1589690014
Python
Python (3.4.3)
py
Runtime Error
917
3064
488
all = list(map(int, input().split())) N = all[0] Y = all[1] check = 0 for i in range(N): for j in range(N-i): c = (N-(i+j)) total = 10000*i + 5000*j + 1000*c if Y!=total: continue else: yu = i hi = j no = c check += 1 ...
s939479619
p03471
u806257533
1589688901
Python
Python (3.4.3)
py
Runtime Error
1342
3188
515
all = list(map(int, input().split())) N = all[0] Y = all[1] for i in range(N): for j in range(N-i): if N!=i+j+abs(N-(i+j)): yu = -1 hi = -1 no = -1 break else: total = 10000*i + 5000*j + 1000*(N-(i+j)) if Y!=total: ...
s576925636
p03471
u533084327
1589678906
Python
Python (3.4.3)
py
Runtime Error
17
2940
185
N, Y = input().split() for x in range(1, N): for y in range(1, N): if (N - x - y < 0) and (10000 * x + 5000 * y + 1000(N - x - y)) == Y: print(x, y, N - x - y)
s066358369
p03471
u774163366
1589589363
Python
PyPy3 (2.4.0)
py
Runtime Error
169
38256
380
import random N, Y = map(int, input().split()) lst = [] for i in range(N + 1): for j in range((N - i) + 1): for t in range((N - i -j) + 1): x = (10000 * i) + (5000 * j) + (1000 * t) if x == Y: lst.append([i,j,t]) if lst: p = random.randint(0, len(lst)) print(...
s986013637
p03471
u774163366
1589589250
Python
PyPy3 (2.4.0)
py
Runtime Error
167
38256
369
import random N, Y = map(int, input().split()) lst = [] for i in range(N + 1): for j in range((N - i) + 1): for t in range((N - i -j) + 1): x = (10000 * i) + (5000 * j) + (1000 * t) if x == Y: lst.append([i,j,t]) if lst: p = random.randint() print(lst[p][0], l...
s628406644
p03471
u774163366
1589513643
Python
PyPy3 (2.4.0)
py
Runtime Error
174
38256
374
import random N, Y = map(int, input().split()) lst = [] for i in range(N + 1): for j in range(N + 1): for t in range(N + 1): x = (10000 * i) + (5000 * j) + (1000 * t) if x == Y: lst.append([i,j,t]) if lst: r = random.randint(0, len(lst)) print(f'{lst[r][0]} ...
s529447801
p03471
u039192119
1589508914
Python
Python (3.4.3)
py
Runtime Error
17
2940
232
N,Y=map(int,input().split()) for x in range(N+1): for y in range(N-x+1): z=N-x-y if 10000*x+5000*y+1000*z==Y and 0<=z<=2000: print(x,y,z) break else: continue break print(-1,-1,-1)
s972868915
p03471
u039192119
1589508586
Python
Python (3.4.3)
py
Runtime Error
18
2940
201
N,Y=map(int,input().split()) for x in range(N+1): for y in range(N-x+1): z=N-x-y if 10000*x+5000*y+1000*z==Y: print(x,y,z) else: continue break print(-1,-1,-1)
s973072867
p03471
u039192119
1589508483
Python
Python (3.4.3)
py
Runtime Error
17
2940
207
N,Y=map(int,input().split()) for x in range(N+1): for y in range(N-x+1): z=N-x-y if 10000*x+5000*y+1000*z==Y: print(x,y,z) break else: continue break print(-1,-1,-1)
s826777075
p03471
u039192119
1589508190
Python
Python (3.4.3)
py
Runtime Error
18
2940
217
N,Y=map(int,input().split()) for x in range(N+1): for y in range(N-x+1): z=N-x-y if 10000*x+5000*y+1000*z==Y: print(x,y,z) break else: continue break print(-1,-1,-1)
s137219720
p03471
u854061980
1589502302
Python
PyPy2 (5.6.0)
py
Runtime Error
34
28012
335
n,y = map(int,input().split()) d = 0 for a in range(n+1):#10000 for b in range(n+1):#5000 c = n - a - b x = 10000*a + 5000*b + 1000*c if x == y and c >=0: print("{} {} {}".format(a,b,c)) d =1 break else: continue break if d == 0: pr...
s735701685
p03471
u854061980
1589501887
Python
Python (3.4.3)
py
Runtime Error
18
2940
294
for a in range(n):#10000 for b in range(n):#5000 c = n - a - b x = 10000*a + 5000*b + 1000*c if x == y and c >=0: print("{} {} {}".format(a,b,c)) d =1 break else: continue break if d == 0: print("-1 -1 -1")
s922944303
p03471
u788703383
1589420115
Python
Python (3.4.3)
py
Runtime Error
17
2940
270
n,Y = map(int,input().split()) y2 = Y // 1000 for a in range(n+1): y = y2 rest = y - a * 10 if rest < 0:break for b in range(n+1-a): rest -b * 5 < 0: break if n - a - b == rest - b * 5: print(a,b,n-a-b);exit() print(-1,-1,-1)
s240970106
p03471
u738622346
1589381291
Python
Python (3.4.3)
py
Runtime Error
20
3188
588
n, total = map(int, input().split(" ")) x = -1 y = -1 z = -1 num_max_10k = total // 10000 num_max_5k = total // 5000 num_max_1k = total // 1000 for num_10k in range (num_max_10k + 1): for num_5k in range(num_max_5k + 1): if (num_10k + num_5k >= n): num_1k = 0 else: num_1k ...
s636019722
p03471
u345966487
1589368743
Python
Python (3.4.3)
py
Runtime Error
17
3064
1245
#!/usr/bin/env python3 import sys import collections sys.setrecursionlimit(10 ** 8) read = sys.stdin.buffer.read readline = sys.stdin.buffer.readline readlines = sys.stdin.buffer.readlines N, Y = map(int, readline().split()) assert Y % 1000 == 0 Y //= 1000 def solve2(): for x1 in range(N + 1): for x2 in...
s110156919
p03471
u633203155
1589330382
Python
Python (3.4.3)
py
Runtime Error
17
3060
348
N, Y = map(int, input().split()) if Y / 1000 == N: print('0 0',N) man_max = Y // 10000 gosen_max = Y // 5000 is_exist = False for i_m in range(man_max+1): for i_g in range(gosen_max+1): if 99000*i_m + 4000*i_g == Y - 1000*N: print(i_m, i_g, int(Y / 1000 - 10*i_m - 5*i_g)) is_exist = True b...
s546411156
p03471
u346371758
1589151412
Python
Python (3.4.3)
py
Runtime Error
686
3060
273
n,y = map(int, input().split()) if y < 1000*n or y > 10000*n: print(-1, -1, -1) else: for i in range(1, n): for j in range(1, n-i): if 10000*i + 5000*j + 1000*(n-i-j) == y: print(str(i), str(o), str(n-i-o)) exit()
s666914346
p03471
u931889893
1589128315
Python
Python (3.4.3)
py
Runtime Error
18
2940
223
results = [-1, -1, -1] for x in range(N + 1): for y in range(N - x + 1): if Y == 10000 * x + 5000 * y + 1000 * (N - x - y): results = [x, y, (N - x - y)] print(results) exit()
s557758933
p03471
u629350026
1589071793
Python
Python (3.4.3)
py
Runtime Error
17
2940
220
x,y=map(int,input().split()) a1=-1 b1=-1 c1=-1 for a in range(0,x+1): for b in range(0,x+1-a): c=x-a-b if 10000*a+5000*b+1000*c==y: a1=a b1=b c1=c print(a1,b1,c1)
s842180153
p03471
u945839160
1588993211
Python
PyPy3 (2.4.0)
py
Runtime Error
182
38384
702
def resolve(): # 整数 1 つ # n = int(input()) # 整数複数個 n, y = map(int, input().split()) # 整数 N 個 (改行区切り) # N = [int(input()) for i in range(N)] # 整数 N 個 (スペース区切り) # N = list(map(int, input().split())) # 整数 (縦 H 横 W の行列) # A = [list(map(int, input().split())) for i in range(H)] f...
s412857919
p03471
u050622763
1588986443
Python
Python (3.4.3)
py
Runtime Error
2104
3064
353
n,yen = map(int,input().split()) bol = False for x in range(n+1): for y in range(n+1-x): for z in range(n+1-x-y): if 10000*x+5000*y+1000*z==yen: bol = True ans = [x,y,z] break if bol is True: break if bol is True: b...
s508702926
p03471
u258565089
1588956625
Python
Python (3.4.3)
py
Runtime Error
925
3060
368
import math import sys input = sys.stdin.readline N,Y = map(int, input().split()) flag=0 for i in range(0,N+1): for j in range(0,N-i): if(Y-10000*i-5000*j)/1000 == N-i-j : a = i b = j c = N-i-j flag =1 break if flag==1: break ...
s081634202
p03471
u612223903
1588887114
Python
Python (3.4.3)
py
Runtime Error
17
2940
206
n,Y = map(int,input().split()) Y = int(Y / 1000) ans = [-1,-1,-1] for x in range(n+1): for y in range(n+1): if 10*x + 5*y + (n-x-y) == Y and n-x-y => 0: ans = [x,y,n-x-y] print(*ans)
s214308372
p03471
u375172966
1588880923
Python
Python (3.4.3)
py
Runtime Error
17
2940
338
n, yen = map(int, input().split()) for x in range(n+1): for y in range(n+1): zz = yen - (10000*x + 5000*y) if zz%1000 != 0: continue z = int(zz / 1000) if z < 0: continue if x + y + z == n: print(f'{x} {y} {z}') exit() else: ...
s435467652
p03471
u737718679
1588861485
Python
Python (3.4.3)
py
Runtime Error
17
2940
13
2000 20000000
s645503117
p03471
u146346223
1588847009
Python
Python (3.4.3)
py
Runtime Error
18
2940
319
import sys N, Y = map(int, input().split()) find_ans = False for a in range(N+1): for b in range(N+1-a): c = N-a-b num = a*10000 + b*5000 + c*1000 if num == Y: print(f"{a} {b} {c}") find_ans = True sys.exit() if find_ans == False: print('-1 -1 -1')
s416897178
p03471
u945839160
1588808940
Python
PyPy3 (2.4.0)
py
Runtime Error
185
38768
705
def resolve(): # 整数 1 つ # n = int(input()) # 整数複数個 n, y = map(int, input().split()) # 整数 N 個 (改行区切り) # N = [int(input()) for i in range(N)] # 整数 N 個 (スペース区切り) # N = list(map(int, input().split())) # 整数 (縦 H 横 W の行列) # A = [list(map(int, input().split())) for i in range(H)] f...
s329013920
p03471
u057415180
1588740378
Python
Python (3.4.3)
py
Runtime Error
17
2940
319
n, d = map(int, input().split()) ans = [-1]*3 for x in range(n+1): for y in range(n-x+1): if d = 10000*x + 5000*y + 1000*(n-x-y): ans = [x, y, n-x-y] # if zd//1000 == n-x-y: # ans[0] = x # ans[1] = y # ans[2] = zd//1000 # break print(*ans)
s474605327
p03471
u785883180
1588718657
Python
PyPy3 (2.4.0)
py
Runtime Error
182
38640
238
n,y=map(int,input().split()) for a in range(n+1): for b in range(n-a+1): if y-10000*a-5000*b==1000*(n-a-b): print(a,b,n-b-a) flag=True break if flag: break if not flag: print("-1 -1 -1")
s571082634
p03471
u652656291
1588628835
Python
Python (3.4.3)
py
Runtime Error
656
3060
177
n,y = map(int,input().split()) for i in range(n+1): for j in range(n-i+1): if y == 10000*i+5000*j+1000*(n-i-j) : print(i,l,n-i-j) exit() print(-1,-1,-1)
s010008865
p03471
u652656291
1588628726
Python
Python (3.4.3)
py
Runtime Error
18
3060
191
import sys n,y = map(int,input().split()) for i in range(n+1): for j in range(n-i+1): if y == 10000*i+5000*j+1000(n-i-j) : print(i,l,n-i-j) sys.exit() print(-1,-1,-1)
s703798644
p03471
u135116520
1588627278
Python
Python (3.4.3)
py
Runtime Error
17
2940
209
N,Y=map(int,input().split()) for x in range(0,N+1): for y in range(N+1-x): for z in range(N+1-x-y): if 10000*x+5000*y+1000*z==Y: print(x,y,z) break else: print(-1,-1,-1)
s509146999
p03471
u702208001
1588555207
Python
Python (3.4.3)
py
Runtime Error
17
3064
430
n, m = int(input().split()) answer = (-1, -1, -1,) # (1万円, 五千円, 千円,) for x in range(n+1): # 一万円の枚数 0-9 for y in range(n-x+1): # 五千円の枚数 0-9 z = n - x - y # 千円の枚数 0-9 if 0 <= z <= 2000 and 10000 * x + 5000 * y + 1000 * z == m: answer = (x, y, z,) break else: ...
s851693781
p03471
u702208001
1588555116
Python
Python (3.4.3)
py
Runtime Error
17
3060
428
n, m = int(input().split()) answer = (-1, -1, -1,) # (1万円, 五千円, 千円,) for x in range(n+1): # 一万円の枚数 0-9 for y in range(n+1): # 五千円の枚数 0-9 z = n - x - y # 千円の枚数 0-9 if 0 <= z <= 2000 and 10000 * x + 5000 * y + 1000 * z == m: answer = (x, y, z,) break else: c...
s653344429
p03471
u151820863
1588553829
Python
Python (3.4.3)
py
Runtime Error
17
3060
315
def search(): for a in range(n + 1): for b in range(n - a + 1): c = n - a - b _sum = 10000 * a + 5000 * b + 1000 * c if y == _sum: return a, b, c return -1, -1, -1 (n, y) = list(map(int, input().split())) a, b, c = search() print(f'{a} {b} {c} ')
s767143034
p03471
u253422591
1588544629
Python
Python (3.4.3)
py
Runtime Error
17
2940
634
n, total = map(int, input().split()) min = n * 1000 max = n * 10000 if (total > max) or (total < min): print('-1 -1 -1') else min_man = total - (5000 * n) // 10000 n -= min_man total -= min_man*10000 min_sen = (total % 5000) / 1000 total -= min_sen*1000 n -= min_sen success = False for i in range(tota...
s841046340
p03471
u209426189
1588450470
Python
PyPy3 (2.4.0)
py
Runtime Error
188
38640
143
for j in range(n+1-i): k = n - i - j if 10000*i + 5000*j + 1000*k == y: print(i, j, k) break else: continue break
s410841495
p03471
u093783313
1588436708
Python
Python (3.4.3)
py
Runtime Error
18
3060
376
N , Y= map(int,input().split()) for i in range(N + 1): a = N + 1 b = a - i for j in range(b): c = b - j kingaku += 1000 * c + 5000 * b + 10000 * a if kingaku == Y: print(a,b,c) break else: continue break ...
s723882407
p03471
u307159845
1588435399
Python
Python (3.4.3)
py
Runtime Error
17
2940
727
N,Y = map(int, input().split()) a = -1 b = -1 c = -1 flag = 0 for i in range(N + 1): if flag == 1: break if Y - 10000 * i == 0: a = i b = 0 c = 0 if Y - 10000 * i - 5000 * (N - i)>= 0: for j in range(N + 1 - i): if flag == 1: break ...
s387318103
p03471
u307159845
1588435223
Python
Python (3.4.3)
py
Runtime Error
17
2940
722
N,Y = map(int, input().split()) a = -1 b = -1 c = -1 flag = 0 for i in range(N + 1): if flag == 1: break if Y - 10000 * i == 0: a = i b = 0 c = 0 if Y - 10000 * i - 5000 * N >= 0: for j in range(N + 1 - i): if flag == 1: bre...
s390545049
p03471
u912652535
1588338404
Python
Python (3.4.3)
py
Runtime Error
17
3064
408
count = 0 n , t = map(int,input().split()) for i in range(n+1): for j in range(n+1-i): k = t - i- j #for k in range(n+1-i-j):#このfor分は不要、i,jで決まるから if 10000 * i + 5000 * j + 1000 * k == t: x,y,z = i, j, k print('{} {} {}'.format(x, y ,z)) cou...
s020404587
p03471
u704158845
1588203713
Python
Python (3.4.3)
py
Runtime Error
17
3064
273
N, Y = map(int,input().split()) y = Y/1000 ans_a = -1 ans_b = -1 for i in range(1,2001): for j in range(1,2001): if i*9 + j*4 + N == y: ans_a = i ans_b = j if ans_a == -1: N = -1 print(str(ans_a)+' '+str(ans_b)+' '+str(N-ans_a-ans_b)
s261352075
p03471
u151785909
1588197478
Python
Python (3.4.3)
py
Runtime Error
18
2940
203
n , y = map(int,input().split()) y = y//1000 m = 0 for i in range(y//10+1): y1 = y-10*i - n +i if y1%4 == 0: if n-i-y1//4>=0: print(i,y1//4,n-i-y1//4) exit() print('-1 -1 -1')
s828507266
p03471
u625495026
1588182918
Python
Python (3.4.3)
py
Runtime Error
17
2940
234
n,y=map(int,input().split()) for i in range(n+1): for j in range(n+1-i): z_m=y-(10000*i+5000*j) z_n=n-(i+j) if z_m>=0 and z_m//1000==z_n: print(i,j,z_n) exit() print(-1,-1,-1)
s614740063
p03471
u821775079
1588181874
Python
Python (3.4.3)
py
Runtime Error
17
3060
205
N,Yen=map(int,input()) def solver(n,yen): for x in range(n+1): for y in range(n-x+1): z=n-x-y if x*10000+y*5000+z*1000 == yen: return x,y,z return -1,-1,-1 print(solver(N,Yen))
s886491828
p03471
u437215432
1588108332
Python
Python (3.4.3)
py
Runtime Error
17
2940
253
# ABC085C n, y = map(int, input().split()) for i in range(n+1): for j in range(n-i+1): k = n - i - j if k >= 0: if y == i*10000 + j*5000 + k*1000: print(i, j, k) return print(-1, -1, -1)
s942849012
p03471
u018976119
1588029622
Python
Python (3.4.3)
py
Runtime Error
17
2940
198
N,X=map(int,input().split()) for x in range(N+1): for y in range(N+1-y): z=N-x-y if 10000*x+5000*y+1000*z==X: print(x,y,z) exit() print(-1,-1,-1)
s358744411
p03471
u444722572
1587870593
Python
Python (3.4.3)
py
Runtime Error
17
2940
246
N=int(input()) Y=int(input()) a=-1 b=-1 c=-1 for i in range(2000): for j in range(2000): if i*10000+j*5000+1000*(N-i-j)==Y: a=i b=j c=N-i-j break print(a,b,c)
s723540704
p03471
u549161102
1587756669
Python
Python (3.4.3)
py
Runtime Error
17
3060
188
N,Y = map(int, input().split()) for i in range(N+1): for j in range(N+1-i): k = N-i-j if Y == 10000*i + 5000*j + 1000*k: print(i j k) sys.exit() print(-1 -1 -1)
s448142894
p03471
u549161102
1587756264
Python
Python (3.4.3)
py
Runtime Error
17
2940
197
N,Y = map(int, input().split()) for i in range(N+1): for j in range(N+1): for k in range(N+1): if Y == 10000*i + 5000*j + 1000*k: print(i j k) sys.exit() print(-1 -1 -1)
s359602714
p03471
u679520304
1587581525
Python
PyPy3 (2.4.0)
py
Runtime Error
165
38256
281
N,Y = map(int,input().split()) change = False for i in range(N+1): for j in range(N+1-i): if i*10000+j*5000+(N-i-j)*1000==Y: print(i,j,N-i-j) change = True break else: break if change != True: print("-1 -1 -1")
s333507198
p03471
u130203301
1587539337
Python
PyPy3 (2.4.0)
py
Runtime Error
173
38256
256
def fun(n, y): for i in range(y//10000+1): for j in range((y - 10000*i)//5000+1): k = (y - 10000*i - 5000*j)//1000 if i + j + k == n: print(i, j, k) break print(-1, -1, -1) fun(n, y)
s105567132
p03471
u100873497
1587342832
Python
Python (3.4.3)
py
Runtime Error
783
3060
216
n,y = map(int,input().split()) for a in range(n+1): for b in range(n+1-a): c=n-a-b if y==a*10000+b*5000+c*1000 and n==a+b+c: i=a j=b k=c break print(i,j,k)
s833974766
p03471
u399116467
1587225017
Python
Python (2.7.6)
py
Runtime Error
10
2580
26
n,q=int(input() , input())
s390171735
p03471
u399116467
1587224950
Python
Python (2.7.6)
py
Runtime Error
10
2568
315
n,q=int(input() , input()) for i in range(0 , n): for j in range(0 , n-i): if i * 10000 + j * 5000 + (n - i - j) * 1000 = q: print i print " " print j print " " print n - i - j; print "\n" sys.exit() print "-1 -1 -1 \n"
s082402240
p03471
u399116467
1587224900
Python
Python (2.7.6)
py
Runtime Error
10
2568
316
n,q=int(input() , input()) for i in range(0 , n): for j in range(0 , n-i): if i * 10000 + j * 5000 + (n - i - j) * 1000 == q: print i print " " print j print " " print n - i - j; print "\n" sys.exit() print "-1 -1 -1 \n"
s687770308
p03471
u399116467
1587224870
Python
Python (2.7.6)
py
Runtime Error
11
2568
316
n,q=int(input() , input()) for i in range(0 , n): for j in range(0 , n-i): if i * 10000 + j * 5000 + (n - i - j) * 1000 == q: print i print " " print j print " " print n - i - j; print "\n" sys.exit() print "-1 -1 -1 \n"
s406882908
p03471
u399116467
1587224746
Python
Python (2.7.6)
py
Runtime Error
11
2692
322
n,q=map(int,raw_input().split()) for i in range(0 , n): for j in range(0 , n-i): if i * 10000 + j * 5000 + (n - i - j) * 1000 == y: print i print " " print j print " " print n - i - j; print "\n" sys.exit() print "-1 -1 -1 \...
s322559310
p03471
u581603131
1587220892
Python
Python (3.4.3)
py
Runtime Error
18
3064
416
N, Y = map(int, input().split()) ans = 0 a = 0 b = 0 c = 0 for a in range(N+1): for b in range(N-a+1): c = N - a - b if (a*10000 + b*5000 + c*1000) == Y: ans = 1 x = a y = b z = c flag = True #フラグ変数で代用しても良い break if flag: ...
s247696814
p03471
u581603131
1587161677
Python
Python (3.4.3)
py
Runtime Error
18
2940
308
N, Y = map(int, input().split()) x = 0 y = 0 z = 0 ans = 0 for i in range(1,N): for k in range(1,N): z = N - i - k if (i*10000 + k*5000 + z*1000 )== Y and: x = i y = k ans = 1 break if ans == 1: print(x,y,z) else: print( '-1 -1 -1')
s612803683
p03471
u506549878
1587148788
Python
Python (3.4.3)
py
Runtime Error
723
3064
335
n, m =map(int,input().split()) flg=0 for i in range(n+1): for j in range(n-i+1): if 10000*i+5000*j+1000*(n-i-j)==m: flg = 1 x = i y = j z = k break else: continue break if flg==0: print(-1,-1,-1) else: ...
s125249897
p03471
u588526762
1587088467
Python
Python (3.4.3)
py
Runtime Error
644
2940
197
N, Y = map(int, input().split()) for i in range(N+1): for j in range(N-i+1): if 10000*i + 5000*j + 1000*(N-i-j) == Y: print(i, j, n-i-j) exit() print('-1 -1 -1')
s880168972
p03471
u602158689
1586981551
Python
Python (3.4.3)
py
Runtime Error
18
2940
326
temp = input().split() n,total = int(temp[0]), int(temp[1]) for a in range(n): for b in range(n): for c in range(n): if a*10000 + b*5000 + c*1000 == total: print(f"{a} {b} {c}") break else: continue break else: continue ...
s869403301
p03471
u345136423
1586917426
Python
Python (3.4.3)
py
Runtime Error
20
3320
254
例 N,Y=map(int,input().split()) answer=-1,-1,-1 for x in range(N+1): for y in range(N-x+1): z=N-x-y if 0<=z<=2000 and 10000*x+5000*y+1000*z==Y: answer=x,y,z break else: continue print(*answer)
s408273849
p03471
u742899538
1586888539
Python
Python (3.4.3)
py
Runtime Error
17
3192
662
N, Y = list(map(int, input().split())) q = [(N, 0, 0)] while len(q) > 0: hyp = q.pop() num = hyp[0] + hyp[1] + hyp[2] currency = 10000 * hyp[0] + 5000 * hyp[1] + 1000 * hyp[2] if num == N and currency == Y: q.append(hyp) break if currency < Y: continue #### 10000円札 ...
s162955600
p03471
u107798522
1586817296
Python
Python (3.4.3)
py
Runtime Error
18
3060
356
#C - Otoshidama N, Y = map(int, input().split()) x_ans = -1 y_ans = -1 z_ans = -1 flg = 0 for x in range(N+1): for y in range(N+1-x): otoshidama = 10000*x + 5000*y + 1000*(N-x-z) if otoshidama == Y : flg = 1 x_ans = x y_ans = y z_ans = z print(x_ans,...
s775062121
p03471
u238951197
1586731336
Python
Python (3.4.3)
py
Runtime Error
17
3064
267
x=N y=0 z=0 def judg(x,y,z): if Y==x*10000+y*5000+z*1000: print(x,y,z) exit() for i in range(N+1): x1=x-i y=i if Y==x1*10000+y*5000+z*1000: print(x1,y,z) exit() else : for j in range(i+1): y1=y-j z1=z+j judg(x1,y1,z1)
s272259908
p03471
u063896676
1586648026
Python
Python (3.4.3)
py
Runtime Error
18
2940
361
# coding: utf-8 # https://atcoder.jp/contests/abc085/tasks/abc085_c # 19:24- def main(): N, Y = map(int, input().split()) y = Y // 1000 for b in range(N+1): if (y-N-4*b) % 9 == 0: c = (y-N-4*b) // 9 a = N - b - c if a >= 0: return f"{c} {b} {a}...
s781667338
p03471
u416011173
1586572729
Python
Python (3.4.3)
py
Runtime Error
17
3064
980
# -*- coding: utf-8 -*- # D - katana Thrower # モジュールのインポート import math # 標準入力の取得 N,H = list(map(int, input().split())) a,b = [],[] for n in range(N): a_n,b_n = list(map(int, input().split())) a.append(a_n) b.append(b_n) # 求解処理 """ すでに投げてしまった刀も振ることはできるとしても答えは変わらない。 以下の攻撃手順を行う: 0. a_1, a_2, ・・・,...
s835655217
p03471
u409542115
1586461830
Python
Python (3.4.3)
py
Runtime Error
1626
3060
599
N, Y = map(int, input().split()) a = 0 for i in range(N): for ii in range(N): iii = N - i - ii ans = 10000 * i + 5000 * ii + 1000 * iii if ans == Y and J == N: print(i,ii,iii) a += 1 break #for iii in range(N): # ans = 100...
s879288637
p03471
u189397279
1586288097
Python
Python (3.4.3)
py
Runtime Error
17
2940
243
N, Y = map(int, input().split(" ")) A = -1 B = -1 C = -1 for a in range(N + 1): for b in range(N + 1 - a): c = N + 1 - a - b if (10000 * a + 5000 * b + 1000 * c == Y) and A = a B = b C = c print(A, B, C)
s292391399
p03471
u211805975
1586108807
Python
Python (3.4.3)
py
Runtime Error
1595
3060
259
n,y = map(int,input().split()) #n枚,y円 a = -1 b = -1 c = -1 for i in range(n+1): for j in range(n+1): k = n-i-j if i*10000+j*5000+k*1000 == y and z >= 0 : a = i b = j c = k print(a,b,c)
s081367010
p03471
u212328220
1586027198
Python
Python (3.4.3)
py
Runtime Error
18
2940
244
N, Y = map(int, input().split()) answer = '-1 -1 -1' for x in range(N+1): for y in range(N+1): z = N - x - y if 10000*x + 5000*y + 1000*z == Y and z >= 0: answer = f'{x} {y} {z}' break print(answer)
s544446247
p03471
u212328220
1586026611
Python
Python (3.4.3)
py
Runtime Error
17
2940
251
N, Y = map(int, input().split()) answer = '-1 -1 -1' for x in range(0,N+1): for y in range(0,N+1): z = N - x - y if 10000*x + 5000*y + 1000*z == Y and z >= 0: answer = f'{x} {y} {z}' break print(answer)
s407224625
p03471
u212328220
1586026124
Python
Python (3.4.3)
py
Runtime Error
17
2940
307
N, Y = map(int, input().split()) answer = '-1 -1 -1' for x in range(0,N+1): for y in range(0,N+1): z = N - x - y if 10000*x + 5000*y + 1000*z == Y and x + y + z == N and z >= 0: answer = f'{x} {y} {z}' break else: continue break print(answer)
s275474747
p03471
u212328220
1586025651
Python
Python (3.4.3)
py
Runtime Error
17
2940
362
N, Y = map(int, input().split()) answer = '-1 -1 -1' for x in range(0,N+1): for y in range(0,N+1): for z in range(0,N+1): if 10000*x + 5000*y + 1000*z == Y and x + y + z == N: answer = f'{x} {y} {z}' break else: continue break else...
s818587721
p03471
u212328220
1586025439
Python
Python (3.4.3)
py
Runtime Error
18
3188
366
N, Y = map(int, input().split()) answer = '-1 -1 -1' for x in range(0,N+1): for y in range(0,N+1): for z in range(0,N+1): if 10000*x + 5000*y + 1000*z == Y and x + y + z == N: answer = f'{x} {y} {z}' break else: continue break else...
s735912362
p03471
u626467464
1585770208
Python
Python (3.4.3)
py
Runtime Error
17
3060
291
n,y = map(int,input().split()) count = 0 for a in range(2001): for b in range(2001): c = n - a - b if 10000*a + 5000*b + 1000*c == y and 0 <= c <= 2000: print(str(a) + " " + str(b) + " " + str(c)) count += 1 break if count == 1: break if count == 1: break
s826136535
p03471
u626467464
1585769550
Python
Python (3.4.3)
py
Runtime Error
1643
3064
255
n,y = map(int,input().split()) box = [] for a in range(2001): for b in range(2001): c = n - a - b if 10000*a + 5000*b + 1000*c == y and 0 <= c <= 2000: box.append([a,b,c]) print(str(box[0][0]) + " " + str(box[0][1]) + " " + str(box[0][2]))
s341116008
p03471
u214936751
1585767669
Python
Python (3.4.3)
py
Runtime Error
17
3060
210
N, Y = map(int, input().split()) for z in range(N+1): for y in range(N-x+1): if (Y-y-z)*10000 + y*5000 + z*1000 == Y: print((Y-y-z), y, z) exit() else: print("-1 -1 -1")
s497910924
p03471
u964299793
1585625400
Python
Python (3.4.3)
py
Runtime Error
17
3064
264
n=int(input()) a=list(map(int,input().split())) b=list(map(int,input().split())) c=list(map(int,input().split())) a.sort() b.sort() c.sort() n=len(a) j=0 k=0 for i in range(n): while j<n and b[j]<=a[i]: j+=1 while k<n and c[k]<=b[j]: k+=1
s497006156
p03471
u034128150
1585503723
Python
Python (3.4.3)
py
Runtime Error
18
3188
330
a, b, c, x, y = map(int, input().split()) possible_minimum_sum1 = a * x + b * y possible_minimum_sum2 = c * max(a, b) * 2 possible_minimum_sum3 = c * a * 2 + max(b-a, 0) * b possible_minimum_sum4 = c * b * 2 + max(a-b, 0) * a print(min(possible_minimum_sum1, possible_minimum_sum2, possible_minimum_sum3, possible_minim...