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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
s673009871 | p00713 | u685815919 | 1481271946 | Python | Python | py | Runtime Error | 40000 | 9868 | 772 | import math
while True:
n=int(raw_input())
if n==0: break
if n==1:
raw_input()
print 1
continue
p=[]
for _ in xrange(n):
x,y=raw_input().split()
p.append((float(x),float(y)))
cs=[]
for i in xrange(n-1):
for j in xrange(i+1,n):
v=(p[j][0]-p[i][0], p[j][1]-p[i][1])
l=math... |
s753794503 | p00713 | u269391636 | 1529317106 | Python | Python3 | py | Runtime Error | 0 | 0 | 747 | def cent(p1,p2):
if abs(p1-p2) >= 2:
return None,None
else:
q = (p1+p2)/2
r = (p1-p2)
n = abs(p1-p2)
t = r * 1j * ((1-r*2)**0.5/r)
return(q + t, q - t)
while(True):
ans = 0
n = int(input())
ps = []
for _ in range(n):
x,y = map(int,input().... |
s833596879 | p00713 | u269391636 | 1529337625 | Python | Python3 | py | Runtime Error | 0 | 0 | 789 | def cent(p1,p2):
if abs(p1-p2) >= 2:
return None,None
else:
q = (p1+p2)/2
r = (p1-p2)/2
n = abs(r)
t = r * 1j * ((1-n**2)**0.5/n)
return(q + t, q - t)
while(True):
ans = 0
n = int(input())
if n == 0:
quit()
ps = []
for _ in range(n):
... |
s868338305 | p00713 | u269391636 | 1529337842 | Python | Python3 | py | Runtime Error | 0 | 0 | 789 | def cent(p1,p2):
if abs(p1-p2) >= 2:
return None,None
else:
q = (p1+p2)/2
r = (p1-p2)/2
n = abs(r)
t = r * 1j * ((1-n**2)**0.5/n)
return(q + t, q - t)
while(True):
ans = 1
n = int(input())
if n == 0:
quit()
ps = []
for _ in range(n):
... |
s329048031 | p00713 | u467175809 | 1530264912 | Python | Python | py | Runtime Error | 0 | 0 | 1102 | #!/usr/bin/env python
from collections import deque
import itertools as it
import sys
import math
sys.setrecursionlimit(1000000)
while True:
N = input()
if N == 0:
break
pos = []
for loop in range(N):
S = map(float, raw_input().split())
pos.append(S)
ans = 0
for i in r... |
s335330208 | p00713 | u467175809 | 1530265251 | Python | Python | py | Runtime Error | 0 | 0 | 1288 | #!/usr/bin/env python
from collections import deque
import itertools as it
import sys
import math
sys.setrecursionlimit(1000000)
def func():
while True:
N = input()
if N == 0:
break
pos = []
for loop in range(N):
S = map(float, raw_input().split())
... |
s504332358 | p00713 | u467175809 | 1530265935 | Python | Python | py | Runtime Error | 0 | 0 | 1277 | #!/usr/bin/env python
from collections import deque
import itertools as it
import sys
import math
sys.setrecursionlimit(1000000)
def func():
while True:
N = input()
if N == 0:
break
R = range(N)
pos = []
for loop in R:
S = map(float, raw_input().spl... |
s680734073 | p00713 | u467175809 | 1530266091 | Python | Python3 | py | Runtime Error | 0 | 0 | 1278 | #!/usr/bin/env python
from collections import deque
import itertools as it
import sys
import math
sys.setrecursionlimit(1000000)
def func():
while True:
N = input()
if N == 0:
break
R = range(N)
pos = []
for loop in R:
S = map(float, raw_input().spl... |
s992197695 | p00713 | u467175809 | 1530266299 | Python | Python3 | py | Runtime Error | 0 | 0 | 1285 | #!/usr/bin/env python
from collections import deque
import itertools as it
import sys
import math
sys.setrecursionlimit(1000000)
def func():
while True:
N = int(input())
if N == 0:
break
R = range(N)
pos = []
for loop in R:
S = list(map(float, input... |
s889626725 | p00713 | u467175809 | 1530266641 | Python | Python3 | py | Runtime Error | 0 | 0 | 1429 | #!/usr/bin/env python
from collections import deque
import itertools as it
import sys
import math
sys.setrecursionlimit(1000000)
def func():
lst = []
while True:
S = input()
lst.append(S)
if S == '0':
break
lst = list(reversed(lst))
while True:
N = int(lst.... |
s477127082 | p00713 | u467175809 | 1530266705 | Python | Python3 | py | Runtime Error | 0 | 0 | 1333 | #!/usr/bin/env python
import math
def func():
lst = []
while True:
S = input()
lst.append(S)
if S == '0':
break
lst = list(reversed(lst))
while True:
N = int(lst.pop())
if N == 0:
break
R = range(N)
pos = []
for lo... |
s011781794 | p00713 | u467175809 | 1530267909 | Python | Python3 | py | Runtime Error | 0 | 0 | 1433 | #!/usr/bin/env python
from collections import deque
import itertools as it
import sys
import math
sys.setrecursionlimit(1000000)
def func():
lst = []
while True:
S = input()
lst.append(S)
if S == '0':
break
lst = list(reversed(lst))
while True:
N = int(lst.... |
s510064682 | p00713 | u269391636 | 1530559889 | Python | Python3 | py | Runtime Error | 0 | 0 | 794 | def cent(p1,p2):
if abs(p1-p2) >= 2:
return None,None
else:
q = (p1+p2)/2
r = (p1-p2)/2
n = abs(r)
t = r * 1j * ((1-n**2)**0.5/n)
return(q + t, q - t)
while(True):
ans = 1
n = int(input())
if n == 0:
quit()
ps = []
for _ in range(n):
... |
s730563198 | p00713 | u269391636 | 1530559980 | Python | Python3 | py | Runtime Error | 0 | 0 | 828 | def cent(p1,p2):
if abs(p1-p2) >= 2:
return None,None
else:
q = (p1+p2)/2
r = (p1-p2)/2
n = abs(r)
t = r * 1j * ((1-n**2)**0.5/n)
return(q + t, q - t)
while(True):
ans = 1
n = int(input())
if n == 0:
quit()
elif n == 1:
print(1)
... |
s175181314 | p00713 | u269391636 | 1530560169 | Python | Python3 | py | Runtime Error | 0 | 0 | 876 | def cent(p1,p2):
if abs(p1-p2) >= 2:
return None,None
else:
q = (p1+p2)/2
r = (p1-p2)/2
n = abs(r)
if n == 0:
return None,None
t = r * 1j * ((1-n**2)**0.5/n)
return(q + t, q - t)
while(True):
ans = 1
n = int(input())
if n == 0:
... |
s227291516 | p00713 | u269391636 | 1530560592 | Python | Python3 | py | Runtime Error | 0 | 0 | 940 | def cent(p1,p2):
if abs(p1-p2) >= 2:
return None,None
else:
q = (p1+p2)/2
r = (p1-p2)/2
n = abs(r)
if n == 0:
return None,None
t = r * 1j * ((1-n**2)**0.5/n)
return(q + t, q - t)
def abs(x):
return(((x.real) ** 2 + (x.imag) ** 2) ** 0.5)
... |
s867185790 | p00713 | u633068244 | 1399890687 | Python | Python | py | Runtime Error | 39860 | 6164 | 342 | import random
ans = 0
while 1:
n = input()
if n == 0: break
xy = [map(float,raw_input().split()) for i in range(n)]
for r in range(20000):
cx,cy = 10*random.random(),10*random.random()
cur = 0
for i in range(n):
x,y = xy[i]
if (cx-x)**2 + (cy-y)**2 <= 1:
cur += 1
if n - cur < ans: break
ans = m... |
s473453105 | p00717 | u338932851 | 1456231234 | Python | Python | py | Runtime Error | 0 | 0 | 1402 | import sys
while(True):
n=int(raw_input())
if (n==0):break
Map=[]
for i in range(n+1):
m=int(raw_input())
res=[]
for j in range(m):
x = map(int, sys.stdin.readline().replace('\n','').split(' '))
res.append(complex(x[0],x[1]))
Map.append(res)
... |
s738641828 | p00717 | u338932851 | 1456231454 | Python | Python | py | Runtime Error | 0 | 0 | 1402 | import sys
while(True):
n=int(raw_input())
if (n==0):break
Map=[]
for i in range(n+1):
m=int(raw_input())
res=[]
for j in range(m):
x = map(int, sys.stdin.readline().replace('\n','').split(' '))
res.append(complex(x[0],x[1]))
Map.append(res)
... |
s695771989 | p00717 | u338932851 | 1456231468 | Python | Python | py | Runtime Error | 0 | 0 | 1402 | import sys
while(True):
n=int(raw_input())
if (n==0):break
Map=[]
for i in range(n+1):
m=int(raw_input())
res=[]
for j in range(m):
x = map(int, sys.stdin.readline().replace('\n','').split(' '))
res.append(complex(x[0],x[1]))
Map.append(res)
... |
s275808440 | p00717 | u338932851 | 1456231621 | Python | Python | py | Runtime Error | 0 | 0 | 1402 | import sys
while(True):
n=int(raw_input())
if (n==0):break
Map=[]
for i in range(n+1):
m=int(raw_input())
res=[]
for j in range(m):
x = map(int, sys.stdin.readline().replace('\n','').split(' '))
res.append(complex(x[0],x[1]))
Map.append(res)
... |
s192468749 | p00718 | u328199937 | 1555848948 | Python | Python | py | Runtime Error | 0 | 0 | 1237 | ans_list = []
n = int(input())
def mcxl2digit(s):
ans = 0
dig = 1
for i in range(len(s)):
if "2" <= s[i] <= "9":
dig = int(s[i])
else:
if s[i] == "m":
key = 100
elif s[i] == "c":
key = 100
elif s[i] == "x":
... |
s608000389 | p00719 | u352394527 | 1530788583 | Python | Python3 | py | Runtime Error | 0 | 0 | 1061 | from heapq import heappush, heappop
from itertools import permutations
INF = 10 ** 20
while True:
n, m, p, a, b = map(int, input().split())
if n == 0:
break
a -= 1
b -= 1
tlst = list(map(int, input().split()))
edges = [[] for _ in range(m)]
for _ in range(p):
x, y, z = map(int, input().split())
... |
s732269518 | p00721 | u075842827 | 1499944379 | Python | Python3 | py | Runtime Error | 40000 | 13104 | 2092 | # -*- coding: utf-8 -*-
import sys
import subprocess
import json
import time
import math
import re
import sqlite3
import random
from queue import Queue
dy = [0, 0, 1, -1]
dx = [1, -1, 0, 0]
INF = int(1e20)
class Point:
def __init__(self, y, x, distance = 0):
self.y = y
self.x = x
self.dis... |
s743525753 | p00721 | u075842827 | 1499944587 | Python | Python3 | py | Runtime Error | 40000 | 13096 | 2090 | # -*- coding: utf-8 -*-
import sys
import subprocess
import json
import time
import math
import re
import sqlite3
import random
from queue import Queue
dy = [0, 0, 1, -1]
dx = [1, -1, 0, 0]
INF = int(1e20)
class Point:
def __init__(self, y, x, distance = 0):
self.y = y
self.x = x
self.dis... |
s482661657 | p00721 | u352394527 | 1529663735 | Python | Python3 | py | Runtime Error | 0 | 0 | 1507 | from heapq import heappush, heappop
INF = 10 ** 20
direct = ((0, -1), (0, 1), (-1, 0), (1, 0))
def dist(fr, to, mp):
que = []
heappush(que, (0, fr))
visited = [[False] * len(mp[0]) for _ in range(len(mp))]
visited[fr[1]][fr[0]] = True
while que:
d, point = heappop(que)
x, y = point
for dx, dy in... |
s259180139 | p00721 | u352394527 | 1529665299 | Python | Python3 | py | Runtime Error | 0 | 0 | 1708 | from heapq import heappush, heappop
INF = 10 ** 10
direct = ((0, -1), (0, 1), (-1, 0), (1, 0))
def dist(fr, to, mp):
que = []
heappush(que, (0, fr))
visited = [[False] * len(mp[0]) for _ in range(len(mp))]
visited[fr[1]][fr[0]] = True
while que:
d, point = heappop(que)
x, y = point
for dx, dy in... |
s728506655 | p00721 | u779627195 | 1354898045 | Python | Python | py | Runtime Error | 0 | 5068 | 1734 | import sys
from Queue import Queue
R = lambda:map(int,raw_input().split())
MAX = 10000000
dirt = []
dx = [0,1,0,-1]
dy = [1,0,-1,0]
def CalcCost(start):
global visited
cost = [[MAX for j in xrange(w)] for i in xrange(h)]
cost[start[1]][start[0]] = 0
q = Queue()
q.put(start)
while not q.empty()... |
s124692856 | p00723 | u338932851 | 1456382655 | Python | Python | py | Runtime Error | 0 | 0 | 530 | =int(raw_input())
def comb(tr):
l=len(tr)
res=[]
for i in range(l):
head,tail=tr[i:],tr[:i]
headrev=head[::-1]
tailrev=tail[::-1]
res.append(head+tail)
res.append(headrev+tail)
res.append(head+tailrev)
res.append(headrev+tailrev)
res.append(ta... |
s439750820 | p00724 | u479246559 | 1381985764 | Python | Python | py | Runtime Error | 39870 | 4160 | 16 | while(1):
pass |
s073973375 | p00725 | u488601719 | 1452678321 | Python | Python | py | Runtime Error | 0 | 0 | 1920 | dx = [1, -1, 0, 0]
dy = [0, 0, 1, -1]
def dfs(x, y, cnt):
global board, W, H, ans
if ans <= cnt:
return
for i in range(4):
mx, my = x, y
mx += dx[i]
my += dy[i]
if 0 > mx or 0 > my or W <= mx or H <= my:
continue
if board[my][mx] == 1:
... |
s861557926 | p00725 | u420446254 | 1520611286 | Python | Python3 | py | Runtime Error | 0 | 0 | 1965 |
dx = [0, 1, 0, -1]
dy = [1, 0, -1, 0]
N_MOVE = 4
EMPTY = 0
ROCK = 1
START = 2
GOAL = 3
INF = 100000
def in_field(field, x, y):
return y >=0 and y < len(field) and x >= 0 and x< len(field[0])
def move_to_rock(field, x, y, direction):
while(True):
x += dx[direction]
y += dy[direction]
... |
s508325891 | p00725 | u269391636 | 1529250637 | Python | Python3 | py | Runtime Error | 0 | 0 | 3159 | from queue import Queue as q
from copy import deepcopy as cp
def l_move(data):
global flag
field,n,i,j = data[0],data[1],data[2],data[3]
if j == 0 or field[i][j-1] == 1 or n == 0:
return(None)
field[i] = cp(field[i])
while(j):
if field[i][j-1] == 0:
field[i][j] = 0
... |
s055716418 | p00726 | u467175809 | 1530260620 | Python | Python | py | Runtime Error | 0 | 0 | 1936 | #!/usr/bin/env python
from collections import deque
import itertools as it
import sys
sys.setrecursionlimit(1000000)
def check(c):
return (ord(c) >= ord('0') and ord(c) <= ord('9'))
while True:
S1, S2 = raw_input().split()
if S1 == '0':
break
N = int(S2)
SS = ''
flag = False
for ... |
s844617717 | p00726 | u915761101 | 1369792428 | Python | Python | py | Runtime Error | 0 | 0 | 2624 | #include <vector>
#include <list>
#include <map>
#include <set>
#include <stack>
#include <queue>
#include <deque>
#include <algorithm>
#include <utility>
#include <functional>
#include <sstream>
#include <iostream>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <cctype>
#include <string>
#include <cstr... |
s107458242 | p00728 | u637657888 | 1555918536 | Python | Python3 | py | Runtime Error | 0 | 0 | 462 | 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
# b増加ならばsum増加のため1
return best
while True:
... |
s867441398 | p00728 | u637657888 | 1555918601 | Python | Python3 | py | Runtime Error | 0 | 0 | 458 | 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
# b増加ならばsum増加のため1
return best
while True:
X,Y,... |
s951850917 | p00728 | u637657888 | 1555919011 | Python | Python3 | py | Runtime Error | 0 | 0 | 454 | 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
# b増加ならばsum増加のため1
return best
while True:
X,Y,S = ... |
s940243098 | p00728 | u637657888 | 1555919112 | Python | Python3 | py | Runtime Error | 0 | 0 | 348 | 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:
... |
s732253592 | p00728 | u637657888 | 1555919187 | 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(... |
s948026000 | p00728 | u715278210 | 1556601781 | Python | Python3 | py | Runtime Error | 0 | 0 | 499 | while True:
#審判の数
n = int(input())
if n == 0:
break
while n >= 3 and n <= 100: #審判の数は3〜100人
a = [0]*n #空いてる配列
for i in range(n): #空いてる配列に点数を入れる
s = int(input())
a[i] = s
tensu = (sum(a) - min(a) -max(a))/(len(a)-2) #一番でかい点数と一番小さ... |
s798557269 | p00728 | u966364923 | 1419211759 | Python | Python3 | py | Runtime Error | 0 | 0 | 175 | while True:
n = int(input())
if n == 0:
exit()
score = []
for i in range(n):
score.append(int(input()))
print((sorted(score)[1:-1])//(n-2)) |
s764615521 | p00728 | u124909914 | 1423116236 | Python | Python | py | Runtime Error | 0 | 0 | 306 | #!/usr/bin/python3
from math import floor
while True:
n = eval(input())
if n != 0:
ls = []
for i in range(n):
m = eval(input())
ls.append(m)
ls.remove(max(ls))
ls.remove(min(ls))
print(floor(sum(ls)/len(ls)))
else:
break |
s809153147 | p00728 | u124909914 | 1424151886 | Python | Python | py | Runtime Error | 0 | 0 | 306 | #!/usr/bin/python3
from math import floor
while True:
n = eval(input())
if n != 0:
ls = []
for i in range(n):
m = eval(input())
ls.append(m)
ls.remove(max(ls))
ls.remove(min(ls))
print(floor(sum(ls)/len(ls)))
else:
break |
s522543596 | p00728 | u531061483 | 1432717907 | Python | Python | py | Runtime Error | 0 | 0 | 341 | # -*- coding:utf-8 -*-
#ICPC得点集計ソフトウェア
import sys
def solve(n):
nums = []
for i in xrange(n):
temp = input()
nums.append(temp)
nums.sort()
sum = 0
for i in xrange(1,n-1):
sum += nums[i]
return sum / (n-2)
if __name__ == "__main__":
while :
N = input()
if N == 0:
sys.exit()
else:
print solve(N... |
s621319548 | p00728 | u110278902 | 1445843198 | Python | Python | py | Runtime Error | 0 | 0 | 1039 | import sys
import math
def load_file(file_name):
f = open(file_name)
lines = f.readlines()
f.close()
return lines
def change_type(lines):
new_line = []
for line in lines:
new_line.append(int(line))
return new_line
def make_group(lines):
group = []
number = lines[0]
l... |
s285787318 | p00728 | u110278902 | 1445869974 | Python | Python3 | py | Runtime Error | 0 | 0 | 308 | # -*- coding: utf-8 -*-
import math
def main(n):
scores = []
for i in range(n):
scores.append(int(raw_input))
scores.remove(max(scores))
scores.remove(min(scores))
print math.floor(sum(scores)/len(scores))
while 1:
n = int(raw_input)
if n == 0:
break
main(n) |
s963640734 | p00728 | u110278902 | 1445869984 | Python | Python | py | Runtime Error | 0 | 0 | 308 | # -*- coding: utf-8 -*-
import math
def main(n):
scores = []
for i in range(n):
scores.append(int(raw_input))
scores.remove(max(scores))
scores.remove(min(scores))
print math.floor(sum(scores)/len(scores))
while 1:
n = int(raw_input)
if n == 0:
break
main(n) |
s967919736 | p00728 | u146816547 | 1471335782 | Python | Python | py | Runtime Error | 0 | 0 | 172 | while True:
n = int(raw_input())
if n == 0:
break
l = []
for i in range(n):
l.append(int(raw_input())
print (sum(l) - max(l) - min(l)) / (len(l) - 2) |
s794636085 | p00728 | u166860661 | 1480775198 | Python | Python | py | Runtime Error | 0 | 0 | 469 | #coding: utf-8
import sys
import math
l = []
for line in sys.stdin:
l.append(int(line))
check = 0
point_list = []
for i in range(len(l)):
if check == 0:
last_row = i + l[n]
check = 1
continue
else:
point_list.append(i)
if i == last_row:
point_list.sort(... |
s526705253 | p00728 | u166860661 | 1480775241 | Python | Python | py | Runtime Error | 0 | 0 | 469 | #coding: utf-8
import sys
import math
l = []
for line in sys.stdin:
l.append(int(line))
check = 0
point_list = []
for i in range(len(l)):
if check == 0:
last_row = i + l[i]
check = 1
continue
else:
point_list.append(i)
if i == last_row:
point_list.sort(... |
s059467529 | p00728 | u166860661 | 1480775589 | Python | Python | py | Runtime Error | 0 | 0 | 463 | #coding: utf-8
import sys
import math
l = []
for line in sys.stdin:
l.append(int(line))
check = 0
point_list = []
for i in range(len(l)):
if check == 0:
last_row = i + l[i]
check = 1
else:
point_list.append(i)
if i == last_row:
point_list.sort()
poi... |
s006766954 | p00728 | u166860661 | 1480775846 | Python | Python | py | Runtime Error | 0 | 0 | 465 | #coding: utf-8
import sys
import math
l = []
for line in sys.stdin:
l.append(int(line))
check = 0
point_list = []
for i in range(len(l)-1):
if check == 0:
last_row = i + l[i]
check = 1
else:
point_list.append(i)
if i == last_row:
point_list.sort()
p... |
s658259798 | p00728 | u501510481 | 1500005692 | Python | Python | py | Runtime Error | 0 | 0 | 26 | str=readlines()
print(str) |
s535565034 | p00728 | u501510481 | 1500005775 | Python | Python | py | Runtime Error | 0 | 0 | 39 | str=readlines()
print(str)
print("aaa") |
s049866921 | p00728 | u501510481 | 1500005873 | Python | Python | py | Runtime Error | 0 | 0 | 34 | str=read()
print(str)
print("aaa") |
s348884923 | p00728 | u166871988 | 1502700399 | Python | Python3 | py | Runtime Error | 0 | 0 | 229 | while True:
n=int(input())
points=[]
for i in range(n):
points.append(int(input()))
points.remove(max(points))
points.remove(min(points))
print(sum(points)/len(points))
if int(input())==0:break |
s975650445 | p00728 | u166871988 | 1502700570 | Python | Python3 | py | Runtime Error | 0 | 0 | 234 | while True:
n=int(input())
points=[]
for i in range(n):
points.append(int(input()))
points.remove(max(points))
points.remove(min(points))
print(int(sum(points)/len(points)))
if int(input())==0:break |
s798125115 | p00728 | u146816547 | 1523084859 | Python | Python | py | Runtime Error | 0 | 0 | 158 | while True:
n = int(raw_input())
if !n:
break
L = [int(raw_input()) for _ in range(n)]
print (sum(L) - max(L) - min(L)) / (n - 2)
|
s540217851 | p00728 | u878596989 | 1523845791 | Python | Python3 | py | Runtime Error | 0 | 0 | 183 | while True:
N = int(input())
if 3
N == 0:
break
S = []
for i in range(N):
S.append(int(input()))
print((sum(S) - max(S) - min(S))//(len(S)-2))
|
s121351641 | p00728 | u925259339 | 1526552585 | Python | Python3 | py | Runtime Error | 0 | 0 | 327 | import math
def main():
f = true
r = []
while f:
n = int(input())
if n == 0:
break
m = []
for i in range(n):
m.append(int(input()))
r.append(math.floor((sum(m) - max(m) - min(m)/(n-2)))
res = ''
for j in r:
res += str(j)
pr... |
s565583700 | p00728 | u925259339 | 1526552712 | Python | Python3 | py | Runtime Error | 0 | 0 | 340 | import math
def main():
f = true
r = []
while f:
n = int(input())
if n == 0:
break
m = []
for i in range(n):
m.append(int(input()))
r.append(math.floor((sum(m) - max(m) - min(m)/(n-2))))
res = ''
for j in r:
res += str(j)
p... |
s760344975 | p00728 | u703446356 | 1400595802 | Python | Python | py | Runtime Error | 0 | 0 | 241 | while(True):
n = input()
if n == 0:
break;
sl = 1001
sh = 0
ret = 0
for i in range(n):
tmp = input()
sum += tmp
if tmp < sl:
sl = tmp
if tmp > sh:
sh = tmp
ret -= (sl + sh)
print "%d" % (ret/n) |
s492839760 | p00729 | u120360464 | 1424167843 | Python | Python | py | Runtime Error | 0 | 0 | 914 | #! /usr/bin/python
# -*- coding: utf-8 -*-
from bisect import *
while 1:
(N, M) = map(int, raw_input().split())
if N == 0: break
r = int(raw_input())
used = [0]*(N+1)
imos = [[0]*1301 for i in range(1001)]
for i in range(r):
(t, n, m, s) = map(int, raw_input().split())
if s == ... |
s397270658 | p00729 | u120360464 | 1424168993 | Python | Python | py | Runtime Error | 0 | 0 | 1047 | #! /usr/bin/python
# -*- coding: utf-8 -*-
from bisect import *
while 1:
(N, M) = map(int, raw_input().split())
if N == 0: break
r = int(raw_input())
used = [0]*(N+1)
imos = [[0]*1301 for i in range(M+1)]
for i in range(r):
(t, n, m, s) = map(int, raw_input().split())
if s == 1... |
s303919739 | p00730 | u328199937 | 1555834296 | Python | Python3 | py | Runtime Error | 0 | 0 | 1254 | ans_list = []
def make_pieces(w, d, s):
s %= (2 * w + 2 * d)
while True:
if w > s:
return [s, d], [w - s, d]
s -= w
if d > s:
return [w, s], [w, d - s]
s -= d
if w > s:
return [w - s, d], [s, d]
s -= w
if d > s:
... |
s489118814 | p00730 | u802625365 | 1474775048 | Python | Python3 | py | Runtime Error | 0 | 0 | 774 | def cut(cake,s):
ret_cake = [(0,0),(0,0)]
w = cake[2]
h = cake[1]
s %= 2*(w+h)
if w > s:
ret_cake = [(h,s),(h,w-s)]
elif w+h > s:
ret_cake = [(s-w,w),(w+h-s,w)]
elif 2*w+h > s:
ret_cake = [(s-w-h,w),(2*w+h-s,w)]
elif 2*w+2*h > s:
ret_cake = [(s-2*w-h,w),(2... |
s157074756 | p00730 | u408260374 | 1493918652 | Python | Python3 | py | Runtime Error | 0 | 0 | 783 | def cut(d, w, s):
s %= 2 * (d + w)
sq = []
if 0 < s < w:
sq = [(d, s), (d, w - s)]
elif w < s < w + d:
s -= w
sq = [(s, w), (d - s, w)]
elif w + d < s < 2 * w + d:
s -= w + d
sq = [(d, s), (d, w - s)]
elif 2 * w + d < s < 2 * (w + d):
s -= 2 * w + ... |
s501569513 | p00730 | u408260374 | 1493919445 | Python | Python3 | py | Runtime Error | 0 | 0 | 758 | def cut(d, w, s):
s %= 2 * (d + w)
sq = []
if 0 < s < w:
sq = [(d, s), (d, w - s)]
elif w < s < w + d:
s -= w
sq = [(s, w), (d - s, w)]
elif w + d < s < 2 * w + d:
s -= w + d
sq = [(d, s), (d, w - s)]
elif 2 * w + d < s < 2 * (w + d):
s -= 2 * w + ... |
s635854921 | p00730 | u509278866 | 1529633014 | Python | Python3 | py | Runtime Error | 0 | 0 | 1269 | import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,random,time,copy,functools
sys.setrecursionlimit(10**7)
inf = 10**20
eps = 1.0 / 10**10
mod = 998244353
dd = [(0,-1),(1,0),(0,1),(-1,0)]
ddn = [(0,-1),(1,-1),(1,0),(1,1),(0,1),(-1,-1),(-1,0),(-1,1)]
def LI(): return [int(x) for x in sys.stdi... |
s601198926 | p00730 | u855199458 | 1529744548 | Python | Python3 | py | Runtime Error | 0 | 0 | 2144 | # -*- coding: utf-8 -*-
import sys
sys.path.append("C:\\Users\\nadare\\python_programs\\competitive_programming\\library")
import lib
import inspect
import pyperclip
from tqdm import tqdm
def snippet(module):
text = inspect.getsource(module)
pyperclip.copy(text)
print(text)
def get_input(inp):
... |
s036071924 | p00734 | u164311692 | 1558925070 | Python | Python3 | py | Runtime Error | 0 | 0 | 476 | def answer(n, m, taro, hanako):
for t in sorted(taro):
fot h in (hanako):
if sum(taro) - t + h == sum(hanako) - h + t:
return f'{t} {h}'
return -1
while True:
n, m = map(int, input().split())
if n == 0 and m == 0:
break
taro = []
hanako = []
... |
s550459149 | p00734 | u164311692 | 1558925534 | Python | Python3 | py | Runtime Error | 0 | 0 | 453 | def answer(n, m, taro, hanako):
for t in sorted(taro):
for h in sorted(hanako):
if sum(taro) - y + h == sum(hanako) - h + t:
return '{t} {h}'
while True:
n, m = map(int, input().split())
if n == 0 and m == 0:
break
taro = []
hanako = []
for I in range... |
s212514636 | p00734 | u164311692 | 1558925580 | Python | Python3 | py | Runtime Error | 0 | 0 | 453 | def answer(n, m, taro, hanako):
for t in sorted(taro):
for h in sorted(hanako):
if sum(taro) - t + h == sum(hanako) - h + t:
return '{t} {h}'
while True:
n, m = map(int, input().split())
if n == 0 and m == 0:
break
taro = []
hanako = []
for I in range... |
s156421274 | p00734 | u164311692 | 1558925602 | Python | Python3 | py | Runtime Error | 0 | 0 | 467 | def answer(n, m, taro, hanako):
for t in sorted(taro):
for h in sorted(hanako):
if sum(taro) - t + h == sum(hanako) - h + t:
return '{t} {h}'
return -1
while True:
n, m = map(int, input().split())
if n == 0 and m == 0:
break
taro = []
hanako = []
... |
s079722429 | p00734 | u164311692 | 1558925646 | Python | Python3 | py | Runtime Error | 0 | 0 | 467 | def answer(n, m, taro, hanako):
for t in sorted(taro):
for h in sorted(hanako):
if sum(taro) - t + h == sum(hanako) - h + t:
return '{t} {h}'
return -1
while True:
n, m = map(int, input().split())
if n == 0 and m == 0:
break
taro = []
hanako = []
... |
s548353912 | p00734 | u164311692 | 1558925728 | Python | Python3 | py | Runtime Error | 0 | 0 | 468 | def answer(n, m, taro, hanako):
for t in sorted(taro):
for h in sorted(hanako):
if sum(taro) - t + h == sum(hanako) - h + t:
return '{t} {h}'
return -1
while True:
n, m = map(int, input().split())
if n == 0 and m == 0:
break
taro = []
hanako = []
... |
s822711414 | p00734 | u128811851 | 1434524910 | Python | Python3 | py | Runtime Error | 0 | 0 | 1463 | def impossible(taro_cards, hanako_cards, average):
if (sum(taro_cards) + sum(hanako_cards)) % 2 == 1:
return True
elif sum(taro_cards) + max(taro_cards) - min(hanako_cards) < average:
return True
elif sum(hanako_cards) + max(hanako_cards) - min(taro_cards) < average:
return True
... |
s741772281 | p00734 | u128811851 | 1434524943 | Python | Python3 | py | Runtime Error | 0 | 0 | 1463 | def impossible(taro_cards, hanako_cards, average):
if (sum(taro_cards) + sum(hanako_cards)) % 2 == 1:
return True
elif sum(taro_cards) + max(taro_cards) - min(hanako_cards) < average:
return True
elif sum(hanako_cards) + max(hanako_cards) - min(taro_cards) < average:
return True
... |
s035592574 | p00734 | u128811851 | 1434525526 | Python | Python3 | py | Runtime Error | 0 | 0 | 1496 | def impossible(taro_cards, hanako_cards, average):
if (sum(taro_cards) + sum(hanako_cards)) % 2 == 1:
return True
elif sum(taro_cards) + max(taro_cards) - min(hanako_cards) < average:
return True
elif sum(hanako_cards) + max(hanako_cards) - min(taro_cards) < average:
return True
... |
s724396147 | p00734 | u672443148 | 1514710334 | Python | Python3 | py | Runtime Error | 0 | 0 | 750 | import numpy as np
while True:
N,M=map(int,input().split())
if N==0 and M==0:
break
allCards=[]
for i in range(N+M):
allCards.append(int(input()))
Taro=np.array(allCards[:N])
Hanako=np.array(allCards[N:])
Tsum=np.sum(Taro)
Hsum=np.sum(Hanako)
... |
s615115712 | p00734 | u273843182 | 1514740289 | Python | Python3 | py | Runtime Error | 0 | 0 | 864 | #include<iostream>
#include<vector>
using namespace std;
int main(){
while(1){
int n,m,x,sum1=0,sum2=0,ans=100000,num,ax=0,ay=0;
vector<int> N,M;
cin >> n >> m;
if(n==0&&m==0) break;
for(int i=n;i--;){
cin >> x;
sum1+=x;
N.push_back(x);
... |
s403816207 | p00735 | u591052358 | 1528977118 | Python | Python | py | Runtime Error | 0 | 0 | 374 | N = 300000
a = [((i % 7 ==1)or(i % 7 ==6)) for i in range(N)]
#print(a[11])
a[1]=0
p =[]
for i in range(6,N):
if a[i]:
p+=[i]
for j in range(i * i ,N,i):
a[j] = 0
while True:
n = int(input())
if n == 1:
break
print(n,end = ":")
for x in p:
if n % x ==0:
... |
s138699852 | p00736 | u467175809 | 1529351236 | Python | Python | py | Runtime Error | 0 | 0 | 990 | #!/usr/bin/env python
from collections import deque
import itertools as it
import sys
sys.setrecursionlimit(1000000)
while True:
S_ = raw_input()
if S_ == '.':
break
ans = 0
for p, q, r in it.product([0, 1, 2], repeat = 3):
S = S_
S = S.replace("P", p).replace("Q", q).replace... |
s520979599 | p00737 | u998232877 | 1434805397 | Python | Python | py | Runtime Error | 19930 | 28748 | 2209 | # -*- coding: utf-8 -*-
import heapq
class Tuple:
def __init__(self, cost, y, x, dir):
self.cost = cost
self.y = y
self.x = x
self.dir = dir
def __str__(self):
return "y=" + str(self.y) + " : " + "x=" + str(self.x) + " : " + "dir=" + str(self.dir) + ": cost=" + str(
... |
s144519233 | p00737 | u998232877 | 1434809685 | Python | Python | py | Runtime Error | 19930 | 9028 | 2252 | # -*- coding: utf-8 -*-
import heapq
class Tuple:
def __init__(self, cost, y, x, dir):
self.cost = cost
self.y = y
self.x = x
self.dir = dir
def __str__(self):
return "y=" + str(self.y) + " : " + "x=" + str(self.x) + " : " + "dir=" + str(self.dir)
dir_x = [1, 0, -1,... |
s804616765 | p00740 | u128811851 | 1434411494 | Python | Python3 | py | Runtime Error | 0 | 0 | 999 | #!/usr/bin/python
# -*- coding: utf-8 -*-
def is_winner(turn):
if having_amount.count(0) == len(having_amount) - 1:
return True
else:
return False
# having_amount[i] represents the amount of pebbles the
# candidate numbered i is having
winner_number = []
# initialize
turn = 0
while True:
... |
s372054174 | p00740 | u347385753 | 1498644010 | Python | Python3 | py | Runtime Error | 0 | 0 | 305 | while 1:
n,p = map(int,input().split())
if n==0:break
man = [0]*n
ball,a = p,0
while 1:
if ball >0:ball,man[a%n] =ball-1, man[a%n]+1
elif ball == 0:ball,man[a%n] = man[a%n],ball
a+=1
if p in man:break
print(man.index(max(man))) ) |
s715184784 | p00740 | u651355315 | 1529311854 | Python | Python3 | py | Runtime Error | 0 | 0 | 597 | import numpy as np
while True:
try:
l = list(map(int, input().split()))
S = l[0]
p = np.zeros(S)
M = l[1]
i = 0
N = M
while True:
if N == M and i != 0:
ans = i % S - 1
if ans < 0:
ans = S + ans
... |
s198194947 | p00740 | u651355315 | 1529311901 | Python | Python3 | py | Runtime Error | 0 | 0 | 597 | import numpy as np
while True:
try:
l = list(map(int, input().split()))
S = l[0]
p = np.zeros(S)
M = l[1]
i = 0
N = M
while True:
if N == M and i != 0:
ans = i % S - 1
if ans < 0:
ans = S + ans
... |
s512086680 | p00740 | u651355315 | 1529312123 | Python | Python3 | py | Runtime Error | 0 | 0 | 597 | import numpy as np
while True:
try:
l = list(map(int, input().split()))
S = l[0]
p = np.zeros(S)
M = l[1]
i = 0
N = M
while True:
if N == M and i != 0:
ans = i % S - 1
if ans < 0:
ans = S + ans
... |
s672358895 | p00740 | u651355315 | 1529312272 | Python | Python3 | py | Runtime Error | 0 | 0 | 596 | import numpy as np
while True:
try:
l = list(map(int, input().split()))
S = l[0]
p = np.zeros(S)
M = l[1]
i = 0
N = M
while True:
if N == M and i != 0:
ans = i % S - 1
if ans < 0:
ans = S + ans
... |
s478997896 | p00740 | u651355315 | 1529312543 | Python | Python3 | py | Runtime Error | 0 | 0 | 526 | import numpy as np
while True:
try:
l = list(map(int, input().split()))
S = l[0]
p = np.zeros(S)
M = l[1]
i = 0
N = M
while True:
if p[i] == M:
print(i)
break
if N == 0:
N = p[i]
... |
s562488051 | p00740 | u651355315 | 1529312656 | Python | Python3 | py | Runtime Error | 0 | 0 | 582 | import numpy as np
while True:
try:
l = list(map(int, input().split()))
S = l[0]
p = np.zeros(S)
M = l[1]
i = 0
N = M
if M == 0 and S == 0:
break
while True:
if p[i] == M:
print(i)
break... |
s216436674 | p00740 | u651355315 | 1529312729 | Python | Python3 | py | Runtime Error | 0 | 0 | 582 | import numpy as np
while True:
try:
l = list(map(int, input().split()))
S = l[0]
p = np.zeros(S)
M = l[1]
i = 0
N = M
if M == 0 and S == 0:
break
while True:
if p[i] == M:
print(i)
break... |
s225445630 | p00740 | u651355315 | 1529313225 | Python | Python3 | py | Runtime Error | 0 | 0 | 450 | import numpy as np
while True:
l = list(map(int, input().split()))
S = l[0]
p = np.zeros(S)
M = l[1]
i = 0
N = M
if M == 0 and S == 0:
break
while True:
if p[i] == M:
print(i)
break
if N == 0:
N = p[i]
p[i] = 0
... |
s732822205 | p00741 | u799595944 | 1551266507 | Python | Python3 | py | Runtime Error | 0 | 0 | 1415 | import queue
def proceess(start_x,start_y):
#insland = []
#insland.append([start_x,start_y])
new_island = queue.Queue()
map[start_x][start_y] = 0
new_island.put([start_x,start_y])
while True:
ob = new_island.get()
x = ob[0]
y = ob[1]
print("x : " + str(x) + ", y ... |
s872818284 | p00741 | u799595944 | 1551266633 | Python | Python3 | py | Runtime Error | 0 | 0 | 1420 | import queue
def proceess(start_x,start_y):
#insland = []
#insland.append([start_x,start_y])
new_island = queue.Queue()
map[start_x][start_y] = 0
new_island.put([start_x,start_y])
while True:
ob = new_island.get()
x = ob[0]
y = ob[1]
#print("x : " + str(x) + ", y... |
s278981855 | p00741 | u328199937 | 1555844377 | Python | Python | py | Runtime Error | 0 | 0 | 2246 | anslist = []
def sarch(i, j, visited):
if 0 < i:
if visited[i - 1][j] == 0:
visited[i - 1][j] = 1
sarch(i - 1, j, visited)
if 0 < j:
if visited[i - 1][j - 1] == 0:
visited[i - 1][j - 1] = 1
sarch(i - 1, j - 1, visited)
if j... |
s449373454 | p00741 | u328199937 | 1555844410 | Python | Python3 | py | Runtime Error | 0 | 0 | 2246 | anslist = []
def sarch(i, j, visited):
if 0 < i:
if visited[i - 1][j] == 0:
visited[i - 1][j] = 1
sarch(i - 1, j, visited)
if 0 < j:
if visited[i - 1][j - 1] == 0:
visited[i - 1][j - 1] = 1
sarch(i - 1, j - 1, visited)
if j... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.