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
s839688278
p00228
u633068244
1396444510
Python
Python
py
Runtime Error
0
0
211
ref=[63,6,91,79,102,109,125,39,127,111] while 1: try: n=int(raw_input()) if n==-1:break e=0 for i in range(n): a=ref[int(raw_input())] print "{:07b}".format(a^e) e=a except SyntaxError: pass
s226129414
p00230
u724963150
1505030248
Python
Python3
py
Runtime Error
0
0
1075
while True: n=int(input()) if n==0:break b=[[int(p)for p in input().split(" ")],[int(p)for p in input().split(" ")]] mem=[[1145141919 for i in range(n)]for j in range(2)] mem[1][0]=True que=[[0,0,0],[1,0,0]] count=1145141919 while len(que)!=0: d=que.pop(0) state=b[d[0]][d...
s584280564
p00230
u724963150
1505030322
Python
Python3
py
Runtime Error
0
0
1056
while True: n=int(input()) if n==0:break b=[[int(p)for p in input().split(" ")],[int(p)for p in input().split(" ")]] mem=[[1145141919 for i in range(n)]for j in range(2)] que=[[0,0,0],[1,0,0]] count=1145141919 while len(que)!=0: d=que.pop(0) state=b[d[0]][d[1]] if sta...
s338039484
p00230
u724963150
1505033305
Python
Python3
py
Runtime Error
0
0
2099
while True: #for t in range(1): n=int(input()) #n=8 if n==0:break b=[[int(p)for p in input().split(" ")],[int(p)for p in input().split(" ")]] #b=[[0,0,0,2,2,2,0,0],[1,1,1,1,0,0,0,0]] mem=[[False for i in range(n)]for j in range(2)] mem[0][0]=True mem[1][0]=True que=[[0,0,0],[1,0,0]] ...
s513866629
p00230
u724963150
1505069286
Python
Python3
py
Runtime Error
0
0
1537
def bfs(b): mem=[[False for i in range(n)]for j in range(2)] st=[0,0] for i in range(2): while b[i][st[i]+1]==1: st[i]+=1 mem[0][st[0]]=True mem[1][st[1]]=True que=[[0,0,0],[1,0,0]] while len(que)!=0: d=que.pop(0) des=(d[0]+1)%2 cst=d[2]+1 ...
s212248110
p00231
u633068244
1397924216
Python
Python
py
Runtime Error
0
0
239
while 1: n = input() if n == 0: break datas = [map(int,raw_input().split()) for i in range(n)] maxw = 0 for d1 in datas: w = sum([d2[0] for d2 in datas if d2[1]<=d1[1]<d2[2]]) maxw = max(w,mxw) print "OK" if maxw <= 150 else "NG"
s319222744
p00232
u631023380
1449898747
Python
Python3
py
Runtime Error
0
0
1082
def solve(X, Y, Z, V, E, A): dp = [[0.0] * 6001 for _ in range(Y + max(V) + 1)] dp[0][0] = 1.0 for i in range(Y): for j in range(5001): if dp[i][j] <= 0.0: continue for k in V: t = i + k if t > Y: dp[Y][j] +=...
s557613369
p00233
u546285759
1496881084
Python
Python3
py
Runtime Error
0
0
124
while True: A = input() if A == '0': break print(sum(int(a)*pow(-10, i) for i, a in enumerate(A[::-1])))
s153451656
p00234
u352394527
1530084604
Python
Python3
py
Runtime Error
0
0
1882
INF = 10 ** 20 def update_state(state, newx): tmp = list(state) tmp[newx] = 1 return tuple(tmp) def get_co(x, y): dc = do = 0 score = mp[y][x] if score < 0: dc = -score else: do = score return dc, do def minimum_cost(nowx, nowy, state, ox, goal, dic, w, m): if (nowx, nowy, state, ox) in dic...
s888516978
p00234
u352394527
1530084647
Python
Python3
py
Runtime Error
0
0
1924
import sys sys.setrecursionlimit(1000000) INF = 10 ** 20 def update_state(state, newx): tmp = list(state) tmp[newx] = 1 return tuple(tmp) def get_co(x, y): dc = do = 0 score = mp[y][x] if score < 0: dc = -score else: do = score return dc, do def minimum_cost(nowx, nowy, state, ox, goal, dic, ...
s168761870
p00234
u352394527
1530085169
Python
Python3
py
Runtime Error
0
0
1882
import sys sys.setrecursionlimit(1000000) INF = 10 ** 20 def update_state(state, newx): tmp = list(state) tmp[newx] = 1 return tuple(tmp) def get_co(x, y): dc = do = 0 score = mp[y][x] if score < 0: dc = -score else: do = score return dc, do def minimum_cost(x, y, state, ox, goal, dic, w, m):...
s596874287
p00234
u352394527
1530086780
Python
Python3
py
Runtime Error
0
0
2449
import sys sys.setrecursionlimit(1000000) INF = 10 ** 20 def update_state(state, newx): tmp = list(state) tmp[newx] = 1 return tuple(tmp) def get_co(x, y): dc = do = 0 score = mp[y][x] if score < 0: dc = -score else: do = score return dc, do def minimum_cost(x, y, state, ox, goal, dic, w, m):...
s377899098
p00238
u766477342
1414922428
Python
Python3
py
Runtime Error
0
0
462
while 1: t = int(input()) if t == 0:break n = int(input()) x = 0 for i in range(n): x += (lambda lst:lst[-1] - lst[0])(list(map(int,input().split()))) print('OK' if t<=x else (t-x)) while 1: t = int(input()) if t == 0:break #n = int(input()) #x = 0 #for i in range(n):...
s740204026
p00238
u737311644
1520159450
Python
Python3
py
Runtime Error
0
0
236
while True: t=int(input()) n=int(input()) b=0 if t == 0: break for i in range(n): s,f=map(int,input().split()) a=f-s b+=a if t<=b: print("OK") else: print(t-b)
s869787466
p00239
u873482706
1437372530
Python
Python
py
Runtime Error
0
0
435
def f(v): for i in range(4): if l[i] < v[i]: return else: return True while True: N = int(raw_input()) if N == 0: break data = {} for n in range(N): i, p, q, r = map(int, raw_input().split()) data[i] = [p, q, r] l = map(int, raw_input().split()) ...
s919382831
p00239
u575065019
1346495606
Python
Python
py
Runtime Error
0
5764
1203
ans = [] while True: n = input() if n == 0: breakans = [] while True: n = input() if n == 0: break sweets = [0] * n flbg = 0 for i in range(n): sweets[i] = map(int,raw_input().split()) sweets[i].append(sweets[i][0]*4+sweets[i][1]*9+sweets[i][2]*4) limit = ...
s702882945
p00239
u621997536
1380589069
Python
Python
py
Runtime Error
0
0
716
#include<iostream> using namespace std; int main() { while(1) { int n; int table[1001][4]; cin >> n; if(!n) break; for(int i = 0; i < n; i++) { cin >> table[i][0] >> table[i][1] >> table[i][2] >> table[i][3]; table[i][4] = table[i][1] * 4 + table[i][2] * 9 + table[i][3] *...
s103341487
p00239
u621997536
1380589111
Python
Python
py
Runtime Error
0
0
716
#include<iostream> using namespace std; int main() { while(1) { int n; int table[1001][5]; cin >> n; if(!n) break; for(int i = 0; i < n; i++) { cin >> table[i][0] >> table[i][1] >> table[i][2] >> table[i][3]; table[i][4] = table[i][1] * 4 + table[i][2] * 9 + table[i][3] *...
s561355016
p00242
u567380442
1427103971
Python
Python3
py
Runtime Error
0
0
642
import sys import string from collections import Counter f = sys.stdin while True: n = int(f.readline()) if n == 0: break counters = {c:Counter() for c in string.ascii_lowercase} for i in range(n): for word in f.readline().strip().split(): counters[word[0]].update([word...
s754607075
p00248
u266872031
1500291331
Python
Python
py
Runtime Error
10
6380
806
while(1): [n,m]=map(int,raw_input().split()) if n==0: break D=[[] for i in range(n+1)] D[0]=range(1,n+1) nflg=0 for i in range(m): [u,v]=map(int,raw_input().split()) D[u].append(v) D[v].append(u) if len(D[u])>2 or len(D[v])>2: nflg=1 if nflg: ...
s684220059
p00251
u069727578
1551530046
Python
Python3
py
Runtime Error
0
0
2167
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; import java.io.UncheckedIOException; import java.util.StringTokenizer; public class Main { public static void main(String[] args) { SC sc = new SC(System.in); int sum=0; for(int i=0; i<10; i+...
s860708242
p00251
u775586391
1466498614
Python
Python3
py
Runtime Error
0
0
44
print(sum([int(input()) for i in range(10)])
s365616954
p00252
u300302243
1442217552
Python
Python
py
Runtime Error
0
0
82
s = raw_input() if s == "1 1 0" or s == "0 0 1": print "Open" else print "Close"
s093662919
p00252
u529013669
1476888943
Python
Python3
py
Runtime Error
20
7352
152
if __name__ == "__main__": ticket = input() reult = "Close" if ticket in {"1 1 0", "0 0 1"}: result = "Open" print(result)
s182753496
p00252
u584779197
1495951876
Python
Python
py
Runtime Error
0
0
167
B = input() bb = B.split(' ') b1 = bb[0] b2 = bb[1] b3 = bb[2] if b1 == '1' and b2 == '1': print("Open") elif b3 == '1': print("Open") else: print("Close")
s283949379
p00252
u584779197
1495952213
Python
Python
py
Runtime Error
0
0
167
B = input() bb = B.split(' ') b1 = bb[0] b2 = bb[1] b3 = bb[2] if b1 == '1' and b2 == '1': print("Open") elif b3 == '1': print("Open") else: print("Close")
s634733485
p00252
u609255173
1364686872
Python
Python
py
Runtime Error
20
4208
104
m=[0,1,0,0,0,0,1,0] (a, b, c) = map(int, raw_input().split()) print ["Close", "Open"][a * 4 + b * 2 + c]
s557247682
p00253
u865312527
1369151114
Python
Python
py
Runtime Error
10
4228
276
#!/usr/bin/env python while 1: n=int(raw_input()) if n==0: break h1=map(int, raw_input().split()) for h in h1: h2=[ x for x in h1 if x!=h ] g=[ h2[i+1]-h2[i] for i in range(n-1) ] if len(set(g))==1: print h break
s391154981
p00253
u865312527
1369151406
Python
Python
py
Runtime Error
20
4224
276
#!/usr/bin/env python while 1: n=int(raw_input()) if n==0: break h1=map(int, raw_input().split()) for h in h1: h2=[ x for x in h1 if x!=h ] g=[ h2[i+1]-h2[i] for i in range(n-1) ] if len(set(g))==1: print h break
s794402669
p00253
u865312527
1369151737
Python
Python
py
Runtime Error
20
4224
373
#!/usr/bin/env python while 1: try: n=int(raw_input()) if n==0: break h1=map(int, raw_input().split()) for h in h1: h2=[ x for x in h1 if x!=h ] g=[ h2[i+1]-h2[i] for i in range(n-1) ] if len(set(g))==1: print h brea...
s090833057
p00253
u865312527
1369151804
Python
Python
py
Runtime Error
20
4228
393
#!/usr/bin/env python while 1: try: n=int(raw_input()) if n==0: break h1=map(int, raw_input().split()) for h in h1: h2=[ x for x in h1 if x!=h ] g=[ h2[i+1]-h2[i] for i in range(n-1) ] if len(set(g))==1: print h brea...
s130340949
p00253
u633068244
1400425680
Python
Python
py
Runtime Error
0
0
356
while 1: n = input() if n == 0: break a = map(int,raw_input().split()) da = [a[i+1] - a[i] for i in range(n)] d = sorted(list(set(da)), key = lambda x:da.count(x)[1] for i in range(n): if i == 0 and a[i] + d != a[i+1]: if a[i] + 2*d == a[i+2]: print a[i+1] else: print a[i] break elif a[i] + d...
s334663427
p00254
u163873584
1409768208
Python
Python
py
Runtime Error
20
4236
512
def calculate(num,i): num.sort(reverse=True) if num[0] == num[3]: return "NA" L = num[0] * 1000 + num[1] * 100 + num[2] * 10 + num[3] S = num[3] * 1000 + num[2] * 100 + num[1] * 10 + num[0] new_N = L - S if new_N == 6174: return i + 1 return calculate(map(int,str(new_N)),i+1) ans = [] while(1): inp...
s762027190
p00254
u546285759
1492392229
Python
Python3
py
Runtime Error
20
7548
393
while True: N = input() if N == "0000": break ans = 0 if all([1 if s == N[-1] else 0 for s in N[:-1]]): print("NA") continue while int(N) != 6174: a, b, c, d = N[0], N[1], N[2], N[3] S = sorted([a, b, c, d]) L = int([''.join(S[::-1])][0]) S = ...
s081435033
p00254
u546285759
1492392485
Python
Python3
py
Runtime Error
20
7464
366
while True: N = input() if N == "0000": break ans = 0 if int(N) % 1111 == 0: print("NA") continue while int(N) != 6174: a, b, c, d = N[0], N[1], N[2], N[3] S = sorted([a, b, c, d]) L = int([''.join(S[::-1])][0]) S = int([''.join(S)][0]) ...
s699057023
p00254
u811773570
1503934154
Python
Python
py
Runtime Error
0
0
320
while True: n = input() if n == "0000": break if n.count(n[0]) == 4: print("NA") continue cnt = 0 while n != "6174": n, l = sorted(list(n)), sorted(list(n), reverse=True) n = str(int("".join(l)) - int("".join(n))).zfill(4) cnt += 1 print(cnt)
s680197885
p00254
u811773570
1503934233
Python
Python
py
Runtime Error
0
0
320
while True: n = input() if n == "0000": break if n.count(n[0]) == 4: print("NA") continue cnt = 0 while n != "6174": n, l = sorted(list(n)), sorted(list(n), reverse=True) n = str(int("".join(l)) - int("".join(n))).zfill(4) cnt += 1 print(cnt)
s935565040
p00254
u811773570
1503934314
Python
Python
py
Runtime Error
0
0
320
while True: n = input() if n == "0000": break if n.count(n[0]) == 4: print("NA") continue cnt = 0 while n != "6174": n, l = sorted(list(n)), sorted(list(n), reverse=True) n = str(int("".join(l)) - int("".join(n))).zfill(4) cnt += 1 print(cnt)
s008812140
p00254
u811773570
1503937596
Python
Python
py
Runtime Error
0
0
320
while True: n = input() if n == "0000": break if n.count(n[0]) == 4: print("NA") continue cnt = 0 while n != "6174": n, l = sorted(list(n)), sorted(list(n), reverse=True) n = str(int("".join(l)) - int("".join(n))).zfill(4) cnt += 1 print(cnt)
s256550895
p00254
u633068244
1396720988
Python
Python
py
Runtime Error
20
4232
317
while 1: n=list(raw_input()) if n[0]==n[1]==n[2]==n[3]=="0": break elif n[0]==n[1]==n[2]==n[3]: print "NA" continue count=0 while 1: if n==["6","1","7","4"]: print count break m=sorted(n)[::-1] l=sorted(n)[n.count("0"):] n=list(str(int("".join(map(str,m)))-int("".join(map(str,l))))) count+=1
s499015497
p00255
u811434779
1437891297
Python
Python
py
Runtime Error
10
4224
344
while True: n = input() if n == 0: break p = map(int, raw_input().strip().split(" ")) j = map(int, raw_input().strip().split(" ")) j.sort(); j.reverse(); sum = 0; num = n; for m in p: sum += m for i in range(n): if (num-1)*(sum+j[i]) < num*sum: break num-=1; sum+=...
s729952665
p00256
u766477342
1415888084
Python
Python3
py
Runtime Error
19930
6812
1581
KI = 1 W = 20 * KI T = 18 * W KA = 20 * T B = 20 * KA MAX_MAYA = 12 * B + 19*KA + 19*T + 17*W + 19 month = (31,28,31,30,31,30,31,31,30,31,30,31) def is_uruu(y): return y % 4 == 0 and (y % 100 != 0 or y % 400 == 0) def y_d(y): return 365 if not is_uruu(y) else 366 def m_d(y,m): return 29 if (m == 2 and is...
s489121856
p00256
u567380442
1426988914
Python
Python3
py
Runtime Error
0
0
1469
from datetime import date from datetime import timedelta import datetime def is_leap_year(y): return y % 4 == 0 and (y % 100 != 0 or y % 400 == 0) def leap_year_count(target_y,benchmark_y): target = target_y // 4 - target_y // 100 + target_y // 400 benchmark = benchmark_y // 4 - benchmark_y // 100 + bench...
s626564273
p00256
u567380442
1426989222
Python
Python3
py
Runtime Error
0
0
1502
import datetime def is_leap_year(y): return y % 4 == 0 and (y % 100 != 0 or y % 400 == 0) def leap_year_count(target_y,benchmark_y): target = target_y // 4 - target_y // 100 + target_y // 400 benchmark = benchmark_y // 4 - benchmark_y // 100 + benchmark_y // 400 return target - benchmark def ad2mayan...
s723015918
p00256
u567380442
1426990048
Python
Python3
py
Runtime Error
0
0
1476
import datetime def is_leap_year(y): return y % 4 == 0 and (y % 100 != 0 or y % 400 == 0) def leap_year_count(target_y,benchmark_y): target = target_y // 4 - target_y // 100 + target_y // 400 benchmark = benchmark_y // 4 - benchmark_y // 100 + benchmark_y // 400 return target - benchmark def ad2mayan...
s305916277
p00256
u957021183
1506324136
Python
Python3
py
Runtime Error
0
0
1192
# Aizu Problem 0261: Mayan Crucial Prediction import sys, math, os, datetime # read input: PYDEV = os.environ.get('PYDEV') #if PYDEV=="True": sys.stdin = open("sample-input.txt", "rt") dpm = [0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31] # day per month def get_day(year, month, day): if month <= 2: ...
s087532053
p00256
u957021183
1506324992
Python
Python3
py
Runtime Error
0
0
1592
# Aizu Problem 0261: Mayan Crucial Prediction import sys, math, os, datetime # read input: PYDEV = os.environ.get('PYDEV') #if PYDEV=="True": sys.stdin = open("sample-input.txt", "rt") dpm = [0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31] # day per month def get_day(year, month, day): if month <= 2: ...
s270401782
p00257
u567380442
1427005201
Python
Python3
py
Runtime Error
30
6756
797
def sugoroku(m, d): d = [0] + d + [0] start, goal = 0, len(d) - 1 g = [[0 for j in range(len(d))] for i in range(len(d))] for i in range(len(d) - 1): for mi in range(1, m + 1): pos = min(goal, i + mi) pos = max(start, pos + d[pos]) g[i][pos] = 1 for k in...
s808435360
p00258
u567380442
1427028676
Python
Python3
py
Runtime Error
0
0
936
def solve(a, b): pdp = {a[0]:0} ndp = {} for ai in a[1:] + [0]: for k, v in pdp.items(): for bi in b: vb = v + st(k, bi) kb = k & (65535 ^ bi) | ai try: ndp[kb] = max(ndp[kb], vb) except KeyError: ...
s044230682
p00259
u300302243
1443609599
Python
Python3
py
Runtime Error
0
0
30
raise Exception((eval("'a'")))
s779396254
p00259
u300302243
1443609699
Python
Python3
py
Runtime Error
0
0
51
if eval('1') == 1: raise Exception("a") print("b")
s143582566
p00262
u766477342
1414855262
Python
Python3
py
Runtime Error
19930
6724
1180
while 1: N = int(input()) if N == 0:break lst = list(map(int,input().split())) s_len = 1 n = lst[-1] # for v in reversed(lst[:-1]): # if v == n-1: # s_len += 1 # n -= 1 # else: # break result = -1 for i in range(10000): flg = Tru...
s047570846
p00262
u759934006
1373039508
Python
Python
py
Runtime Error
0
0
602
import math def check(a): for i, v in enumerate(a): if v != i + 1: return False else: if i == len(a) - 1: return True while True: n = int(raw_input()) if n == 0: break a = map(int, raw_input().split()) if sum(a) != (lambda s: s * (...
s449208045
p00263
u766477342
1420254600
Python
Python3
py
Runtime Error
0
0
505
BIN = [0] * 32 v = 1 for i in range(24, 0, -1): BIN[i] = v v *= 2 v = float(1) / 2 for i in range(25, 32): BIN[i] = v v /= 2 while 1: Q = int(input()) if not Q:break for i in range(Q): inp = format(int(input(),16),'b').zfill(32) res = float(0) for j, v in enumerate...
s717329447
p00263
u759934006
1373073096
Python
Python
py
Runtime Error
0
0
407
while True: n = int(raw_input()) if n == 0: break for j in range(n): b = bin(eval('0x' + raw_input())) b = '0' * (32 - len(b[2:])) + b[2:] s = b[0] i = b[1:-7] d = b[-7:] s = '' if s == '0' else '-' i = eval('0b' + i) d = sum([1.0 / 2 ...
s782757292
p00263
u633068244
1396780913
Python
Python
py
Runtime Error
0
0
192
for i in range(input()): hex=raw_input() bit="" for j in b: bit+=format(int(j,16),"b").zfill(4) ans=0.0 for i in range(1,32): ans+=int(bit[i])*2.0**(24-i) print (-1)**int(bit[0])*ans
s764682415
p00263
u633068244
1396781977
Python
Python
py
Runtime Error
0
0
78
gets $<.map{|l|n=0.0;b=l.hex;31.times{|i|n+=(2**(24-i))*b[i]};p n*(-1)**b[31]}
s896801536
p00265
u633068244
1396783787
Python
Python
py
Runtime Error
0
0
529
n,q=map(int,raw_input().split()) c=map(int,raw_input().split()) p=[0]*(max(c)+1) for i in c: p[i]=1 for k in range(q): m=int(raw_input())n,q=map(int,raw_input().split()) c=map(int,raw_input().split()) p=[0]*(max(c)+1) for i in c: p[i]=1 for k in range(q): m=int(raw_input()) flag=0 for i in range(m-1,0,-1): fo...
s459910667
p00266
u317901693
1415613729
Python
Python
py
Runtime Error
19930
12092
753
# coding: utf-8 import math N = int(raw_input()) while N != 0: K = int(raw_input()) data = [] data2 = [] #入れ替える前 for i in range(N): data.append(i) data2.append(i) #入れ替えるところを抜き出し,入れ替える input_lines = [] for i in range(K): input_lines.append(raw_input()) a,b = [int(x)-1 for x in input_lines[i].split(" ")]...
s911747929
p00266
u317901693
1415613806
Python
Python
py
Runtime Error
19920
12092
753
# coding: utf-8 import math N = int(raw_input()) while N != 0: K = int(raw_input()) data = [] data2 = [] #入れ替える前 for i in range(N): data.append(i) data2.append(i) #入れ替えるところを抜き出し,入れ替える input_lines = [] for i in range(K): input_lines.append(raw_input()) a,b = [int(x)-1 for x in input_lines[i].split(" ")]...
s232463771
p00266
u317901693
1415613979
Python
Python
py
Runtime Error
19930
12088
739
# coding: utf-8 import math N = int(raw_input()) while N != 0: K = int(raw_input()) data = [] data2 = [] #入れ替える前 for i in range(N): data.append(i) data2.append(i) #入れ替えるところを抜き出し,入れ替える input_lines = [] for i in range(K): input_lines.append(raw_input()) a,b = [int(x)-1 for x in input_lines[i].split(" ")]...
s112785530
p00266
u317901693
1415615596
Python
Python
py
Runtime Error
19930
12088
741
# coding: utf-8 import math N = int(raw_input()) while N != 0: K = int(raw_input()) data = [] data2 = [] #入れ替える前 for i in range(N): data.append(i) data2.append(i) #入れ替え input_lines = [] for i in range(K): input_lines.append(raw_input()) a,b = [int(x)-1 for x in input_lines[i].split(" ")] #a番目とb番目を入れ替...
s635622263
p00266
u317901693
1415619461
Python
Python
py
Runtime Error
20
4424
895
# coding: utf-8 import math N = int(raw_input()) while N != 0: K = int(raw_input()) data = [] data2 = [] #入れ替える前 for i in range(N): data.append(i) data2.append(i) #入れ替え input_lines = [] for i in range(K): input_lines.append(raw_input()) a,b = [int(x)-1 for x in input_lines[i].split(" ")] #a番目とb番目を入れ替...
s193425682
p00266
u317901693
1415622294
Python
Python
py
Runtime Error
19930
16288
814
# coding: utf-8 import math #階乗計算 fact = [] tmp = 0 for i in range(100000): if i == 0: fact.append(1) else: fact.append(fact[i-1]*i%1000000007) N = int(raw_input()) while N != 0: K = int(raw_input()) data = [] data2 = [] #入れ替える前 for i in range(N): data.append(i) data2.append(i) #入れ替え input_lines = [] ...
s306451799
p00266
u317901693
1415622509
Python
Python
py
Runtime Error
19920
16536
814
# coding: utf-8 import math #階乗計算 fact = [] tmp = 0 for i in range(100000): if i == 0: fact.append(1) else: fact.append(fact[i-1]*i%1000000007) N = int(raw_input()) while N != 0: K = int(raw_input()) data = [] data2 = [] #入れ替える前 for i in range(N): data.append(i) data2.append(i) #入れ替え input_lines = [] ...
s348132341
p00266
u317901693
1415623542
Python
Python
py
Runtime Error
0
0
827
# coding: utf-8 import math import scipy #階乗計算 fact = [] tmp = 0 for i in range(100000): if i == 0: fact.append(1) else: fact.append(fact[i-1]*i%1000000007) N = int(raw_input()) while N != 0: K = int(raw_input()) data = [] data2 = [] #入れ替える前 for i in range(N): data.append(i) data2.append(i) #入れ替え inpu...
s804158283
p00266
u317901693
1415623577
Python
Python
py
Runtime Error
0
0
833
# coding: utf-8 import math import numpy as np #階乗計算 fact = [] tmp = 0 for i in range(100000): if i == 0: fact.append(1) else: fact.append(fact[i-1]*i%1000000007) N = int(raw_input()) while N != 0: K = int(raw_input()) data = [] data2 = [] #入れ替える前 for i in range(N): data.append(i) data2.append(i) #入れ替え...
s115061518
p00266
u317901693
1415649088
Python
Python
py
Runtime Error
0
0
816
# coding: utf-8 import scipy #階乗計算 fact = [] tmp = 0 for i in range(100000): if i == 0: fact.append(1) else: fact.append(fact[i-1]*i%1000000007) N = int(raw_input()) while N != 0: K = int(raw_input()) data = [] data2 = [] #入れ替える前 for i in range(N): data.append(i) data2.append(i) #入れ替え input_lines = []...
s069521253
p00266
u317901693
1415649119
Python
Python
py
Runtime Error
19930
16320
815
# coding: utf-8 import math #階乗計算 fact = [] tmp = 0 for i in range(100000): if i == 0: fact.append(1) else: fact.append(fact[i-1]*i%1000000007) N = int(raw_input()) while N != 0: K = int(raw_input()) data = [] data2 = [] #入れ替える前 for i in range(N): data.append(i) data2.append(i) #入れ替え input_lines = [] ...
s555588954
p00266
u317901693
1415800096
Python
Python
py
Runtime Error
19930
18932
982
# coding: utf-8 import math fact = [] tmp = 0 for i in range(100000): if i == 0: fact.append(1) else: fact.append(fact[i-1]*i%1000000007) N = int(raw_input()) while N != 0: K = int(raw_input()) data = [] index = [] for i in range(N): data.append(i) index.append(i) input_lines = [] for i in range(K): ...
s635978181
p00266
u317901693
1415800230
Python
Python
py
Runtime Error
19930
18932
994
# coding: utf-8 import math fact = [] tmp = 0 for i in range(100000): if i == 0: fact.append(1) else: fact.append(fact[i-1]*i%1000000007) N = int(raw_input()) while N != 0: K = int(raw_input()) data = [] index = [] for i in range(N): data.append(i) index.append(i) input_lines = [] for i in range(K): ...
s954303497
p00266
u317901693
1415800444
Python
Python
py
Runtime Error
19930
19920
954
# coding: utf-8 import math fact = [] tmp = 0 for i in range(100000): if i == 0: fact.append(1) else: fact.append(fact[i-1]*i%1000000007) N = int(raw_input()) while N != 0: K = int(raw_input()) data = [i for i in range(N)] index = list(data) input_lines = [] for i in range(K): input_lines.append(raw_input...
s156384973
p00266
u317901693
1415800736
Python
Python
py
Runtime Error
0
0
984
# coding: utf-8 import math fact = [] tmp = 0 for i in range(100000): if i == 0: fact.append(1) else: fact.append(fact[i-1]*i%1000000007) N = int(raw_input()) data_tmp = [i for i in range(N)] while N != 0: K = int(raw_input()) data = list(data_tmp) index = list(data_tmp) input_lines = [] for i in range(K): ...
s183616207
p00266
u317901693
1415808237
Python
Python
py
Runtime Error
0
0
962
# coding: utf-8 import math fact = [] tmp = 0 for i in range(100000): if i == 0: fact.append(1) else: fact.append(fact[i-1]*i%1000000007) N = long(raw_input()) while N != 0: K = long(raw_input()) data = [i for i in range(N)] index = list(data_tmp) input_lines = [] for i in range(K): input_lines.append(raw...
s333424133
p00266
u317901693
1415808307
Python
Python
py
Runtime Error
19930
19948
958
# coding: utf-8 import math fact = [] tmp = 0 for i in range(100000): if i == 0: fact.append(1) else: fact.append(fact[i-1]*i%1000000007) N = long(raw_input()) while N != 0: K = long(raw_input()) data = [i for i in range(N)] index = list(data) input_lines = [] for i in range(K): input_lines.append(raw_inp...
s028124002
p00266
u317901693
1415808415
Python
Python
py
Runtime Error
19910
19916
967
# coding: utf-8 import math fact = [] tmp = 0 for i in range(100000): if i == 0: fact.append(1) else: fact.append(fact[i-1]*i%1000000007) N = int(raw_input()) while N != 0: K = int(raw_input()) data = [i for i in range(N)] index = list(data) input_lines = [] for i in range(K): input_lines.append(raw_input...
s841013298
p00266
u317901693
1415808807
Python
Python
py
Runtime Error
19930
19920
984
# coding: utf-8 import math fact = [] tmp = 0 for i in range(100000): if i == 0: fact.append(1) else: fact.append(fact[i-1]*i%1000000007) N = int(raw_input()) while N != 0: K = int(raw_input()) data = [i for i in range(N)] index = list(data) input_lines = [] for i in range(K): input_lines.append(raw_input...
s167337006
p00266
u317901693
1415812443
Python
Python
py
Runtime Error
19920
18392
973
# coding: utf-8 import math fact = [] tmp = 0 for i in xrange(100000): if i == 0: fact.append(1) else: fact.append(fact[i-1]*i%1000000007) N = int(raw_input()) while N != 0: K = int(raw_input()) data = [i for i in xrange(N)] index = list(data) input_lines = [] for i in xrange(K): input_lines.append(raw_in...
s557429750
p00266
u317901693
1415812885
Python
Python
py
Runtime Error
19920
18500
1080
# coding: utf-8 import math import time fact = [] tmp = 0 for i in xrange(100000): if i == 0: fact.append(1) else: fact.append(fact[i-1]*i%1000000007) N = int(raw_input()) start = time.time() while N != 0: K = int(raw_input()) data = [i for i in xrange(N)] index = list(data) input_lines = [] for i in xrange...
s540073172
p00266
u317901693
1415813040
Python
Python
py
Runtime Error
19930
18496
1080
# coding: utf-8 import math import time fact = [] tmp = 0 for i in xrange(100000): if i == 0: fact.append(1) else: fact.append(fact[i-1]*i%1000000007) N = int(raw_input()) start = time.time() while N != 0: K = int(raw_input()) data = [i for i in xrange(N)] index = list(data) input_lines = [] for i in xrange...
s647890233
p00266
u317901693
1415813104
Python
Python
py
Runtime Error
0
0
828
# coding: utf-8 import math import time fact = [] tmp = 0 for i in xrange(100000): if i == 0: fact.append(1) else: fact.append(fact[i-1]*i%1000000007) N = int(raw_input()) start = time.time() while N != 0: K = int(raw_input()) data = [i for i in xrange(N)] index = list(data) input_lines = [] for i in xrange...
s597919242
p00266
u317901693
1415813190
Python
Python
py
Runtime Error
19930
18368
1079
# coding: utf-8 import math import time fact = [] tmp = 0 for i in xrange(100000): if i == 0: fact.append(1) else: fact.append(fact[i-1]*i%1000000007) N = int(raw_input()) start = time.time() while N != 0: K = int(raw_input()) data = [i for i in xrange(N)] index = list(data) input_lines = [] for i in xrange...
s950123500
p00266
u317901693
1415813407
Python
Python3
py
Runtime Error
0
0
975
# coding: utf-8 import math fact = [] tmp = 0 for i in xrange(100000): if i == 0: fact.append(1) else: fact.append(fact[i-1]*i%1000000007) N = int(raw_input()) while N != 0: K = int(raw_input()) data = [i for i in xrange(N)] index = list(data) input_lines = [] for i in xrange(K): input_lines.append(raw_in...
s193663760
p00266
u317901693
1415813544
Python
Python3
py
Runtime Error
19930
25860
954
# coding: utf-8 import math fact = [] tmp = 0 for i in range(100000): if i == 0: fact.append(1) else: fact.append(fact[i-1]*i%1000000007) N = int(input()) while N != 0: K = int(input()) data = [i for i in range(N)] index = list(data) input_lines = [] for i in range(K): input_lines.append(input()) a,b = ...
s015237661
p00266
u766477342
1416316682
Python
Python3
py
Runtime Error
100
9100
945
class BIT: MAX_IDX = 100001 def __init__(self): self.bit = [0 for i in range(self.MAX_IDX+1)] def update(self,idx,v): while idx <= self.MAX_IDX: self.bit[idx] += v idx += idx & (-idx) def sum(self,idx): res = 0 while idx > 0: res += se...
s828461860
p00266
u766477342
1416316934
Python
Python3
py
Runtime Error
19930
22464
958
class BIT: MAX_IDX = 100001 def __init__(self): self.bit = [0 for i in range(self.MAX_IDX+1)] def update(self,idx,v): while idx <= self.MAX_IDX: self.bit[idx] += v idx += idx & (-idx) def sum(self,idx): res = 0 while idx > 0: res += se...
s377498492
p00266
u766477342
1416317227
Python
Python3
py
Runtime Error
19930
18156
925
class BIT: def __init__(self,size): self.bit = [0 for i in range(size+1)] def update(self,idx,v): while idx <= len(self.bit)-1: self.bit[idx] += v idx += idx & (-idx) def sum(self,idx): res = 0 while idx > 0: res += self.bit[idx] ...
s077618819
p00266
u766477342
1416317783
Python
Python3
py
Runtime Error
19930
18160
1039
class BIT: def __init__(self,size): self.bit = [0 for i in range(size+1)] def update(self,idx,v): while idx <= len(self.bit)-1: self.bit[idx] += v idx += idx & (-idx) def sum(self,idx): res = 0 while idx > 0: res += self.bit[idx] ...
s475557860
p00271
u811434779
1436500690
Python
Python
py
Runtime Error
0
0
75
import sys for s in sys.stdin: a,b=map(int,raw_input().split()) print a-b
s329249145
p00271
u498511622
1501685708
Python
Python3
py
Runtime Error
0
0
103
while 7: a,b=map(int,input().split()) if a==-a or b== -b: print(a+b) else: print(a-b)
s779422295
p00271
u498511622
1501686050
Python
Python3
py
Runtime Error
0
0
59
for i in range(0,7) a,b=map(int,input(),split()) print(a-b)
s706044101
p00271
u498511622
1501686108
Python
Python3
py
Runtime Error
0
0
62
for i in range(0,7): a,b=map(int,input(),split()) print(a-b)
s218250507
p00271
u498511622
1501686127
Python
Python3
py
Runtime Error
0
0
60
for i in range(7): a,b=map(int,input(),split()) print(a-b)
s189748781
p00271
u633068244
1396286109
Python
Python
py
Runtime Error
0
0
79
while True: try: a,b=map(int,raw_input().split()) print a-b
s941545519
p00272
u814387366
1398758397
Python
Python
py
Runtime Error
0
0
224
while True: t,n=map(input,raw_input().split()) list=[0,0,0,0] if(t==1): list[t-1]+=n*6000 if(t==2): list[t-1]+=n*4000 if(t==3): list[t-1]+=n*3000 if(t==4): list[t-1]+=n*2000 for i in range(0,4): print list[i]
s353191720
p00272
u814387366
1398758414
Python
Python
py
Runtime Error
0
0
224
while True: t,n=map(input,raw_input().split()) list=[0,0,0,0] if(t==1): list[t-1]+=n*6000 if(t==2): list[t-1]+=n*4000 if(t==3): list[t-1]+=n*3000 if(t==4): list[t-1]+=n*2000 for i in range(0,4): print list[i]
s032369402
p00272
u814387366
1398758464
Python
Python
py
Runtime Error
0
0
218
while t,n=map(input,raw_input().split()): list=[0,0,0,0] if(t==1): list[t-1]+=n*6000 if(t==2): list[t-1]+=n*4000 if(t==3): list[t-1]+=n*3000 if(t==4): list[t-1]+=n*2000 for i in range(0,4): print list[i]
s953220180
p00273
u737311644
1520140556
Python
Python3
py
Runtime Error
0
0
176
n=int(input().split()) for i in range(n): a,b,c,d=map(int,input().split()) q,w,e,r=0,0,0,0 q,w=a*c,b*d e=q+w if c<=5 and d<=2: r=e*0.8 print(r)
s450950273
p00274
u567380442
1426764386
Python
Python3
py
Runtime Error
370
7048
223
import sys f = sys.stdin while True: n = int(f.readline()) if n == 0: break k = [int(ki) for ki in f.readline().split()] k = [ki for ki in k if 0 < ki] print('NA' if max(k) < 2 else len(k) + 1)
s969349336
p00275
u546285759
1488856991
Python
Python3
py
Runtime Error
0
0
485
while True: N = int(input()) if N==0:break dataset = input() mens = ["" for _ in range(N)] i = 0 p = "" while dataset: if i == N: i = 0 card, dataset = dataset[0], dataset[1:] if card == "M": mens[i] += card elif card == "S": p += card ...