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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
s683590435 | p00754 | u316268279 | 1421244310 | Python | Python3 | py | Runtime Error | 19920 | 6720 | 705 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import sys
sys.setrecursionlimit(10**6)
def dfs(string,bracket):
i = 0
while i < len(string):
if bracket == '[' and string[i] == ']':
return i
elif bracket == '(' and string[i] == ')':
return i
elif string[i] == '(' o... |
s714579402 | p00754 | u966364923 | 1436701258 | Python | Python3 | py | Runtime Error | 0 | 0 | 589 | while True:
flg = True
S = input()
if S = '.':
exit()
cnt = [0, 0]
for c in S:
if c == '[':
cnt[0] += 1
elif c == ']':
cnt[0] -= 1
if cnt[0] < 0:
flg = False
break
elif c == '(':
cnt[1] +=... |
s106650652 | p00754 | u269391636 | 1523771296 | Python | Python3 | py | Runtime Error | 0 | 0 | 607 | while (True):
st = input()
st = [i for i in st if i in ["(",")","[","]"]
han = []
ans = "Yes"
for i in st:
if i == "(":
han.append("maru")
elif i == "[":
han.append("kaku")
elif i == ")":
if han == []:
ans = "No"
break
elif han[-1] == "maru":
del han... |
s370658828 | p00755 | u685815919 | 1479112370 | Python | Python | py | Runtime Error | 40000 | 6564 | 1440 | import copy
import heapq
vec=[(0,1),(0,-1),(1,0),(-1,0)]
def printField(field):
for i in xrange(len(field)):
print "".join(map(str,field[i]))
def counter(field):
c=field[0][0]
field[0][0]=0
q=[]
count=1
heapq.heappush(q,(0,0))
while q:
x,y=heapq.heappop(q)
for dx,dy in vec:
if x+dx<0 ... |
s673990055 | p00755 | u408260374 | 1495217737 | Python | Python3 | py | Runtime Error | 40000 | 8068 | 1375 | import copy
import itertools
drc = [(-1, 0), (0, 1), (1, 0), (0, -1)]
C_NUM = 6
while True:
H, W, C = map(int, input().split())
if not (H | W | C):
break
board = [[int(x) - 1 for x in input().split()] for _ in range(H)]
ans = 0
for ope in itertools.product(range(C_NUM), repeat=4):
... |
s051483273 | p00755 | u408260374 | 1495217841 | Python | Python | py | Runtime Error | 40000 | 6516 | 1450 | import copy
import itertools
import sys
if sys.version[0] == '2':
range, input = xrange, raw_input
drc = [(-1, 0), (0, 1), (1, 0), (0, -1)]
C_NUM = 6
while True:
H, W, C = map(int, input().split())
if not (H | W | C):
break
board = [[int(x) - 1 for x in input().split()] for _ in range(H)]
... |
s446203275 | p00755 | u408260374 | 1495218809 | Python | Python | py | Runtime Error | 40000 | 6576 | 1475 | import copy
import itertools
import sys
if sys.version[0] == '2':
range, input = xrange, raw_input
drc = [(-1, 0), (0, 1), (1, 0), (0, -1)]
C_NUM = 6
while True:
H, W, C = map(int, input().split())
if not (H | W | C):
break
board = [[int(x) - 1 for x in input().split()] for _ in range(H)]
... |
s066088557 | p00755 | u408260374 | 1495219048 | Python | Python | py | Runtime Error | 40000 | 6592 | 1520 | import copy
import itertools
import sys
if sys.version[0] == '2':
range, input = xrange, raw_input
drc = [(-1, 0), (0, 1), (1, 0), (0, -1)]
C_NUM = 6
while True:
H, W, C = map(int, input().split())
if not (H | W | C):
break
board = [[int(x) - 1 for x in input().split()] for _ in range(H)]
... |
s863643143 | p00755 | u104911888 | 1370907669 | Python | Python | py | Runtime Error | 20000 | 4372 | 1213 | from copy import deepcopy
dx=[0,0,1,-1]
dy=[1,-1,0,0]
def dfs(y,x,color,precolor):
if color==precolor:
return
P[y][x]=color
for i in range(4):
mx=x+dx[i]
my=y+dy[i]
if 0<=mx<w and 0<=my<h and P[my][mx]==precolor:
dfs(my,mx,color,precolor)
def panelnum(y,x,color)... |
s817009003 | p00756 | u852216820 | 1530816437 | Python | Python3 | py | Runtime Error | 0 | 0 | 1115 | def xx(x):
return x * x
def pop(overlaps, i, lis):
for k in lis:
if i > k and overlaps[i][k]: return False
return True
def search(disks, overlaps, lis):
if len(lis) < 2: return 0
res = 0
for i in lis:
if not pop(overlaps, i, lis): continue
#print("OK", i)
fo... |
s125827437 | p00757 | u269391636 | 1526232397 | Python | Python3 | py | Runtime Error | 0 | 0 | 1880 | #教室内の位置は右*中央
#問題は「Eleven Lover」(http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=2182&lang=jp)
#本当は問題「Planning Rolling Blackouts」(http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=1176&lang=jp)
#を解こうとしたのですが、小区間での分割をひたすら統合する解法までは立ったものの実装力がなかったので一旦やめました
while(True):
#今回はinputの数字を文字列として一桁ずつ扱った方が嬉しいのでint... |
s496744180 | p00760 | u300645821 | 1413361299 | Python | Python | py | Runtime Error | 0 | 0 | 230 | #!/usr/bin/python
import sys
if sys.version_info[0]>=3: raw_input=input
n=int(raw_input())
for i in range(0,n):
y,m,d=[int(e) for e in raw_input().split()]
y-=1;m-=1
print(196471-y*195-y//3*5-m*20+(m//2 if y%3!=2 else 0)-a[2]) |
s817353191 | p00760 | u940190657 | 1436687628 | Python | Python3 | py | Runtime Error | 0 | 0 | 811 | #solve function
def solve(dates):
counter = 0;
start_month = dates[1]
start_day, end_day = dates[2], 0
for year in range(dates[0], 1000):
for month in range(start_month, 11):
if year%3 == 0 or month%2 == 1:
end_day = 21
else:
end_day = 20
... |
s782081518 | p00760 | u940190657 | 1436687701 | Python | Python3 | py | Runtime Error | 0 | 0 | 806 | #solve function
def solve(dates):
counter = 0;
start_month = dates[1]
start_day, end_day = dates[2], 0
for year in range(dates[0], 1000):
for month in range(start_month, 11):
if year%3 == 0 or month%2 == 1:
end_day = 21
else:
end_day = 20
... |
s982842458 | p00760 | u922871577 | 1482211226 | Python | Python | py | Runtime Error | 0 | 0 | 711 | N = int(raw_input())
D1 = 20*5 + 19*5
D2 = 20*10
for i in xrange(N):
y, m, d = map(int, raw_input().split())
ans = 0
if d != 1:
if y % 3 == 0 or m % 2 == 1:
last = 20
else:
last = 19
ans += last - d + 1
d = 1
if m < 10:
m += 1
... |
s781814784 | p00760 | u814249052 | 1370879696 | Python | Python | py | Runtime Error | 0 | 0 | 899 | def datesOfTheYear(year):
if year % 3 == 0:
return 200
return 195
def datesOfTheMonth(year, month):
if year % 3 == 0:
return 20
if month % 2 == 0:
return 19
else:
return 20
def datesFromBorn(birthyear, birthmonth, birthdate):
result = 0
for y in range(bir... |
s759239118 | p00760 | u300645821 | 1400581158 | Python | Python3 | py | Runtime Error | 0 | 0 | 193 | import sys
n=int(sys.stdin.readline())
for i in range(0,n):
a=map(int,sys.stdin.readline().split())
a[0]-=1;a[1]-=1
print(196471-a[0]*195-a[0]/3*5-a[1]*20+(a[1]/2 if a[0]%3!=2 else 0)-a[2]) |
s881294116 | p00760 | u300645821 | 1400581257 | Python | Python | py | Runtime Error | 0 | 0 | 210 | import sys
if sys.version_info[0]>=3: raw_input=input
n=int(raw_input())
for i in range(0,n):
a=map(int,raw_input())
a[0]-=1;a[1]-=1
print(196471-a[0]*195-a[0]/3*5-a[1]*20+(a[1]/2 if a[0]%3!=2 else 0)-a[2]) |
s521102209 | p00760 | u300645821 | 1400581351 | Python | Python3 | py | Runtime Error | 0 | 0 | 218 | import sys
if sys.version_info[0]>=3: raw_input=input
n=int(raw_input())
for i in range(0,n):
a=map(int,raw_input().split())
a[0]-=1;a[1]-=1
print(196471-a[0]*195-a[0]/3*5-a[1]*20+(a[1]/2 if a[0]%3!=2 else 0)-a[2]) |
s878848177 | p00761 | u328199937 | 1556032584 | Python | Python3 | py | Runtime Error | 0 | 0 | 741 | def pluss_zero(a, L):
a = str(a)
while len(a) < L:
a = "0" + a
return a
def make_maxminnum(a):
a = list(a)
a.sort()
maxa = int("".join(a[::-1]))
mina = int("".join(a))
return maxa - mina
ans_list = []
while True:
a, L = map(int, input().split())
if a == 0 and L == 0:
... |
s079280686 | p00761 | u136916346 | 1530195409 | Python | Python3 | py | Runtime Error | 0 | 0 | 328 | while 1:
a,p=map(int,input().split())
if not a and not p:break
a=str(a).zfill(p)
b=[a]
f=lambda l:int("".join(l))
for j in range(10):
m=sorted(a)
a=str(f(m[::-1])-f(m)).zfill(p)
if a in b:
i=b.index(a)
break
b.append(a)
print(i,int(a),... |
s518238666 | p00762 | u112036414 | 1559045044 | Python | Python3 | py | Runtime Error | 0 | 0 | 3049 | false=False
true=True
dices={}
me=[0,0,0,0,0,0]
def getDice(x,y,z):
return dices["{},{},{}".format(x,y,z)]
def setDice(x,y,z,top,ground=False):
dices["{},{},{}".format(x,y,z)]=top
me[top]+=1
if not ground:
me[getDice(x,y,z-1)]-=1
while True:
n=int(input())
if n==0:
break
#########
... |
s802588782 | p00763 | u082657995 | 1556767147 | Python | Python3 | py | Runtime Error | 0 | 0 | 2350 | from collections import defaultdict
while True:
N, M, C, S, G = map(int, input().split())
if N==M==C==S==G==0: # 駅の数、路線の数10000、鉄道会社の数20、出発駅、目的地駅
break
# E = [[] for _ in range(N+1)] # E[v] -> [(u, d, c), ...]
# for _ in range(M):
# x, y, d, c = map(int, input().split()) # d<=200
#... |
s260060004 | p00763 | u082657995 | 1556768836 | Python | Python3 | py | Runtime Error | 19630 | 16040 | 2451 | import heapq
from collections import defaultdict
from functools import lru_cache
from bisect import bisect_right
while True:
N, M, C, S, G = map(int, input().split())
if N == M == C == S == G == 0: # 駅の数、路線の数10000、鉄道会社の数20、出発駅、目的地駅
break
#E = [[[] for _ in range(N + 1)] for _ in range(C + 1)]
D... |
s530930538 | p00763 | u339921062 | 1498633688 | Python | Python | py | Runtime Error | 40000 | 7676 | 1502 | while 1:
n, m, C, s, g = map(int, raw_input().split())
if n == m == 0:
break
E = [[] for i in xrange(C)]
for i in xrange(m):
x, y, d, c = map(int, raw_input().split())
E[c-1].append((x-1, y-1, d))
P = map(int, raw_input().split())
Q = []; R = []
for i in xrange(C):
... |
s679460849 | p00763 | u339921062 | 1498635133 | Python | Python | py | Runtime Error | 40000 | 7744 | 1513 | while 1:
n, m, C, s, g = map(int, raw_input().split())
if n == m == 0:
break
E = [[] for i in xrange(C)]
for i in xrange(m):
x, y, d, c = map(int, raw_input().split())
E[c-1].append((x-1, y-1, d))
P = map(int, raw_input().split())
Q = []; R = []
for i in xrange(C):
... |
s417493950 | p00763 | u260980560 | 1498663983 | Python | Python | py | Runtime Error | 40000 | 8588 | 1605 | while 1:
N, M, C, s, g = map(int, raw_input().split())
if N == M == 0:
break
es = [[] for i in xrange(C)]
for i in xrange(M):
x, y, d, c = map(int, raw_input().split())
if not x < y:
x, y = y, x
es[c-1].append((x-1, y-1, d))
P = map(int, raw_input().split(... |
s218594200 | p00763 | u835844653 | 1512211111 | Python | Python3 | py | Runtime Error | 0 | 0 | 2323 | inf=1000000000
def calc(uth,dis,c):
fare=0
if dis>=inf:
return inf
if unchin[c]==1:
return uth[c][1][0]*dis
ddis=uth[c][0]
dcost=uth[c][1]
i=1
while(i<unchin[c] and dis>ddis[i]):
fare+=(ddis[i]-ddis[i-1])*dcost[i-1]
i+=1
fare+=(dis-ddis[i-1])*dcost[i-1]
... |
s772575476 | p00763 | u835844653 | 1512211144 | Python | Python3 | py | Runtime Error | 0 | 0 | 2323 | inf=1000000000
def calc(uth,dis,c):
fare=0
if dis>=inf:
return inf
if unchin[c]==1:
return uth[c][1][0]*dis
ddis=uth[c][0]
dcost=uth[c][1]
i=1
while(i<unchin[c] and dis>ddis[i]):
fare+=(ddis[i]-ddis[i-1])*dcost[i-1]
i+=1
fare+=(dis-ddis[i-1])*dcost[i-1]
... |
s780773242 | p00763 | u835844653 | 1512211484 | Python | Python3 | py | Runtime Error | 0 | 0 | 2314 | inf=1000000000
def calc(uth,dis,c):
fare=0
if dis>=inf:
return inf
if unchin[c]==1:
return uth[c][1][0]*dis
ddis=uth[c][0]
dcost=uth[c][1]
i=1
while(i<unchin[c] and dis>ddis[i]):
fare+=(ddis[i]-ddis[i-1])*dcost[i-1]
i+=1
fare+=(dis-ddis[i-1])*dcost[i-1]
... |
s474318869 | p00763 | u835844653 | 1512212151 | Python | Python3 | py | Runtime Error | 0 | 0 | 2303 | inf=100000000
def calc(uth,dis,c):
fare=0
if dis>=inf:
return inf
if unchin[c]==1:
return uth[c][1][0]*dis
ddis=uth[c][0]
dcost=uth[c][1]
i=1
while(i<unchin[c] and dis>ddis[i]):
fare+=(ddis[i]-ddis[i-1])*dcost[i-1]
i+=1
fare+=(dis-ddis[i-1])*dcost[i-1]
... |
s548933858 | p00763 | u835844653 | 1512216750 | Python | Python3 | py | Runtime Error | 0 | 0 | 2036 | inf=100000000
def calc(uth,dis,c):
fare=0
if dis>=inf:
return inf
if unchin[c]==1:
return uth[c][1][0]*dis
ddis=uth[c][0]
dcost=uth[c][1]
i=1
while(i<unchin[c] and dis>ddis[i]):
fare+=(ddis[i]-ddis[i-1])*dcost[i-1]
i+=1
fare+=(dis-ddis[i-1])*dcost[i-1]
... |
s949340946 | p00763 | u835844653 | 1512217012 | Python | Python3 | py | Runtime Error | 0 | 0 | 2042 | inf=100000000
def calc(uth,dis,c):
fare=0
if dis>=inf:
return inf
if unchin[c]==1:
return uth[c][1][0]*dis
ddis=uth[c][0]
dcost=uth[c][1]
i=1
while(i<unchin[c] and dis>ddis[i]):
fare+=(ddis[i]-ddis[i-1])*dcost[i-1]
i+=1
fare+=(dis-ddis[i-1])*dcost[i-1]
... |
s959235246 | p00763 | u835844653 | 1512217245 | Python | Python3 | py | Runtime Error | 0 | 0 | 2040 | inf=100000000
def calc(uth,dis,c):
fare=0
if dis>=inf:
return inf
if unchin[c]==1:
return uth[c][1][0]*dis
ddis=uth[c][0]
dcost=uth[c][1]
i=1
while(i<unchin[c] and dis>ddis[i]):
fare+=(ddis[i]-ddis[i-1])*dcost[i-1]
i+=1
fare+=(dis-ddis[i-1])*dcost[i-1]
... |
s694573363 | p00763 | u835844653 | 1512217388 | Python | Python3 | py | Runtime Error | 0 | 0 | 2040 | inf=100000000
def calc(uth,dis,c):
fare=0
if dis>=inf:
return inf
if unchin[c]==1:
return uth[c][1][0]*dis
ddis=uth[c][0]
dcost=uth[c][1]
i=1
while(i<unchin[c] and dis>ddis[i]):
fare+=(ddis[i]-ddis[i-1])*dcost[i-1]
i+=1
fare+=(dis-ddis[i-1])*dcost[i-1]
... |
s444681220 | p00763 | u835844653 | 1512217500 | Python | Python3 | py | Runtime Error | 0 | 0 | 2041 | inf=100000000
def calc(uth,dis,c):
fare=0
if dis>=inf:
return inf
if unchin[c]==1:
return uth[c][1][0]*dis
ddis=uth[c][0]
dcost=uth[c][1]
i=1
while(i<unchin[c] and dis>ddis[i]):
fare+=(ddis[i]-ddis[i-1])*dcost[i-1]
i+=1
fare+=(dis-ddis[i-1])*dcost[i-1]
... |
s789479237 | p00763 | u835844653 | 1512218226 | Python | Python3 | py | Runtime Error | 0 | 0 | 2038 | inf=100000000
def calc(uth,dis,c):
fare=0
if dis>=inf:
return inf
if unchin[c]==1:
return uth[c][1][0]*dis
ddis=uth[c][0]
dcost=uth[c][1]
i=1
while(i<unchin[c] and dis>ddis[i]):
fare+=(ddis[i]-ddis[i-1])*dcost[i-1]
i+=1
fare+=(dis-ddis[i-1])*dcost[i-1]
... |
s086647039 | p00763 | u835844653 | 1512218545 | Python | Python3 | py | Runtime Error | 0 | 0 | 2072 | inf=100000000
def calc(uth,dis,c):
fare=0
if dis>=inf:
return inf
if unchin[c]==1:
return uth[c][1][0]*dis
ddis=uth[c][0]
dcost=uth[c][1]
i=1
while(i<unchin[c] and dis>ddis[i]):
fare+=(ddis[i]-ddis[i-1])*dcost[i-1]
i+=1
fare+=(dis-ddis[i-1])*dcost[i-1]
... |
s198035552 | p00763 | u835844653 | 1512218652 | Python | Python3 | py | Runtime Error | 0 | 0 | 2016 | inf=100000000
def calc(uth,dis,c):
fare=0
if dis>=inf:
return inf
if unchin[c]==1:
return uth[c][1][0]*dis
ddis=uth[c][0]
dcost=uth[c][1]
i=1
while(i<unchin[c] and dis>ddis[i]):
fare+=(ddis[i]-ddis[i-1])*dcost[i-1]
i+=1
fare+=(dis-ddis[i-1])*dcost[i-1]
... |
s961237361 | p00763 | u835844653 | 1512218905 | Python | Python3 | py | Runtime Error | 0 | 0 | 2009 | inf=100000000
def calc(uth,dis,c):
fare=0
if dis>=inf:
return inf
if unchin[c]==1:
return uth[c][1][0]*dis
ddis=uth[c][0]
dcost=uth[c][1]
i=1
while(i<unchin[c] and dis>ddis[i]):
fare+=(ddis[i]-ddis[i-1])*dcost[i-1]
i+=1
fare+=(dis-ddis[i-1])*dcost[i-1]
... |
s898295972 | p00763 | u835844653 | 1512219060 | Python | Python3 | py | Runtime Error | 0 | 0 | 2006 | inf=100000000
def calc(uth,dis,c):
fare=0
if dis>=inf:
return inf
if unchin[c]==1:
return uth[c][1][0]*dis
ddis=uth[c][0]
dcost=uth[c][1]
i=1
while(i<unchin[c] and dis>ddis[i]):
fare+=(ddis[i]-ddis[i-1])*dcost[i-1]
i+=1
fare+=(dis-ddis[i-1])*dcost[i-1]
... |
s441675224 | p00763 | u835844653 | 1512219595 | Python | Python3 | py | Runtime Error | 0 | 0 | 2436 | inf=100000000
def calc(uth,dis,c):
fare=0
if dis>=inf:
return inf
if unchin[c]==1:
return uth[c][1][0]*dis
ddis=uth[c][0]
dcost=uth[c][1]
i=1
while(i<unchin[c] and dis>ddis[i]):
fare+=(ddis[i]-ddis[i-1])*dcost[i-1]
i+=1
fare+=(dis-ddis[i-1])*dcost[i-1]
... |
s072711038 | p00763 | u835844653 | 1512219771 | Python | Python3 | py | Runtime Error | 0 | 0 | 2435 | inf=10000000
def calc(uth,dis,c):
fare=0
if dis>=inf:
return inf
if unchin[c]==1:
return uth[c][1][0]*dis
ddis=uth[c][0]
dcost=uth[c][1]
i=1
while(i<unchin[c] and dis>ddis[i]):
fare+=(ddis[i]-ddis[i-1])*dcost[i-1]
i+=1
fare+=(dis-ddis[i-1])*dcost[i-1]
... |
s550028011 | p00763 | u658913995 | 1513144794 | Python | Python | py | Runtime Error | 0 | 0 | 1761 | inf=100000000
def calc(uth,dis,c):
fare=0
if dis>=inf:
return inf
if unchin[c]==1:
return uth[c][1][0]*dis
ddis=uth[c][0]
dcost=uth[c][1]
i=1
while(i<unchin[c] and dis>ddis[i]):
fare+=(ddis[i]-ddis[i-1])*dcost[i-1]
i+=1
fare+=(dis-ddis[i-1])*dcost[i-1]
... |
s803990941 | p00763 | u658913995 | 1513145011 | Python | Python | py | Runtime Error | 0 | 0 | 1450 | inf=100000000
def calc(uth,dis,c):
fare=0
if dis>=inf:
return inf
if unchin[c]==1:
return uth[c][1][0]*dis
ddis=uth[c][0]
dcost=uth[c][1]
i=1
while(i<unchin[c] and dis>ddis[i]):
fare+=(ddis[i]-ddis[i-1])*dcost[i-1]
i+=1
fare+=(dis-ddis[i-1])*dcost[i-1]
... |
s943928240 | p00763 | u658913995 | 1513145139 | Python | Python | py | Runtime Error | 0 | 0 | 1223 | inf=100000000
def calc(uth,dis,c):
fare=0
if dis>=inf:
return inf
if unchin[c]==1:
return uth[c][1][0]*dis
ddis=uth[c][0]
dcost=uth[c][1]
i=1
while(i<unchin[c] and dis>ddis[i]):
fare+=(ddis[i]-ddis[i-1])*dcost[i-1]
i+=1
fare+=(dis-ddis[i-1])*dcost[i-1]
... |
s586122759 | p00763 | u658913995 | 1513145159 | Python | Python | py | Runtime Error | 0 | 0 | 434 | inf=100000000
while(1):
n,m,c,s,g=map(int,input().split())
if(n==m==0): break
for i in range(m):
x,y,d,c0=map(int,input().split())
unchin=list(map(int,input().split()))
unchin.insert(0,0)
uth=[]
uth.append([])
for i in range(1,c+1):
ddis=list(map(int,input().split()))
... |
s709050470 | p00763 | u658913995 | 1513145458 | Python | Python3 | py | Runtime Error | 0 | 0 | 1762 |
inf=100000000
def calc(uth,dis,c):
fare=0
if dis>=inf:
return inf
if unchin[c]==1:
return uth[c][1][0]*dis
ddis=uth[c][0]
dcost=uth[c][1]
i=1
while(i<unchin[c] and dis>ddis[i]):
fare+=(ddis[i]-ddis[i-1])*dcost[i-1]
i+=1
fare+=(dis-ddis[i-1])*dcost[i-1]
... |
s915874540 | p00763 | u658913995 | 1513145528 | Python | Python3 | py | Runtime Error | 0 | 0 | 32 | test = 0
while(1):
test += 1 |
s611180125 | p00763 | u658913995 | 1513146006 | Python | Python3 | py | Runtime Error | 0 | 0 | 9 | while(1): |
s607894043 | p00763 | u658913995 | 1513146022 | Python | Python3 | py | Runtime Error | 0 | 0 | 15 | while(1):
0 |
s266062294 | p00763 | u658913995 | 1513146788 | Python | Python3 | py | Runtime Error | 0 | 0 | 2075 |
inf=100000000
def calc(uth,dis,c):
fare=0
if dis>=inf:
return inf
if unchin[c]==1:
return uth[c][1][0]*dis
ddis=uth[c][0]
dcost=uth[c][1]
i=1
while(i<unchin[c] and dis>ddis[i]):
fare+=(ddis[i]-ddis[i-1])*dcost[i-1]
i+=1
fare+=(dis-ddis[i-1])*dcost[i-1]
... |
s873194030 | p00763 | u072053884 | 1526022076 | Python | Python3 | py | Runtime Error | 0 | 0 | 2498 | def solve():
import sys
from itertools import combinations
from bisect import bisect
from heapq import heappush, heappop
file_input = sys.stdin
inf = float('inf')
while True:
n, m, c, s, g = map(int, file_input.readline().split())
if n == 0:
break
... |
s236178997 | p00763 | u072053884 | 1526022195 | Python | Python3 | py | Runtime Error | 0 | 0 | 2420 | def solve():
import sys
from itertools import combinations
from bisect import bisect
from heapq import heappush, heappop
file_input = sys.stdin
inf = float('inf')
while True:
n, m, c, s, g = map(int, file_input.readline().split())
if n == 0:
break
... |
s049424912 | p00763 | u072053884 | 1526031563 | Python | Python3 | py | Runtime Error | 0 | 0 | 2538 | def solve():
import sys
from itertools import combinations
from bisect import bisect
from heapq import heappush, heappop
file_input = sys.stdin
inf = float('inf')
while True:
n, m, c, s, g = map(int, file_input.readline().split())
if n == 0:
break
... |
s689038227 | p00766 | u260980560 | 1498651454 | Python | Python | py | Runtime Error | 0 | 0 | 4734 | # encoding: shift-jis
# Dinic algorithm
from collections import deque
class Dinic:
def __init__(self, n):
self.n = n
self.g = [[] for i in xrange(n)]
def add_edge(self, fr, to, cap):
self.g[fr].append([to, cap, len(self.g[to])])
self.g[to].append([fr, 0, len(self.g[fr])-1])
... |
s382459486 | p00767 | u052632641 | 1528450487 | Python | Python | py | Runtime Error | 0 | 0 | 812 | import sys
import math
from operator import itemgetter
#a = h*h + w*w
#b = math.sqrt(a)
mylist = []
hlist = range(1, 101)
wlist = range(1, 101)
for h1 in hlist:
for w1 in wlist:
if not w1 > h1:
continue
t1 = math.sqrt(pow(h1, 2) + pow(w1, 2))
mylist.append((t1, h1, w1))
myl... |
s783541142 | p00768 | u136916346 | 1530499405 | Python | Python3 | py | Runtime Error | 0 | 0 | 729 | while 1:
M,T,P,R=map(int,input().split())
if not M and not T and not P and not R:break
d={i:[0,0] for i in range(1,T+1)}
wa=[[0 for _ in range(P)] for _ in range(T)]
for _ in range(R):
m,t,p,j=map(int,input().split())
if j:
wa[t-1][p-1]+=20
else:
d[t][... |
s828507402 | p00769 | u633068244 | 1399711261 | Python | Python | py | Runtime Error | 0 | 0 | 231 | def solve(a):
if type(a[0]) is int:
return sum(sorted(a)[:len(a)/2+1])/2 + len(a)
else:
return sum(sorted(solve(i) for i in a))[:len(a)/2+1])
for i in range(input()):
A = eval(raw_input().replace("][","],["))
print solve(A) |
s353874497 | p00770 | u260980560 | 1499856018 | Python | Python | py | Runtime Error | 0 | 0 | 1085 | from math import sqrt
from collections import deque
M = 10**6
prime = [1]*(M+1)
prime[0] = prime[1] = 0
for i in xrange(2, int(sqrt(M))+1):
if prime[i]:
for j in xrange(i*i, M+1, i):
prime[j] = 0
P = {(0, 0): 1}; R = [None, (0, 0)]
c = 1; i = 1; p = 1
x = y = 0
while c < M:
for j in xrange(i... |
s811263823 | p00773 | u798087532 | 1530783965 | Python | Python3 | py | Runtime Error | 0 | 0 | 289 | while True:
x,y,s = map(int,input().split(" "))
if x == 0 and y == 0 and s == 0:
break
fb = lambda z:z*(100+x)//100
fa = lambda z:z*(100+y)//100
ans = 0
for A in range(1,s):
for B in range(1,s):
if fb(A)+fb(B) != s:
continue
ans = max(fa(A) + fa(B),ans)
print(ans)
|
s527248974 | p00773 | u798087532 | 1530784113 | Python | Python3 | py | Runtime Error | 0 | 0 | 332 | ret = []
while True:
x,y,s = map(int,input().split(" "))
if x == 0 and y == 0 and s == 0:
break
fb = lambda z:z*(100+x)//100
fa = lambda z:z*(100+y)//100
ans = 0
for A in range(1,s):
for B in range(1,s):
if fb(A)+fb(B) != s:
continue
ans = max(fa(A) + fa(B),ans)
ret.append(ans)
for ans in ret:
... |
s415356467 | p00773 | u958378108 | 1530790977 | Python | Python3 | py | Runtime Error | 0 | 0 | 439 | while True:
x, y, s = map(int, input().split())
if x==0 and y==0 and s==0:
break
else:
value = 0
for a in range(1, s):
for b in range(1, s):
if int(a*(100+x)/100) + int(b*(100+x)/100) == s:
v = int(a*(100+y)/100) + int(b*(100+y)/100)
... |
s023575946 | p00773 | u958378108 | 1530791287 | Python | Python3 | py | Runtime Error | 0 | 0 | 408 | while True:
x, y, s = map(int, input().split())
if x==0 and y==0 and s==0:
break
else:
value = 0
for a in range(1, s):
for b in range(1, s):
if int(a*(100+x)/100) + int(b*(100+x)/100) == s:
v = int(a*(100+y)/100) + int(b*(100+y)/100)
... |
s284728627 | p00773 | u958378108 | 1530791703 | Python | Python3 | py | Runtime Error | 0 | 0 | 438 | while True:
x, y, s = map(int, input().split())
if x==0 and y==0 and s==0:
break
else:
value = 0
for a in range(1, s):
for b in range(1, s-a+1):
if int(a*(100+x)/100) + int(b*(100+x)/100) == s:
v = int(a*(100+y)/100) + int(b*(100+y)/100... |
s436226560 | p00773 | u352394527 | 1531256975 | Python | Python3 | py | Runtime Error | 0 | 0 | 442 | #include <iostream>
using namespace std;
int main(void){
int x, y, s, i, j;
int tmp, higher;
while(cin>>x>>y>>s){
if(x == 0){
break;
}
higher = 0;
for(i=1;i<s;i++){
for(j=i;j<s;j++){
if(i * (100 + x) / 100 + (j * (100 + x) / 100) == s){
tmp = i * (100 + y) / 100 + j ... |
s676704918 | p00773 | u797636303 | 1555838836 | Python | Python3 | py | Runtime Error | 0 | 0 | 792 | def tax(p,x):
return p*(100+x)//100
def solve(X, Y, S):
max_value=0 #max_valueをdef solveの前に入れるミスをしていて全く進みませんでした。関数の定義の理解が進みました。
for a in range(1,S):
for b in range(1,S):
sum_value=tax(a,X)+tax(b,X)
if sum_value==S:
c=tax(a,Y)+tax(b,Y)
if c>=max... |
s370968530 | p00773 | u797636303 | 1555838884 | Python | Python3 | py | Runtime Error | 0 | 0 | 484 | def tax(p,x):
return p*(100+x)//100
def solve(X, Y, S):
max_value=0
for a in range(1,S):
for b in range(1,S):
sum_value=tax(a,X)+tax(b,X)
if sum_value==S:
c=tax(a,Y)+tax(b,Y)
if c>=max_value:
max_value=c
if ... |
s735132814 | p00773 | u797636303 | 1555838895 | Python | Python3 | py | Runtime Error | 0 | 0 | 484 | def tax(p,x):
return p*(100+x)//100
def solve(X, Y, S):
max_value=0
for a in range(1,S):
for b in range(1,S):
sum_value=tax(a,X)+tax(b,X)
if sum_value==S:
c=tax(a,Y)+tax(b,Y)
if c>=max_value:
max_value=c
if ... |
s366521234 | p00773 | u797636303 | 1555838998 | Python | Python3 | py | Runtime Error | 0 | 0 | 458 | def tax(p,x):
return p*(100+x)//100
def solve(X, Y, S):
max_value=0
for a in range(1,S):
for b in range(1,S):
sum_value=tax(a,X)+tax(b,X)
if sum_value==S:
c=tax(a,Y)+tax(b,Y)
if c>max_value:
max_value=c
if su... |
s995147707 | p00773 | u910909659 | 1555919113 | Python | Python3 | py | Runtime Error | 0 | 0 | 678 | def tax(p,x):
return p*(100+x) // 100 # 整数除算
def solve(X,Y,S):
ans = 0
oldsum = 0
for a in range(1,S):
for b in range(1,S-a+1): #税抜き価格a,bの総和はS以下である
oldsum = tax(a,X)+tax(b,X) #税制改定前の税込合計額
if oldsum == S: # 新税でのtax(a,Y)+tax(b,Y) について検討
newsum = tax(a,Y)+t... |
s910934615 | p00773 | u910909659 | 1555919189 | Python | Python3 | py | Runtime Error | 0 | 0 | 678 | def tax(p,x):
return p*(100+x) // 100 # 整数除算
def solve(X,Y,S):
ans = 0
oldsum = 0
for a in range(1,S):
for b in range(1,S-a+1): #税抜き価格a,bの総和はS以下である
oldsum = tax(a,X)+tax(b,X) #税制改定前の税込合計額
if oldsum == S: # 新税でのtax(a,Y)+tax(b,Y) について検討
newsum = tax(a,Y)+t... |
s944730237 | p00773 | u910909659 | 1555919235 | Python | Python3 | py | Runtime Error | 0 | 0 | 692 | def tax(p,x):
return p*(100+x) // 100 # 整数除算
def solve(X,Y,S):
ans = 0
oldsum = 0
newsum = 0
for a in range(1,S):
for b in range(1,S-a+1): #税抜き価格a,bの総和はS以下である
oldsum = tax(a,X)+tax(b,X) #税制改定前の税込合計額
if oldsum == S: # 新税でのtax(a,Y)+tax(b,Y) について検討
news... |
s243997678 | p00773 | u637657888 | 1555919302 | Python | Python3 | py | Runtime Error | 0 | 0 | 383 | def tax(p,x):
return p*(100+x) // 100
def solve(X,Y,S):
for a in range(1,S):
for b in range(1,S):
sum = tax(a,X)+tax(b,X)
if sum == S:
tax(a,Y)+tax(b,Y)
if sum > S:
break
return best
while True:
X,Y,S = map(int, input().strip(... |
s029541512 | p00773 | u637657888 | 1555919384 | Python | Python3 | py | Runtime Error | 0 | 0 | 349 | def tax(p,x):
return p*(100+x) // 100
def solve(X,Y,S):
for a in range(1,S):
for b in range(1,S):
sum = tax(a,X)+tax(b,X)
if sum == S:
if sum > S:
break
return best
while True:
X,Y,S = map(int, input().strip().split(''))
if X == 0:
... |
s711294850 | p00773 | u637657888 | 1555919586 | Python | Python3 | py | Runtime Error | 0 | 0 | 349 | def tax(p,x):
return p*(100+x) // 100
def solve(X,Y,S):
for a in range(1,S):
for b in range(1,S):
sum = tax(a,X)+tax(b,X)
if sum == S:
if sum > S:
break
return best
while True:
X,Y,S = map(int, input().strip().split(''))
if X == 0:
... |
s056856130 | p00773 | u637657888 | 1555919993 | Python | Python3 | py | Runtime Error | 0 | 0 | 413 | def tax(p,x):
return p*(100+x) // 100
def solve(X,Y,S):
for a in range(1,S):
for b in range(1,S-a+1):
sum = tax(a,X)+tax(b,X)
if sum == S:
NS = tax(a,Y)+tax(b,Y)
A=NS
if sum > S:
break
return A
while True:
X,Y,S... |
s525026840 | p00773 | u637657888 | 1555920567 | Python | Python3 | py | Runtime Error | 0 | 0 | 442 | def tax(p,x):
return p*(100+x) // 100
def solve(X,Y,S):
for a in range(1,S):
for b in range(1,S-a+1):
sum = tax(a,X)+tax(b,X)
if sum == S:
NS = tax(a,Y)+tax(b,Y)
if newsum > ans:
A = NS
if sum > S:
br... |
s408469688 | p00773 | u637657888 | 1555920685 | Python | Python3 | py | Runtime Error | 0 | 0 | 436 | def tax(p,x):
return p*(100+x) // 100
def solve(X,Y,S):
for a in range(1,S):
for b in range(1,S-a+1):
sum = tax(a,X)+tax(b,X)
if sum == S:
NS = tax(a,Y)+tax(b,Y)
if NS > A:
A = NS
if sum > S:
break
... |
s122396275 | p00773 | u621997536 | 1420893894 | Python | Python3 | py | Runtime Error | 19920 | 6748 | 355 | eps = 0.00000001
while True:
x, y, s = map(int, input().split())
if x == 0:
break
x /= 100
y /= 100
n = 0
for a in range(1, s):
for b in range(1, s):
if (int)(a * (1 + x) + eps) + (int)(b * (1 + x) + eps) == s:
n = max(n, (int)(a * (1 + y) + eps) + (in... |
s795438778 | p00773 | u621997536 | 1420894636 | Python | Python | py | Runtime Error | 19930 | 4276 | 363 | eps = 0.00000001
while True:
x, y, s = map(int, raw_input().split())
if x == 0:
break
x /= 100.0
y /= 100.0
n = 0
for a in range(1, s):
for b in range(1, s):
if (int)(a * (1 + x) + eps) + (int)(b * (1 + x) + eps) == s:
n = max(n, (int)(a * (1 + y) + ep... |
s986459224 | p00773 | u124909914 | 1426055421 | Python | Python3 | py | Runtime Error | 19930 | 6808 | 845 | from math import ceil, floor
def tax(a, t):
return floor(a * (100 + t) / 100)
def tax_sum(a, b, t):
return tax(a, t) + tax(b, t)
while True:
x, y, s = map(int, input().split())
if x == 0: break
ls = []
for i in range(s):
j = i
while tax_sum(i,j,x) <= s:
if tax_sum... |
s658939371 | p00773 | u124909914 | 1426055640 | Python | Python3 | py | Runtime Error | 19930 | 6808 | 420 | from math import floor
def tax(a, t):
return floor(a * (100 + t) / 100)
def tax_sum(a, b, t):
return tax(a, t) + tax(b, t)
while True:
x, y, s = map(int, input().split())
if x == 0: break
ls = []
ans = 0
for i in range(s):
j = i
while tax_sum(i,j,x) <= s:
if t... |
s422704283 | p00773 | u124909914 | 1426056191 | Python | Python3 | py | Runtime Error | 19920 | 6724 | 394 | def tax(a, t):
return int(a * (100 + t) / 100)
def tax_sum(a, b, t):
return tax(a, t) + tax(b, t)
while True:
x, y, s = map(int, input().split())
if x == 0: break
ls = []
ans = 0
for i in range(s):
j = i
while tax_sum(i,j,x) <= s:
if tax_sum(i,j,x) == s:
... |
s174970400 | p00773 | u124909914 | 1426056722 | Python | Python3 | py | Runtime Error | 19930 | 6724 | 357 | def tax(a, t):
return int(a * (100 + t) / 100)
def tax_sum(a, b, t):
return tax(a, t) + tax(b, t)
while True:
x, y, s = map(int, input().split())
if x == 0: break
ls = []
ans = 0
for i in range(1,s):
for j in range(i,s):
if tax_sum(i,j,x) == s:
ans = ma... |
s555907040 | p00773 | u124909914 | 1426057063 | Python | Python3 | py | Runtime Error | 19920 | 6724 | 423 | def tax(a, t):
return int(a * (100 + t) / 100)
def tax_sum(a, b, t):
return tax(a, t) + tax(b, t)
if __name__ == "__main__":
while True:
x, y, s = map(int, input().split())
if x == 0: break
ls = []
ans = 0
for i in range(1,s):
for j in range(i,s):
... |
s421211084 | p00773 | u124909914 | 1426057673 | Python | Python3 | py | Runtime Error | 19930 | 6724 | 352 | def tax(a, t):
return int(a * (100 + t) / 100)
def tax_sum(a, b, t):
return tax(a, t) + tax(b, t)
while True:
x, y, s = map(int, input().split())
if x == 0:
break
ans = 0
for i in range(1,s):
for j in range(i,s):
if tax_sum(i,j,x) == s:
ans = max(ans... |
s925810176 | p00773 | u124909914 | 1426057737 | Python | Python3 | py | Runtime Error | 19920 | 6724 | 352 | def tax(a, t):
return int(a * (100 + t) / 100)
def tax_sum(a, b, t):
return tax(a, t) + tax(b, t)
while True:
x, y, s = map(int, input().split())
if x == 0:
break
ans = 0
for i in range(1,s):
for j in range(i,s):
if tax_sum(i,j,x) == s:
ans = max(ans... |
s042996151 | p00773 | u408260374 | 1429526932 | Python | Python3 | py | Runtime Error | 19920 | 6724 | 346 | def calRate(m, r):
return int(m * (100 + r) / 100)
while True:
x, y, s = map(int, input().split())
if x == 0 and y == 0 and s == 0: break
ans = 0
for i in range(1, s):
for j in range(1, s):
if calRate(i, x) + calRate(j, x) == s:
ans = max(ans, calRate(i, y) + cal... |
s374845534 | p00773 | u316268279 | 1429550059 | Python | Python3 | py | Runtime Error | 19930 | 6720 | 336 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
while True:
x,y,s = map(int,input().split())
if (x,y,s) == (0,0,0):
break
ans = 0
for i in range(1,s-1):
for j in range(1,s-1):
if i*(100+x)//100 + j*(100+x)//100== s:
ans = max(ans,i*(100+y)//100 + j*(100+y)//100... |
s804781368 | p00773 | u998188826 | 1443288690 | Python | Python3 | py | Runtime Error | 40000 | 7564 | 270 |
def tax(p, x):
return p * (100 + x) // 100
while True:
x, y, s = map(int, input().split())
if (x, y, s) == (0, 0, 0):
break
r = 0
for i in range(1, s):
for j in range(1, s):
if (tax(i, x) + tax(j, x)) == s:
r = max((tax(i, y) + tax(j, y)), r)
print(r) |
s080929622 | p00773 | u871745100 | 1489132193 | Python | Python3 | py | Runtime Error | 40000 | 7560 | 332 | g = lambda rate, price: price * (100 + rate) // 100
while True:
x, y, s = map(int, input().split())
if x == y == s == 0:
break
maximum = -1
for i in range(1, s):
for j in range(1, s):
if g(x, i) + g(x, j) == s:
maximum = max(maximum, g(y, i) + g(y, j))
pr... |
s481380875 | p00773 | u371539389 | 1494232927 | Python | Python3 | py | Runtime Error | 40000 | 7572 | 353 | import sys
def tax(p,x):
return int(p*(100+x)/100)
while True:
x,y,s=[int(i) for i in input().split(" ")]
if x==0 and y==0 and s==0:
sys.exit()
maximum=0
for i in range(1,s-1):
for j in range(1,s-1):
if tax(i,x)+tax(j,x)==s:
maximum=max(tax(i,y)+tax(... |
s073552776 | p00773 | u283315132 | 1499330360 | Python | Python3 | py | Runtime Error | 40000 | 7824 | 418 | import math
def ri(): return int(input())
def rli(): return list(map(int, input().split()))
def tax(p, rate):
return math.floor(p*(100+rate)/100)
ans = 0
x, y, s = rli()
while(x != 0 or y != 0 or s != 0):
for i in range(1,1000):
for j in range(1,1000):
if(tax(i, x) + tax(j, x) == s):
... |
s562376340 | p00773 | u633333374 | 1502695648 | Python | Python3 | py | Runtime Error | 0 | 0 | 661 | import math
while 1:
x, y, s = map(int,raw_input().split())
if x == y == s == 0:
break
list = []
for i in range(1,s/2+1):
a = i*1.0*100/(100+x)
if isinstance(a,int) == False:
if (math.trunc(a) + 1)*(100+x)/100 != i:
a = 0
else:
... |
s233417177 | p00773 | u741801763 | 1506255942 | Python | Python3 | py | Runtime Error | 40000 | 7736 | 515 | if __name__ == "__main__":
while 1:
x,y,z = list(map(int,input().strip().split()))
if x ==0 and y ==0 and z ==0:break
data = []
for i in range(1,z):
t1 = i + int(i * x/100)
for j in range(1,z):
t2 = j + int(j * (x/100))
if t1 +... |
s545484055 | p00773 | u015553205 | 1506943579 | Python | Python3 | py | Runtime Error | 40000 | 7684 | 780 | #Name: Hidemi_Nakamura
#Seat: ????????????????????????
#URL: http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=1192&lang=jp
#Problem_Title: Tax_Rate_Changed
#Impression&Review: ?????????????????????????????????????????????????????????????????????????????????
#Taxed = int(p*(1+x/100))
flg = 1
d = [0]
while flg... |
s038751064 | p00773 | u015553205 | 1506943818 | Python | Python3 | py | Runtime Error | 40000 | 7688 | 729 | #Name: Hidemi_Nakamura
#Seat: ????????????????????????
#URL: http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=1192&lang=jp
#Problem_Title: Tax_Rate_Changed
#Impression&Review: ?????????????????????????????????????????????????????????????????????????????????
#Taxed = int(p*(1+x/100))
flg = 1
d = [0]
while flg... |
s724751019 | p00773 | u015553205 | 1507390371 | Python | Python3 | py | Runtime Error | 40000 | 7768 | 490 | flg = 1
d = [0]
while flg > 0:
inp = input().split()
d.append(inp)
flg = int((inp[0]))**2+int((inp[1]))**2+int((inp[2]))**2
for i in range(1,len(d)-1):
x = int(d[i][0])
y = int(d[i][1])
s = int(d[i][2])
M = 0
for k in range(1,s-1):
for l in range(1,s-1):
a = int(k*(... |
s372978089 | p00773 | u015553205 | 1507390871 | Python | Python3 | py | Runtime Error | 40000 | 7660 | 438 |
flg = 1
while flg > 0:
inp = input().split()
x = int(inp[0])
y = int(inp[1])
s = int(inp[2])
flg = x**2+y**2+s**2
if flg == 0:
break
M = 0
for i in range(1,s-1):
for j in range(1,s-1):
a = int(i*(1+x/100))
b = int(j*(1+x/100))
if (a... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.