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
s319880412
p01128
u598551137
1514371101
Python
Python3
py
Runtime Error
0
0
710
for i in range(int(input())): xa, ya, xb, yb = map(int, input().split(' ')) n = int(input()) ip = [] for j in range(n): xs, ys, xt, yt, o, l = map(int, input().split(' ')) d = (xb - xa) * (yt - ys) - (yb - ya) * (xt - xs) if d == 0: continue t0 = ((yt - ys) * ...
s429009128
p01128
u598551137
1514378954
Python
Python3
py
Runtime Error
0
0
707
for i in range(int(input())): xa, ya, xb, yb = map(int, input().split(' ')) n = int(input()) ip = [] for j in range(n): xs, ys, xt, yt, o, l = map(int, input().split(' ')) d = (xb - xa) * (yt - ys) - (yb - ya) * (xt - xs) if d == 0: continue t0 = ((yt - ys) * ...
s007181053
p01130
u633068244
1424701888
Python
Python
py
Runtime Error
19920
4648
552
inf = 10**10 while 1: n,m,s,g1,g2 = map(int,raw_input().split()) if n == 0: break s,g1,g2 = s-1,g1-1,g2-1 G = [[inf]*n for i in xrange(n)] for loop in xrange(m): b1,b2,c = map(int,raw_input().split()) G[b1-1][b2-1] = c for k in xrange(n): for i in xrange(n): f...
s136274975
p01130
u797673668
1461151762
Python
Python3
py
Runtime Error
0
0
1564
from heapq import heapify, heappop, heappush from operator import add while True: n, m, s, g1, g2 = map(int, input().split()) s -= 1 g1 -= 1 g2 -= 1 if not n: break pipes = [set() for _ in range(n)] for _ in range(m): b1, b2, c = map(int, input().split()) b1 -= 1 ...
s973515961
p01131
u352394527
1531255687
Python
Python3
py
Runtime Error
0
0
667
#include <iostream> #include <string> #include <vector> using namespace std; int main(void){ int n, i, cnt; string str, ans; char init; vector<string> mp{"", ".,!? ","abc","def", "ghi", "jkl", "mno", "pqrs", "tuv", "wxyz"}; cin >> n; while(n--){ cin >> str; ans = ""; i = 0; while(i < str.le...
s161856983
p01131
u489876484
1556126420
Python
Python3
py
Runtime Error
0
0
467
N = int(input()) d = [] d.append([]) d.append([".",",","!","?"]) d.append(["a","b","c"]) d.append(["d","e","f"]) d.append(["g","h","i"]) d.append(["j","k","l"]) d.append(["m","n","o"]) d.append(["p","q","r","s"]) d.append(["t","u","v"]) d.append(["w","x","y","z"]) for _ in range(N): nn = input() output = "" ...
s909570350
p01131
u489876484
1556126621
Python
Python3
py
Runtime Error
0
0
480
N = int(input()) d = [] d.append([]) d.append([".",",","!","?"]) d.append(["a","b","c"]) d.append(["d","e","f"]) d.append(["g","h","i"]) d.append(["j","k","l"]) d.append(["m","n","o"]) d.append(["p","q","r","s"]) d.append(["t","u","v"]) d.append(["w","x","y","z"]) for _ in range(N): nn = input() output = "" ...
s286972724
p01131
u338932851
1450245749
Python
Python
py
Runtime Error
0
0
787
d = {1:{1:'.',2:',',3:'!',4:'?',5:' '}, 2:{1:'a',2:'b',3:'c'}, 3:{1:'d',2:'e',3:'f'}, 4:{1:'g',2:'h',3:'i'}, 5:{1:'j',2:'k',3:'l'}, 6:{1:'m',2:'n',3:'o'}, 7:{1:'p',2:'q',3:'r',4:'s'}, 8:{1:'t',2:'u',3:'v'}, 9:{1:'w',2:'x',3:'y',4:'z'} } n = int(raw_input()) for i in range(n): ...
s809852332
p01131
u338932851
1450245939
Python
Python
py
Runtime Error
0
0
776
d = {1:{1:'.',2:',',3:'!',4:'?',5:' '}, 2:{1:'a',2:'b',3:'c'}, 3:{1:'d',2:'e',3:'f'}, 4:{1:'g',2:'h',3:'i'}, 5:{1:'j',2:'k',3:'l'}, 6:{1:'m',2:'n',3:'o'}, 7:{1:'p',2:'q',3:'r',4:'s'}, 8:{1:'t',2:'u',3:'v'}, 9:{1:'w',2:'x',3:'y',4:'z'} } n = int(raw_input()) for i in range(n): ...
s611136627
p01131
u166860661
1480857482
Python
Python
py
Runtime Error
0
0
615
#coding: utf-8 import sys def keitai(n1,n2): li1 = ['.', ',', '!', '?'] li2 = ['a','b','c'] li3 = ['d','e','f'] li4 = ['g','h','i'] li5 = ['j','k','l'] li6 = ['m','n','o'] li7 = ['p','q','r','s'] li8 = ['t','u','v'] li9 = ['w','x','y','z'] li = [li1,li2,li3,li4,li5,li6,li7,li8...
s290713083
p01131
u166860661
1480857707
Python
Python
py
Runtime Error
0
0
691
#coding: utf-8 import sys def keitai(n1,n2): li1 = ['.', ',', '!', '?'] li2 = ['a','b','c'] li3 = ['d','e','f'] li4 = ['g','h','i'] li5 = ['j','k','l'] li6 = ['m','n','o'] li7 = ['p','q','r','s'] li8 = ['t','u','v'] li9 = ['w','x','y','z'] li = [li1,li2,li3,li4,li5,li6,li7,li8...
s683647073
p01131
u166860661
1480858200
Python
Python
py
Runtime Error
0
0
678
#coding: utf-8 import sys def keitai(n1,n2): li1 = ['.', ',', '!', '?',' '] li2 = ['a','b','c'] li3 = ['d','e','f'] li4 = ['g','h','i'] li5 = ['j','k','l'] li6 = ['m','n','o'] li7 = ['p','q','r','s'] li8 = ['t','u','v'] li9 = ['w','x','y','z'] li = [li1,li2,li3,li4,li5,li6,li7...
s674091895
p01131
u166860661
1480858404
Python
Python
py
Runtime Error
0
0
686
#coding: utf-8 n = raw_input() def keitai(n1,n2): li1 = ['.', ',', '!', '?',' '] li2 = ['a','b','c'] li3 = ['d','e','f'] li4 = ['g','h','i'] li5 = ['j','k','l'] li6 = ['m','n','o'] li7 = ['p','q','r','s'] li8 = ['t','u','v'] li9 = ['w','x','y','z'] li = [li1,li2,li3,li4,li5,li...
s830770755
p01131
u399892098
1485944983
Python
Python
py
Runtime Error
0
0
430
import re di = {1:".,!? ",2:"abc",3:"def",4:"ghi" ,5:"jkl",6:"mno",7:"pqrs",8:"tuv",9:"wxyz"} while True: str = "" line = raw_input() if line.endswith("0") is False: break list = re.split("0+",line) for line in list: if line is not '': index = (len(line)-1)%len(...
s833173897
p01131
u399892098
1485945059
Python
Python
py
Runtime Error
0
0
370
import re di = {1:".,!? ",2:"abc",3:"def",4:"ghi" ,5:"jkl",6:"mno",7:"pqrs",8:"tuv",9:"wxyz"} while True: str = "" line = raw_input() if line.endswith("0") is False: break list = re.split("0+",line) for line in list: if line is not '': str += di[int(line[:1])][(...
s551801670
p01131
u399892098
1485945855
Python
Python
py
Runtime Error
0
0
453
import re di = {1:".,!? ",2:"abc",3:"def",4:"ghi" ,5:"jkl",6:"mno",7:"pqrs",8:"tuv",9:"wxyz"} while True: str = "" line = raw_input() if line.endswith("0") is False: break list = re.split("0+",line) for line in list: if line is not '' and len(set(line)) < 2: fir...
s006266887
p01131
u399892098
1491801738
Python
Python
py
Runtime Error
0
0
518
import sys di = {1:".,!? ",2 :"abc",3:"def",4:"ghi",5:"jkl",6:"mno",7:"pqrs",8:"tuv",9:"wxyz"} while True: a = raw_input() count = 0 le = 999 fl = False for letter in a: if(letter == "0"): if(le == 999): pass else: sys.stdout.write(di[l...
s491653430
p01131
u399892098
1491801762
Python
Python
py
Runtime Error
0
0
518
import sys di = {1:".,!? ",2 :"abc",3:"def",4:"ghi",5:"jkl",6:"mno",7:"pqrs",8:"tuv",9:"wxyz"} while True: a = raw_input() count = 0 le = 999 fl = False for letter in a: if(letter == "0"): if(le == 999): pass else: sys.stdout.write(di[l...
s398774135
p01131
u301729341
1500132872
Python
Python3
py
Runtime Error
0
0
818
moji_lis = [[".",",","!","?"," "],["a","b","c"],["d","e","f"],["g","h","i"],["j","k","l"],["m","n","o"],["p","q","r","s"],["t","u","v"],["w","x","y","z"]] n = int(input()) for i in range(n): N_lis = list(input()) N_lis = list(map(int,N_lis)) a_0 = N_lis[0] n_num = 1 moji = "" for j in range...
s502701673
p01131
u011621222
1528895413
Python
Python3
py
Runtime Error
0
0
384
K = '.,!? ' A = 'abc' D = 'def' G = 'ghi' J = 'jkl' M = 'mno' P = 'pqrs' T = 'tuv' W = 'wxyz' L = ['', K, A, D, G, J, M, P, T, W] while 1: S = [] n = input() if not '0' in n: print('') else: n = n.split('0') for ns in n: if ns == '': continue i = len(ns) % len(L[int(ns[0])]) S += [[L[int(ns[0])...
s325151004
p01131
u136916346
1529988561
Python
Python3
py
Runtime Error
0
0
642
from itertools import cycle as c n=int(input()) for _ in range(n): tt=input() l=[] t="" for (i,j) in enumerate(tt): ct=int(j) if ct==0 or i==0: if i!=0: l.extend([t]) t="" kk=[c([".",",","!","?"," "]), c(["a","b","c...
s730481314
p01131
u107750881
1379326974
Python
Python
py
Runtime Error
0
0
505
#include <iostream> using namespace std; string kei[] = {".,!? ","abc","defd","ghi", "jkl","mno","pqrs","tuv","wxyz",}; int main(){ string str; int n; cin >> n; while(n--){ cin >> str; int cnt = 0; for(int i = 0 ; i < str.size()-1 ; i++ ){ if(str[i] == str[i+1]&&str[i] != '0')cnt++; i...
s784601001
p01131
u093607836
1382868961
Python
Python
py
Runtime Error
0
0
375
from sys import stdin from itertools import groupby a = ['_','.,!? ','abc','def','ghi','jkl','mno','pqrs','tuv','wxyz'] for i in input(): b = [[i for i in j] for i,j in groupby(raw_input())] c = [] d = '' for i in b: index = int(i[0]) s = a[index][(len(i))%len(a[index])-1] if s == '_': d = d + ''.join(c) ...
s710384915
p01132
u633068244
1421851427
Python
Python
py
Runtime Error
19930
4284
1071
coins = [10,50,100,500] while 1: cost = int(raw_input()) if cost == 0: break c = map(int,raw_input().split()) num = sum(c) mn = num ans = [0,0,0,0] for i in range(c[0]+1): for j in range(c[1]+1): for k in range(c[2]+1): for l in range(c[3]+1): ...
s944992060
p01132
u316268279
1421908564
Python
Python3
py
Runtime Error
19920
6912
734
#!/usr/bin/env python # -*- coding: utf-8 -*- from itertools import product coins = [10,50,100,500] def coin_count(num): count = 0 for coin in sorted(coins,reverse = True): count += num // coin num -= (num // coin)*coin return count while True: price = int(input()) if price == 0: ...
s193604022
p01132
u120360464
1423122573
Python
Python
py
Runtime Error
19930
4280
1113
#! /usr/bin/python # -*- coding: utf-8 -*- def change(val): v500 = val/500 v100 = (val-v500)/100 v50 = (val%100)/50 v10 = (val%50)/10 return v10+v50+v100+v500 n = int(raw_input()) cnt = 0 while n!=0: if cnt > 0: print (c10, c50, c100, c500) = map(int, raw_input().split()) Min =...
s635377116
p01132
u408260374
1432029536
Python
Python3
py
Runtime Error
19930
6760
1155
def makeCahnge(c): money = c ret = [] for i in [500, 100, 50, 10]: ret.append(money // i) money %= i return ret[::-1] ansOut = [] while True: price = int(input()) if price == 0: break c10, c50, c100, c500 = map(int, input().split()) ans = 20*4+1 anspay = [0, 0, 0, 0]...
s978028985
p01132
u584779197
1495959929
Python
Python
py
Runtime Error
0
0
3220
while True: import copy pay = int(input()) if pay == 0: break else: num = input() l = num.split(' ') m10 = int(l[0]) m50 = int(l[1]) m100 = int(l[2]) m500 = int(l[3]) m10s = int(copy.deepcopy(l[0])) m50s = int(copy.deepcopy...
s756294212
p01132
u584779197
1495961033
Python
Python
py
Runtime Error
0
0
3233
while True: import copy pay = int(input()) if pay == 0: break else: num = input() l = num.split(' ') m10 = int(l[0]) m50 = int(l[1]) m100 = int(l[2]) m500 = int(l[3]) m10s = int(copy.deepcopy(l[0])) m50s = int(copy.deepcopy...
s442485526
p01132
u584779197
1495961350
Python
Python
py
Runtime Error
0
0
3272
while True: import copy pay = int(input()) if pay == 0: break else: num = input() l = num.split(' ') m10 = int(l[0]) m50 = int(l[1]) m100 = int(l[2]) m500 = int(l[3]) m10s = int(copy.deepcopy(l[0])) m50s = int(copy.deepcopy...
s106061830
p01132
u635391238
1508244029
Python
Python3
py
Runtime Error
0
0
1348
def back_oturigation(fee, coin_values, coin_nums): """ 1. ????????????????????????????????£?????????????????? 2. 1???????????????????????????????????????????????????????????? ???????????§?????????????????????-> ?°????????????????????¶??????????????????? 3. 2????????????????????°?????????????????...
s014185569
p01132
u635391238
1508244093
Python
Python3
py
Runtime Error
0
0
1348
def back_oturigation(fee, coin_values, coin_nums): """ 1. ????????????????????????????????£?????????????????? 2. 1???????????????????????????????????????????????????????????? ???????????§?????????????????????-> ?°????????????????????¶??????????????????? 3. 2????????????????????°?????????????????...
s664492834
p01132
u635391238
1508310227
Python
Python3
py
Runtime Error
0
0
1511
def back_oturigation(fee, coin_values, coin_nums): """ 1. ????????????????????????????????£?????????????????? 2. 1???????????????????????????????????????????????????????????? ???????????§?????????????????????-> ?°????????????????????¶??????????????????? 3. 2????????????????????°?????????????????...
s245870654
p01132
u635391238
1508310302
Python
Python3
py
Runtime Error
0
0
1511
def back_oturigation(fee, coin_values, coin_nums): """ 1. ????????????????????????????????£?????????????????? 2. 1???????????????????????????????????????????????????????????? ???????????§?????????????????????-> ?°????????????????????¶??????????????????? 3. 2????????????????????°??????????????????...
s361409631
p01132
u635391238
1508310341
Python
Python3
py
Runtime Error
0
0
1487
def back_oturigation(fee, coin_values, coin_nums): """ 1. ????????????????????????????????£?????????????????? 2. 1???????????????????????????????????????????????????????????? ???????????§?????????????????????-> ?°????????????????????¶??????????????????? 3. 2????????????????????°??????????????????...
s140430022
p01132
u635391238
1508310395
Python
Python3
py
Runtime Error
0
0
1511
def back_oturigation(fee, coin_values, coin_nums): """ 1. ????????????????????????????????£?????????????????? 2. 1???????????????????????????????????????????????????????????? ???????????§?????????????????????-> ?°????????????????????¶??????????????????? 3. 2????????????????????°??????????????????...
s657940146
p01132
u635391238
1508310520
Python
Python3
py
Runtime Error
0
0
1552
def back_oturigation(fee, coin_values, coin_nums): """ 1. ????????????????????????????????£?????????????????? 2. 1???????????????????????????????????????????????????????????? ???????????§?????????????????????-> ?°????????????????????¶??????????????????? 3. 2????????????????????°??????????????????...
s875133597
p01132
u635391238
1508310643
Python
Python3
py
Runtime Error
0
0
1554
def back_oturigation(fee, coin_values, coin_nums): """ 1. ????????????????????????????????£?????????????????? 2. 1???????????????????????????????????????????????????????????? ???????????§?????????????????????-> ?°????????????????????¶??????????????????? 3. 2????????????????????°??????????????????...
s396102916
p01132
u635391238
1508310926
Python
Python3
py
Runtime Error
0
0
1506
def back_oturigation(fee, coin_values, coin_nums): """ 1. ????????????????????????????????£?????????????????? 2. 1???????????????????????????????????????????????????????????? ???????????§?????????????????????-> ?°????????????????????¶??????????????????? 3. 2????????????????????°??????????????????...
s577825371
p01132
u635391238
1508310992
Python
Python3
py
Runtime Error
0
0
1043
def back_oturigation(fee, coin_values, coin_nums): oturi = coin_values[0] * coin_nums[0] \ + coin_values[1] * coin_nums[1] \ + coin_values[2] * coin_nums[2] \ + coin_values[3] * coin_nums[3] \ - fee use_coins = [0] * len(coin_values) no_use_coins = [0] * len(c...
s592842545
p01132
u635391238
1508311189
Python
Python3
py
Runtime Error
0
0
1379
def back_oturigation(fee, coin_values, coin_nums): """ 1. ????????????????????????????????£?????????????????? 2. 1???????????????????????????????????????????????????????????? ???????????§?????????????????????-> ?°????????????????????¶??????????????????? 3. 2????????????????????°????????????????...
s112136158
p01132
u635391238
1508311228
Python
Python3
py
Runtime Error
0
0
1418
# http://www.deqnotes.net/acmicpc/p0006/ def back_oturigation(fee, coin_values, coin_nums): """ 1. ????????????????????????????????£?????????????????? 2. 1???????????????????????????????????????????????????????????? ???????????§?????????????????????-> ?°????????????????????¶??????????????????? 3....
s556799400
p01132
u635391238
1508311316
Python
Python3
py
Runtime Error
0
0
1369
def back_oturigation(fee, coin_values, coin_nums): """ 1. ????????????????????????????????£?????????????????? 2. 1???????????????????????????????????????????????????????????? ???????????§?????????????????????-> ?°????????????????????¶??????????????????? 3. 2????????????????????°??????????????????...
s260560939
p01132
u635391238
1508311371
Python
Python3
py
Runtime Error
0
0
2416
# http://www.deqnotes.net/acmicpc/p0006/ import re # def check_testcase(): # with open('./2007-input.txt') as f: # input_testcase = f.read() # with open('./2007-output.txt') as f: # pre_output_testcase = f.read() # input_testcase = input_testcase.splitlines() # pre_output_testcase = re...
s360000389
p01132
u635391238
1508311522
Python
Python3
py
Runtime Error
0
0
2430
# http://www.deqnotes.net/acmicpc/p0006/ import re # def check_testcase(): # with open('./2007-input.txt') as f: # input_testcase = f.read() # with open('./2007-output.txt') as f: # pre_output_testcase = f.read() # input_testcase = input_testcase.splitlines() # pre_output_testcase = re...
s446348084
p01132
u635391238
1508754690
Python
Python3
py
Runtime Error
0
0
2431
# http://www.deqnotes.net/acmicpc/p0006/ import re import numpy as np def check_testcase(): with open('./2007-input.txt') as f: input_testcase = f.read() with open('./2007-output.txt') as f: pre_output_testcase = f.read() input_testcase = input_testcase.splitlines() pre_output_testcase...
s372579575
p01132
u635391238
1508754727
Python
Python3
py
Runtime Error
0
0
1496
# http://www.deqnotes.net/acmicpc/p0006/ import re import numpy as np def back_oturigation(fee, coin_values, coin_nums): """ 1. ????????????????????????????????£?????????????????? 2. 1???????????????????????????????????????????????????????????? ???????????§?????????????????????-> ?°?????????????????...
s990556919
p01132
u635391238
1508754791
Python
Python3
py
Runtime Error
0
0
1499
# http://www.deqnotes.net/acmicpc/p0006/ import re import numpy def back_oturigation(fee, coin_values, coin_nums): """ 1. ????????????????????????????????£?????????????????? 2. 1???????????????????????????????????????????????????????????? ???????????§?????????????????????-> ?°????????????????????¶??...
s493237403
p01132
u635391238
1508754827
Python
Python3
py
Runtime Error
0
0
1113
import numpy def back_oturigation(fee, coin_values, coin_nums): coin_values=numpy.array(coin_values) coin_nums=numpy.array(coin_nums) all = numpy.dot(coin_values, coin_nums) oturi = all - fee use_coins = [0] * len(coin_values) no_use_coins = [0] * len(coin_values) for i in reversed(range...
s682310689
p01132
u635391238
1508754962
Python
Python3
py
Runtime Error
0
0
2436
# http://www.deqnotes.net/acmicpc/p0006/ import re import numpy as np def check_testcase(): with open('./2007-input.txt') as f: input_testcase = f.read() with open('./2007-output.txt') as f: pre_output_testcase = f.read() input_testcase = input_testcase.splitlines() pre_output_testcase...
s482273225
p01132
u635391238
1508755276
Python
Python3
py
Runtime Error
0
0
1518
import numpy as np def back_oturigation(fee, coin_values, coin_nums): """ 1. ?????????????????????????????????£?????????????????? 2. 1???????????????????????????????????????????????????????????? ????????????§?????????????????????-> ??°?????????????????????¶??????????????????? 3. 2????????????????...
s557000076
p01132
u635391238
1508755313
Python
Python3
py
Runtime Error
0
0
1440
def back_oturigation(fee, coin_values, coin_nums): """ 1. ?????????????????????????????????£?????????????????? 2. 1???????????????????????????????????????????????????????????? ????????????§?????????????????????-> ??°?????????????????????¶??????????????????? 3. 2?????????????????????°?????????????...
s907624025
p01132
u635391238
1508755580
Python
Python3
py
Runtime Error
0
0
1453
import numpy def back_oturigation(fee, coin_values, coin_nums): """ 1. ?????????????????????????????????£?????????????????? 2. 1???????????????????????????????????????????????????????????? ????????????§?????????????????????-> ??°?????????????????????¶??????????????????? 3. 2?????????????????????°...
s140788834
p01132
u635391238
1508755667
Python
Python3
py
Runtime Error
0
0
1452
import math def back_oturigation(fee, coin_values, coin_nums): """ 1. ?????????????????????????????????£?????????????????? 2. 1???????????????????????????????????????????????????????????? ????????????§?????????????????????-> ??°?????????????????????¶??????????????????? 3. 2?????????????????????°?...
s513010095
p01132
u506554532
1513152421
Python
Python3
py
Runtime Error
0
0
862
def calc(c1,c2,c3,c4): return c1*10 + c2*50 + c3*100 + c4*500 def coindiff(p,c1,c2,c3,c4): n = c1+c2+c3+c4 over = calc(c1,c2,c3,c4) - p n -= (over%50) // 10 n -= (over%100) // 50 n -= (over%500) // 100 n -= over // 500 return n while True: N = int(input()) if N == 0: break ...
s895985264
p01132
u506554532
1513152658
Python
Python3
py
Runtime Error
0
0
890
def calc(c1,c2,c3,c4): return c1*10 + c2*50 + c3*100 + c4*500 def coindiff(p,c1,c2,c3,c4): n = c1+c2+c3+c4 over = calc(c1,c2,c3,c4) - p n -= (over%50) // 10 n -= (over%100) // 50 n -= (over%500) // 100 n -= over // 500 return n while True: N = int(input()) if N == 0: break ...
s889655088
p01132
u506554532
1513153185
Python
Python3
py
Runtime Error
0
0
890
def calc(c1,c2,c3,c4): return c1*10 + c2*50 + c3*100 + c4*500 def coindiff(p,c1,c2,c3,c4): n = c1+c2+c3+c4 over = calc(c1,c2,c3,c4) - p n -= (over%50) // 10 n -= (over%100) // 50 n -= (over%500) // 100 n -= over // 500 return n while True: N = int(input()) if N == 0: break ...
s847084635
p01132
u506554532
1513153382
Python
Python3
py
Runtime Error
0
0
953
def calc(c1,c2,c3,c4): return c1*10 + c2*50 + c3*100 + c4*500 def coindiff(p,c1,c2,c3,c4): n = c1+c2+c3+c4 over = calc(c1,c2,c3,c4) - p n -= (over%50) // 10 n -= (over%100) // 50 n -= (over%500) // 100 n -= over // 500 return n first = True while True: N = int(input()) if N == ...
s608871701
p01132
u506554532
1513159428
Python
Python3
py
Runtime Error
0
0
1023
def calc(c1,c2,c3,c4): return c1*10 + c2*50 + c3*100 + c4*500 def coindiff(p,c1,c2,c3,c4): n = c1+c2+c3+c4 over = calc(c1,c2,c3,c4) - p n -= (over%50) // 10 n -= (over%100) // 50 n -= (over%500) // 100 n -= over // 500 return n first = True while True: N = int(input()) if N == ...
s200765639
p01132
u506554532
1513176758
Python
Python3
py
Runtime Error
0
0
1023
def calc(c1,c2,c3,c4): return c1*10 + c2*50 + c3*100 + c4*500 def coindiff(p,c1,c2,c3,c4): n = c1+c2+c3+c4 over = calc(c1,c2,c3,c4) - p n -= (over%50) // 10 n -= (over%100) // 50 n -= (over%500) // 100 n -= over // 500 return n first = True while True: N = int(input()) if N == ...
s487168212
p01132
u136916346
1530362770
Python
Python3
py
Runtime Error
0
0
317
while 1: n=int(input()) if not n:break a,b,c,d=map(int,input().split()) y=(10,50,100,500) l=[[i,j,k,l] for i in range(a+1) for j in range(b+1) for k in range(c+1) for l in range(d+1) if i*10+j*50+k*100+l*500==n] t=sorted(l,key=lambda x:sum(x))[-1] [print(i,j) for (i,j) in zip(y,t) if j]
s200474170
p01132
u136916346
1530362910
Python
Python3
py
Runtime Error
0
0
329
while 1: n=int(input()) if not n:break a,b,c,d=map(int,input().split()) y=(10,50,100,500) l=[[i,j,k,l] for i in range(a+1) for j in range(b+1) for k in range(c+1) for l in range(d+1) if i*10+j*50+k*100+l*500==n] t=sorted(l,key=lambda x:sum(x))[-1] [print(i,j) for (i,j) in zip(y,t) if j] ...
s268826257
p01132
u136916346
1530367902
Python
Python3
py
Runtime Error
0
0
342
while 1: n=int(input()) if not n:break a,b,c,d=map(int,input().split()) y=(10,50,100,500) l=[[i,j,k,l] for i in range(a+1) for j in range(b+1) for k in range(c+1) for l in range(d+1) if i*10+j*50+k*100+l*500==n] t=sorted(l,key=lambda x:sum(x))[-1] es=[a-t[0],b-t[1],c-t[2],d-t[3]] print(e...
s357435958
p01132
u136916346
1530368606
Python
Python3
py
Runtime Error
0
0
385
while 1: n=int(input()) if not n:break a,b,c,d=map(int,input().split()) y=(10,50,100,500) l=[[i,j,k,l] for i in range(a+1) for j in range(b+1) for k in range(c+1) for l in range(d+1) if i*10+j*50+k*100+l*500==n] t=sorted(l,key=lambda x:sum(x))[-1] es=[((a-t[0])//5)*5,((b-t[1])//2)*2,((c-t[2]...
s513422661
p01132
u136916346
1530368622
Python
Python3
py
Runtime Error
0
0
396
while 1: n=int(input()) if not n:break a,b,c,d=map(int,input().split()) y=(10,50,100,500) l=[[i,j,k,l] for i in range(a+1) for j in range(b+1) for k in range(c+1) for l in range(d+1) if i*10+j*50+k*100+l*500==n] t=sorted(l,key=lambda x:sum(x))[-1] es=[((a-t[0])//5)*5,((b-t[1])//2)*2,((c-t[2]...
s224672086
p01132
u779627195
1352822802
Python
Python
py
Runtime Error
19930
5596
980
while 1: m = int(raw_input()) if m == 0: break cm = [10, 50, 100, 500] c = map(int, raw_input().split()) mintn = 81 fc = [0 for i in xrange(4)] for i in xrange(c[0]+1): for j in xrange(c[1]+1): for k in xrange(c[2]+1): for l in xrange(c[3]+1): ...
s625964490
p01132
u109084363
1360310226
Python
Python
py
Runtime Error
19920
4272
843
def coin(n): return n / 500 + (n % 500) / 100 + (n % 100) / 50 + (n % 50) / 10 while True: n = int(raw_input()) if n == 0: break c10, c50, c100, c500 = map(int, raw_input().split()) m = 20000 result = [] for i in xrange(c10 + 1): for j in xrange(c50 + 1): for k i...
s495224459
p01132
u109084363
1360341105
Python
Python
py
Runtime Error
19930
4316
995
def coin(n): return n / 500 + (n % 500) / 100 + (n % 100) / 50 + (n % 50) / 10 ret = '' while True: n = int(raw_input()) if n == 0: break c10, c50, c100, c500 = map(int, raw_input().split()) m = 20000 result = [] for i in xrange(c10 + 1): for j in xrange(c50 + 1): ...
s284996893
p01132
u109084363
1360387774
Python
Python
py
Runtime Error
19930
4316
995
def coin(n): return n / 500 + (n % 500) / 100 + (n % 100) / 50 + (n % 50) / 10 ret = '' while True: n = int(raw_input()) if n == 0: break c10, c50, c100, c500 = map(int, raw_input().split()) m = 20000 result = [] for i in xrange(c10 + 1): for j in xrange(c50 + 1): ...
s300329862
p01132
u109084363
1360389072
Python
Python
py
Runtime Error
19930
4236
637
def coin(n): return n / 500 + (n % 500) / 100 + (n % 100) / 50 + (n % 50) / 10 ret = '' while True: n = int(raw_input()) if n == 0: break c10, c50, c100, c500 = map(int, raw_input().split()) m = 20000 result = [] for i in xrange(c10 + 1): for j in xrange(c50 + 1): ...
s816950728
p01132
u109084363
1360389281
Python
Python
py
Runtime Error
0
0
732
def coin(n): return [(n % 500) / 100, (n % 100) / 50, (n % 50) / 10, n / 500] ret = '' while True: n = int(raw_input()) if n == 0: break c10, c50, c100, c500 = map(int, raw_input().split()) m = 20000 result = [] money = 500 * l + 100 * k + 50 * j + 10 * i result = coin(money - ...
s349301078
p01132
u109084363
1360389353
Python
Python
py
Runtime Error
0
0
293
def coin(n): return [(n % 500) / 100, (n % 100) / 50, (n % 50) / 10, n / 500] ret = '' while True: n = int(raw_input()) if n == 0: break c10, c50, c100, c500 = map(int, raw_input().split()) m = 20000 result = [] money = 500 * l + 100 * k + 50 * j + 10 * i
s591627092
p01132
u647766105
1392280403
Python
Python
py
Runtime Error
39860
4416
1016
from itertools import product L = [10, 50, 100, 500] def solve(): #print N ans = [[20] * 4, [20] * 4] for c in product(*[range(N[i] + 1) for i in xrange(4)]): #print "out", c r = calc(c) #print "in", r if check(c, r): ans = min([r, c], ans, key = lambda x: sum(x[...
s826469607
p01133
u797673668
1461568483
Python
Python3
py
Runtime Error
40000
7876
862
from math import sqrt def dfs(remains, elapsed, hx, hy): global crystals if not remains: return True remains_c = set() for i in remains: cx, cy, dfd = crystals[i] dfh = sqrt((cx - hx) ** 2 + (cy - hy) ** 2) new_elapsed = elapsed + dfh if dfd <= new_elapsed: ...
s231014519
p01133
u797673668
1461569210
Python
Python3
py
Runtime Error
40000
7796
843
from math import sqrt def dfs(remains, elapsed, hx, hy): global crystals if not remains: return True remains_c = set() for i in remains: cx, cy, dfd = crystals[i] new_elapsed = elapsed + sqrt((cx - hx) ** 2 + (cy - hy) ** 2) if dfd <= new_elapsed: return F...
s289002245
p01133
u779627195
1353511536
Python
Python
py
Runtime Error
19930
35000
982
import sys import math EPS = 10**(-10) def solve(t,x,y): global ans global done if ans: return cnt = 0 for i in xrange(len(c)): if done[i]: cnt += 1 if cnt is n: ans = True return for i in xrange(len(c)): if done[i]: continue nt = t + math.hypo...
s559163443
p01134
u536089081
1555920398
Python
Python3
py
Runtime Error
0
0
1094
from itertools import combinations from decimal import Decimal def get_point(line1, line2): m1, k1 = line1 m2, k2 = line2 if m1 == m2: return None elif m1 is None and m2 is None: return None elif m1 is None: x = k1 y = m2 * x + k2 elif m2 is None: x =...
s313263491
p01134
u536089081
1555920815
Python
Python3
py
Runtime Error
0
0
1155
from itertools import combinations from decimal import Decimal def get_point(line1, line2): m1, k1 = line1 m2, k2 = line2 if m1 == m2: return None elif m1 is None and m2 is None: return None elif m1 is None: x = k1 y = m2 * x + k2 elif m2 is None: x =...
s369156375
p01134
u536089081
1555920844
Python
Python3
py
Runtime Error
0
0
1155
from itertools import combinations from decimal import Decimal def get_point(line1, line2): m1, k1 = line1 m2, k2 = line2 if m1 == m2: return None elif m1 is None and m2 is None: return None elif m1 is None: x = k1 y = m2 * x + k2 elif m2 is None: x =...
s307913885
p01134
u467175809
1530296422
Python
Python
py
Runtime Error
0
0
1598
#!/usr/bin/env python from collections import deque import itertools as it import sys import math sys.setrecursionlimit(1000000) def gcd(a, b): if b == 0: return a a1 = b b1 = a % b return gcd(a1, b1) while True: n = int(input()) if n == 0: break line = [] for loop in...
s791759622
p01134
u467175809
1530296606
Python
Python3
py
Runtime Error
0
0
1290
#!/usr/bin/env python from collections import deque import itertools as it import sys import math sys.setrecursionlimit(1000000) def gcd(a, b): if b == 0: return a a1 = b b1 = a % b return gcd(a1, b1) while True: n = int(input()) if n == 0: break line = [] for loop in...
s503989763
p01136
u536089081
1555920803
Python
Python3
py
Runtime Error
0
0
1155
from itertools import combinations from decimal import Decimal def get_point(line1, line2): m1, k1 = line1 m2, k2 = line2 if m1 == m2: return None elif m1 is None and m2 is None: return None elif m1 is None: x = k1 y = m2 * x + k2 elif m2 is None: x =...
s360328453
p01136
u041086527
1416330941
Python
Python
py
Runtime Error
0
0
457
while True: n = input() if (n == 0): break d = [] for i in range(n): a = map(int, raw_input().split()) d.append(a[1:]) for i in range(31): ok = True for j in d: t = min(j) if (i < t): ok = False break ...
s559186931
p01136
u041086527
1416334476
Python
Python
py
Runtime Error
19930
4388
849
while True: n = input() if (n == 0): break d = [] digit = set() for i in range(n): a = map(int, raw_input().split()) for j in a[1:]: digit.add(j) d.append(a[1:]) paper = [set() for i in range(n)] ans = 31 for i in range(n): paper[i].add...
s924975665
p01136
u041086527
1416335095
Python
Python
py
Runtime Error
19930
4384
847
while True: n = input() if (n == 0): break d = [] digit = set() for i in range(n): a = map(int, raw_input().split()) for j in a[1:]: digit.add(j) d.append(a[1:]) paper = [set() for i in range(n)] ans = 31 for i in range(n): paper[i].add...
s920521021
p01136
u011621222
1527763247
Python
Python3
py
Runtime Error
0
0
885
while(True): n = int(input()) if n == 0: exit() d = [] for i in range(n): ll = input().split() l = [int(_) for _ in ll] f = l[0] tmp = [] for j in range(1, f+1): tmp.append(l[j]) d += [tmp] mp = [[0 for i in range(30)] for j in ra...
s730120877
p01136
u011621222
1527763287
Python
Python3
py
Runtime Error
0
0
884
while(True): n = int(input()) if n == 0: break d = [] for i in range(n): ll = input().split() l = [int(_) for _ in ll] f = l[0] tmp = [] for j in range(1, f+1): tmp.append(l[j]) d += [tmp] mp = [[0 for i in range(30)] for j in ran...
s892598770
p01136
u352394527
1530537301
Python
Python3
py
Runtime Error
0
0
646
while True: n = int(input()) if n == 0: break days = [[] for _ in range(30)] for i in range(n): hima = list(map(int, input().split())) for d in hima[1:]: days[d].append(i) par_lst = [i for i in range(n)] def get_par(x): if x == par_lst[x]: return x ret = get_par(par_lst[x...
s686361586
p01137
u741801763
1530979103
Python
Python3
py
Runtime Error
0
0
233
while 1: e = int(input().strip()) if e ==0:break m=e for z in range(e): for y in range(e): x = e - y**2 - z**3 if x < 0:break if m > x+y+z: m = x+y+z print(m)
s802868857
p01137
u741801763
1530979435
Python
Python3
py
Runtime Error
0
0
252
import math while 1: e = int(input().strip()) if e ==0:break m=e for z in range(e): for y in range(int(math.sqrt(e))): x = e - y**2 - z**3 if x < 0:break if m > x+y+z: m = x+y+z print(m)
s811183537
p01137
u741801763
1530980358
Python
Python3
py
Runtime Error
0
0
267
import math while 1: e = int(input().strip()) if e ==0:break m=e for z in range(int(math.sqrt(e))): for y in range(int(math.sqrt(e))): x = e - y*y- z*z*z if x < 0:break if m > x+y+z: m = x+y+z print(m)
s457295303
p01137
u741801763
1530981189
Python
Python3
py
Runtime Error
0
0
287
while 1: e = int(input().strip()) if e ==0:break m=e z =0 while z**3 <= e: y =0 while y**2 <= e - z**3: x = e - y**2- z**3 if x < 0:break if m > x+y+z: m = x+y+z y+=1 z+=1 print(m)
s059838418
p01137
u741801763
1531128369
Python
Python3
py
Runtime Error
0
0
253
while 1: e = int(input().strip()) if e ==0:break m=e z =0 while z**3 <= e: y=0 while y **2 <= e - z**3: x = e - y**2 - z**3 if m > x+y+z: m = x+y+z y+=1 z+=1 print(m)
s918641480
p01137
u741801763
1531128894
Python
Python3
py
Runtime Error
0
0
289
import time while 1: e = int(input().strip()) if e ==0:break m=e z =0 time.sleep(20) while z**3 <= e: y=0 while y **2 <= e - z**3: x = e - y**2 - z**3 if m > x+y+z: m = x+y+z y+=1 z+=1 print(m)
s138617677
p01137
u617183767
1420627927
Python
Python
py
Runtime Error
19930
4696
683
#! /usr/bin/env python # -*- coding: utf-8 -*- import os import sys import itertools import math from collections import Counter, defaultdict class Main(object): def __init__(self): pass def solve(self): ''' insert your code ''' while True: e = input()...
s622113524
p01137
u617183767
1420628269
Python
Python
py
Runtime Error
19930
4700
683
#! /usr/bin/env python # -*- coding: utf-8 -*- import os import sys import itertools import math from collections import Counter, defaultdict class Main(object): def __init__(self): pass def solve(self): ''' insert your code ''' while True: e = input()...
s576180343
p01137
u617183767
1420628687
Python
Python
py
Runtime Error
19930
4700
829
#! /usr/bin/env python # -*- coding: utf-8 -*- import os import sys import itertools import math from collections import Counter, defaultdict class Main(object): def __init__(self): pass def solve(self): ''' insert your code ''' while True: e = input()...
s713633933
p01137
u316268279
1421853290
Python
Python3
py
Runtime Error
0
0
312
#!/usr/bin/env python # -*- coding: utf-8 -*- from math import sqrt while True: e = int(input()) if e == 0: break ans = 10**9 for z in range(e): if z > e: break y = int(sqrt(e-z**3)) x = e - y ** 2 - z ** 3 ans = min(ans,x+y+i) print(ans)
s744827630
p01137
u731235119
1421952298
Python
Python
py
Runtime Error
19930
4404
231
import math while 1 : e = int(raw_input()) if e == 0: break z = 0 m = e while math.pow(z,3) <= e: y = 0 while y ** 2 <= e - math.pow(z,3): m = min(e + y + z - y**2 - math.pow(z,3), m) y += 1 z += 1 print int(m)
s516460520
p01137
u731235119
1421956008
Python
Python
py
Runtime Error
19930
4408
250
import math while 1 : e = int(raw_input()) if e == 0: break z = 0 m = e while math.pow(z,3) <= e: y = 0 while y ** 2 <= e - math.pow(z,3): m = min(e + y + z - y**2 - math.pow(z,3), m) y += 1 z += 1 print y, z print int(m) quit()