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 int64 0 100 | memory stringlengths 4 6 | code_size int64 15 14.7k | code stringlengths 15 14.7k | problem_id stringlengths 6 6 | problem_description stringlengths 358 9.83k | input stringlengths 2 4.87k | output stringclasses 807
values | __index_level_0__ int64 1.1k 1.22M |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
s541145209 | p00600 | u685815919 | 1473919405 | Python | Python | py | Accepted | 30 | 6496 | 1,528 | class UnionFind:
def __init__(self, size):
self.table = [-1 for _ in xrange(size)]
def find(self, x):
while self.table[x] >= 0: x = self.table[x]
return x
def union(self, x, y):
s1 = self.find(x)
s2 = self.find(y)
if s1 != s2:
if self.table[s1] >= self.table[s2]:
self.table... | p00600 |
<H1><font color="#000000">Problem F:</font> Computation of Minimum Length of Pipeline</H1>
<p>
The Aizu Wakamatsu city office decided to lay a hot water pipeline covering the whole area of the city to heat houses. The pipeline starts from some hot springs and connects every district in the city. The pipeline can fork... | 3 5
12 8 25 19 23
9 13 16 0 17
20 14 16 10 22
17 27 18 16
9 7 0
19 5
21
0 0
| 38
| 23,375 |
s370530282 | p00600 | u266872031 | 1530363930 | Python | Python3 | py | Accepted | 30 | 5608 | 790 | while(1):
s,d=[int(x) for x in input().split()]
A=[999 for x in range(d)]
if s==0: break
for j in range(s):
l=[int(x) for x in input().split()]
for i in range(d):
if l[i]!=0:
A[i]=min(A[i], l[i])
B=[[999 for x in range(d)] for y in range(d)]
for j ... | p00600 |
<H1><font color="#000000">Problem F:</font> Computation of Minimum Length of Pipeline</H1>
<p>
The Aizu Wakamatsu city office decided to lay a hot water pipeline covering the whole area of the city to heat houses. The pipeline starts from some hot springs and connects every district in the city. The pipeline can fork... | 3 5
12 8 25 19 23
9 13 16 0 17
20 14 16 10 22
17 27 18 16
9 7 0
19 5
21
0 0
| 38
| 23,376 |
s566444461 | p00602 | u078042885 | 1483426738 | Python | Python3 | py | Accepted | 50 | 7752 | 295 | while 1:
try:
v,d=map(int,input().split())
f=[0]*(v+1)
f[0],f[1]=1,2
for i in range(2,v+1):
f[i]=(f[i-1]+f[i-2])%1001
f.sort()
c=1
for i in range(2,v+1):
if f[i]-f[i-1]>=d: c+=1
print(c)
except:break | p00602 |
<H1><font color="#000000">Problem H:</font> Fibonacci Sets</H1>
<p>
Fibonacci number <i>f</i>(<i>i</i>) appear in a variety of puzzles in nature and math, including packing problems, family trees or Pythagorean triangles. They obey the rule <i>f</i>(<i>i</i>) = <i>f</i>(<i>i</i> - 1) + <i>f</i>(<i>i</i> - 2), where w... | 5 5
50 1
13 13
| 2
50
8
| 23,377 |
s902649688 | p00602 | u266872031 | 1501416309 | Python | Python | py | Accepted | 40 | 6336 | 350 | while(1):
try:
[v,d]=map(int,raw_input().split())
except:
break
fib=[1 for x in range(v+2)]
for i in range (2,v+2):
fib[i]=fib[i-1]+fib[i-2]
fib.pop(0)
fib.pop(0)
fibm=sorted([x%1001 for x in fib])
ans=1
for i in range(v-1):
if fibm[i+1]-fibm[i]>=d: ... | p00602 |
<H1><font color="#000000">Problem H:</font> Fibonacci Sets</H1>
<p>
Fibonacci number <i>f</i>(<i>i</i>) appear in a variety of puzzles in nature and math, including packing problems, family trees or Pythagorean triangles. They obey the rule <i>f</i>(<i>i</i>) = <i>f</i>(<i>i</i> - 1) + <i>f</i>(<i>i</i> - 2), where w... | 5 5
50 1
13 13
| 2
50
8
| 23,378 |
s598328670 | p00602 | u847467233 | 1530707988 | Python | Python3 | py | Accepted | 40 | 5620 | 297 | # AOJ 1016: Fibonacci Sets
# Python3 2018.7.4 bal4u
f = [0]*1001
f[0], f[1] = 2, 3
for i in range(2, 1001): f[i] = (f[i-1]+f[i-2])%1001
while True:
try: V, d = map(int, input().split())
except: break
ans, a = 1, sorted(f[:V])
for i in range(1, V):
if a[i]-a[i-1] >= d: ans += 1
print(ans)
| p00602 |
<H1><font color="#000000">Problem H:</font> Fibonacci Sets</H1>
<p>
Fibonacci number <i>f</i>(<i>i</i>) appear in a variety of puzzles in nature and math, including packing problems, family trees or Pythagorean triangles. They obey the rule <i>f</i>(<i>i</i>) = <i>f</i>(<i>i</i> - 1) + <i>f</i>(<i>i</i> - 2), where w... | 5 5
50 1
13 13
| 2
50
8
| 23,379 |
s297363041 | p00602 | u303753902 | 1366994739 | Python | Python | py | Accepted | 20 | 4268 | 313 | import os
import sys
for line in sys.stdin:
v, d = [int(item) for item in line.split()]
fib = [1,1]
for i in xrange(v):
fib.append((fib[-1]+fib[-2])%1001)
fib = sorted(fib[2:])
count = 1
for i in xrange(len(fib)-1):
if fib[i+1]-fib[i] >= d: count += 1
print count | p00602 |
<H1><font color="#000000">Problem H:</font> Fibonacci Sets</H1>
<p>
Fibonacci number <i>f</i>(<i>i</i>) appear in a variety of puzzles in nature and math, including packing problems, family trees or Pythagorean triangles. They obey the rule <i>f</i>(<i>i</i>) = <i>f</i>(<i>i</i> - 1) + <i>f</i>(<i>i</i> - 2), where w... | 5 5
50 1
13 13
| 2
50
8
| 23,380 |
s502815049 | p00602 | u467175809 | 1533355408 | Python | Python | py | Accepted | 40 | 5100 | 503 | #!/usr/bin/env python
from collections import deque
import itertools as it
import sys
import math
sys.setrecursionlimit(10000000)
for line in sys.stdin:
V, d = map(int, line.split())
N = [False for i in range(2000)]
p = pp = 1
for i in range(V):
num = (p + pp) % 1001
N[num] = True
... | p00602 |
<H1><font color="#000000">Problem H:</font> Fibonacci Sets</H1>
<p>
Fibonacci number <i>f</i>(<i>i</i>) appear in a variety of puzzles in nature and math, including packing problems, family trees or Pythagorean triangles. They obey the rule <i>f</i>(<i>i</i>) = <i>f</i>(<i>i</i> - 1) + <i>f</i>(<i>i</i> - 2), where w... | 5 5
50 1
13 13
| 2
50
8
| 23,381 |
s364753191 | p00603 | u633068244 | 1417604770 | Python | Python | py | Accepted | 30 | 4232 | 414 | while 1:
try:
n,r = map(int,raw_input().split())
if r == 1: cs = [int(raw_input())]
else: cs = map(int,raw_input().split())
except:
break
C = range(n)
A,B,C = C[n/2:],C[:n/2],[]
for i in range(r):
c = cs[i]
while A or B:
C += A[:c] + B[:c]
... | p00603 |
<H1><font color="#000000">Problem I:</font> Riffle Shuffle</H1>
<p>
There are a number of ways to shuffle a deck of cards. Riffle shuffle is one such example. The following is how to perform riffle shuffle.
</p>
<p>
There is a deck of <i>n</i> cards. First, we divide it into two decks; deck A which consists of t... | 9 1
3
9 4
1 2 3 4
| 3
0
| 23,382 |
s875215416 | p00603 | u633068244 | 1417604901 | Python | Python | py | Accepted | 30 | 4228 | 358 | while 1:
try:
n,r = map(int,raw_input().split())
cs = map(int,(raw_input()+" 0").split())
except:
break
C = range(n)
A,B,C = C[n/2:],C[:n/2],[]
for i in range(r):
c = cs[i]
while A or B:
C += A[:c] + B[:c]
A,B = A[c:],B[c:]
A,B,... | p00603 |
<H1><font color="#000000">Problem I:</font> Riffle Shuffle</H1>
<p>
There are a number of ways to shuffle a deck of cards. Riffle shuffle is one such example. The following is how to perform riffle shuffle.
</p>
<p>
There is a deck of <i>n</i> cards. First, we divide it into two decks; deck A which consists of t... | 9 1
3
9 4
1 2 3 4
| 3
0
| 23,383 |
s683336056 | p00603 | u186082958 | 1480584287 | Python | Python3 | py | Accepted | 50 | 7656 | 580 | import sys
lines=[]
for line in sys.stdin:
line= line.rstrip()
lines.append(line)
for i in range(len(lines)//2):
N,R=map(int,lines[2*i].split())
ops=list(map(int,lines[2*i+1].split()))
cards=[i for i in range(N)]
for c in ops:
deck_a=cards[N//2:N]
deck_b=cards[0:N//2]
de... | p00603 |
<H1><font color="#000000">Problem I:</font> Riffle Shuffle</H1>
<p>
There are a number of ways to shuffle a deck of cards. Riffle shuffle is one such example. The following is how to perform riffle shuffle.
</p>
<p>
There is a deck of <i>n</i> cards. First, we divide it into two decks; deck A which consists of t... | 9 1
3
9 4
1 2 3 4
| 3
0
| 23,384 |
s030475449 | p00603 | u546285759 | 1489042593 | Python | Python3 | py | Accepted | 50 | 7560 | 417 | while True:
try:
n, r = map(int, input().split())
cc = list(map(int, input().split()))
card = [v for v in range(n)]
for c in cc:
A, B, C = card[n//2:], card[:n//2], []
while len(A) or len(B):
C += A[:c]
del A[:c]
... | p00603 |
<H1><font color="#000000">Problem I:</font> Riffle Shuffle</H1>
<p>
There are a number of ways to shuffle a deck of cards. Riffle shuffle is one such example. The following is how to perform riffle shuffle.
</p>
<p>
There is a deck of <i>n</i> cards. First, we divide it into two decks; deck A which consists of t... | 9 1
3
9 4
1 2 3 4
| 3
0
| 23,385 |
s693265660 | p00603 | u262566745 | 1509337296 | Python | Python3 | py | Accepted | 50 | 7972 | 702 | from collections import deque
import sys
def suffle(deck, c):
l = len(deck)
if l % 2 == 0: mid = l//2
else: mid = (l-1)//2
deckA = deck[mid:]
deckB = deck[:mid]
deckC = []
while(len(deckA) != 0 or len(deckB) != 0):
deckC.extend(deckA[:c])
deckA = deckA[c:]
deck... | p00603 |
<H1><font color="#000000">Problem I:</font> Riffle Shuffle</H1>
<p>
There are a number of ways to shuffle a deck of cards. Riffle shuffle is one such example. The following is how to perform riffle shuffle.
</p>
<p>
There is a deck of <i>n</i> cards. First, we divide it into two decks; deck A which consists of t... | 9 1
3
9 4
1 2 3 4
| 3
0
| 23,386 |
s125188017 | p00603 | u104911888 | 1367980961 | Python | Python | py | Accepted | 30 | 4252 | 538 | while True:
try:
n,r=map(int,raw_input().split())
except EOFError:
break
cset=map(int,raw_input().split())
I=range(n)
for c in cset:
A,B,C=I[n/2:],I[:n/2],[]
while A<>[] or B<>[]:
if c<=len(A):
C+=A[:c]
A=A[c:]
e... | p00603 |
<H1><font color="#000000">Problem I:</font> Riffle Shuffle</H1>
<p>
There are a number of ways to shuffle a deck of cards. Riffle shuffle is one such example. The following is how to perform riffle shuffle.
</p>
<p>
There is a deck of <i>n</i> cards. First, we divide it into two decks; deck A which consists of t... | 9 1
3
9 4
1 2 3 4
| 3
0
| 23,387 |
s177034625 | p00603 | u260980560 | 1583421213 | Python | Python3 | py | Accepted | 50 | 5612 | 601 | try:
while 1:
N, R = map(int, input().split())
*C, = map(int, input().split())
*A, = range(N)
for c in C:
lb = N//2; la = N - lb
TA = A[N//2:]
TB = A[:N//2]
A = []
a = b = 0
while a < la and b < lb:
... | p00603 |
<H1><font color="#000000">Problem I:</font> Riffle Shuffle</H1>
<p>
There are a number of ways to shuffle a deck of cards. Riffle shuffle is one such example. The following is how to perform riffle shuffle.
</p>
<p>
There is a deck of <i>n</i> cards. First, we divide it into two decks; deck A which consists of t... | 9 1
3
9 4
1 2 3 4
| 3
0
| 23,388 |
s798067952 | p00603 | u467175809 | 1533357387 | Python | Python | py | Accepted | 20 | 5016 | 525 | #!/usr/bin/env python
from collections import deque
import itertools as it
import sys
import math
sys.setrecursionlimit(10000000)
while True:
try:
n, r = map(int, raw_input().split())
except:
exit()
c = map(int, raw_input().split())
deck = [i for i in range(n)]
for i in range(r):
... | p00603 |
<H1><font color="#000000">Problem I:</font> Riffle Shuffle</H1>
<p>
There are a number of ways to shuffle a deck of cards. Riffle shuffle is one such example. The following is how to perform riffle shuffle.
</p>
<p>
There is a deck of <i>n</i> cards. First, we divide it into two decks; deck A which consists of t... | 9 1
3
9 4
1 2 3 4
| 3
0
| 23,389 |
s411079730 | p00604 | u186082958 | 1480589865 | Python | Python3 | py | Accepted | 30 | 7592 | 250 | while True:
N=0
times=[]
try:
N=int(input())
times=list(map(int,input().split()))
except:
break
times.sort(reverse=True)
ans=0
for i in range(len(times)):
ans+=(i+1)*times[i]
print(ans) | p00604 |
<H1><font color="#000000">Problem J:</font> Cheating on ICPC</H1>
<p>
Peter loves any kinds of cheating. A week before ICPC, he broke into Doctor's PC and sneaked a look at all the problems that would be given in ICPC. He solved the problems, printed programs out, and brought into ICPC. Since electronic preparati... | 3
10 20 30
7
56 26 62 43 25 80 7
| 100
873
| 23,390 |
s451716683 | p00604 | u078042885 | 1486248155 | Python | Python3 | py | Accepted | 30 | 7736 | 133 | while 1:
try:n=int(input())
except:break
print(sum((n-i)*x for i,x in enumerate(sorted(list(map(int,input().split())))))) | p00604 |
<H1><font color="#000000">Problem J:</font> Cheating on ICPC</H1>
<p>
Peter loves any kinds of cheating. A week before ICPC, he broke into Doctor's PC and sneaked a look at all the problems that would be given in ICPC. He solved the problems, printed programs out, and brought into ICPC. Since electronic preparati... | 3
10 20 30
7
56 26 62 43 25 80 7
| 100
873
| 23,391 |
s813271900 | p00604 | u546285759 | 1486642569 | Python | Python3 | py | Accepted | 40 | 7612 | 201 | while True:
try:
_= int(input())
except:
break
t= 0
ans= []
for v in sorted(list(map(int, input().split()))):
t+= v
ans.append(t)
print(sum(ans)) | p00604 |
<H1><font color="#000000">Problem J:</font> Cheating on ICPC</H1>
<p>
Peter loves any kinds of cheating. A week before ICPC, he broke into Doctor's PC and sneaked a look at all the problems that would be given in ICPC. He solved the problems, printed programs out, and brought into ICPC. Since electronic preparati... | 3
10 20 30
7
56 26 62 43 25 80 7
| 100
873
| 23,392 |
s502252342 | p00604 | u471400255 | 1513675689 | Python | Python3 | py | Accepted | 30 | 5612 | 265 | from sys import stdin
for num in stdin:
penalty = [0] * int(num)
time = [int(i) for i in stdin.readline().split()]
time.sort()
penalty[0] = time[0]
for j in range(1,len(time)):
penalty[j] += penalty[j-1] + time[j]
print(sum(penalty)) | p00604 |
<H1><font color="#000000">Problem J:</font> Cheating on ICPC</H1>
<p>
Peter loves any kinds of cheating. A week before ICPC, he broke into Doctor's PC and sneaked a look at all the problems that would be given in ICPC. He solved the problems, printed programs out, and brought into ICPC. Since electronic preparati... | 3
10 20 30
7
56 26 62 43 25 80 7
| 100
873
| 23,393 |
s157372640 | p00604 | u536089081 | 1517563496 | Python | Python3 | py | Accepted | 20 | 5620 | 222 | while True:
try:
num = int(input())
except:
break
times = list(map(int, input().split()))
times.sort()
ans = sum([(num-index) * time for index, time in enumerate(times)])
print(ans)
| p00604 |
<H1><font color="#000000">Problem J:</font> Cheating on ICPC</H1>
<p>
Peter loves any kinds of cheating. A week before ICPC, he broke into Doctor's PC and sneaked a look at all the problems that would be given in ICPC. He solved the problems, printed programs out, and brought into ICPC. Since electronic preparati... | 3
10 20 30
7
56 26 62 43 25 80 7
| 100
873
| 23,394 |
s686478575 | p00604 | u009288816 | 1521979372 | Python | Python3 | py | Accepted | 40 | 5728 | 386 | import sys
def sumItUp(List):
result = []
for i in range(0,len(List)):
result.append(sum(List[0:i+1]))
return sum(result)
List = []
for i in sys.stdin:
List.append(i)
for i in range(1,len(List),2):
List[i] = List[i].split()
for j in range(0,len(List[i])):
List[i][j] = int(List... | p00604 |
<H1><font color="#000000">Problem J:</font> Cheating on ICPC</H1>
<p>
Peter loves any kinds of cheating. A week before ICPC, he broke into Doctor's PC and sneaked a look at all the problems that would be given in ICPC. He solved the problems, printed programs out, and brought into ICPC. Since electronic preparati... | 3
10 20 30
7
56 26 62 43 25 80 7
| 100
873
| 23,395 |
s997411465 | p00604 | u847467233 | 1530708415 | Python | Python3 | py | Accepted | 30 | 5616 | 213 | # AOJ 1018: Cheating on ICPC
# Python3 2018.7.4 bal4u
while True:
try: n = int(input())
except: break
p = sorted(list(map(int, input().split())))
ans, k = 0, n
for x in p:
ans += x*k
k -= 1
print(ans)
| p00604 |
<H1><font color="#000000">Problem J:</font> Cheating on ICPC</H1>
<p>
Peter loves any kinds of cheating. A week before ICPC, he broke into Doctor's PC and sneaked a look at all the problems that would be given in ICPC. He solved the problems, printed programs out, and brought into ICPC. Since electronic preparati... | 3
10 20 30
7
56 26 62 43 25 80 7
| 100
873
| 23,396 |
s851894547 | p00604 | u104911888 | 1368284457 | Python | Python | py | Accepted | 20 | 4228 | 179 | while True:
try:
n=input()
except EOFError:
break
L=sorted(map(int,raw_input().split()))
for i in range(1,n):
L[i]+=L[i-1]
print sum(L) | p00604 |
<H1><font color="#000000">Problem J:</font> Cheating on ICPC</H1>
<p>
Peter loves any kinds of cheating. A week before ICPC, he broke into Doctor's PC and sneaked a look at all the problems that would be given in ICPC. He solved the problems, printed programs out, and brought into ICPC. Since electronic preparati... | 3
10 20 30
7
56 26 62 43 25 80 7
| 100
873
| 23,397 |
s951078607 | p00604 | u454358619 | 1378255103 | Python | Python | py | Accepted | 20 | 4232 | 329 | import sys
def solve():
while True:
try:
n = input()
except EOFError:
break
d = sorted(map(int,raw_input().split()))
for i in range(1,n):
d[i] += d[i-1]
print sum(d)
if __name__ == "__main__":
... | p00604 |
<H1><font color="#000000">Problem J:</font> Cheating on ICPC</H1>
<p>
Peter loves any kinds of cheating. A week before ICPC, he broke into Doctor's PC and sneaked a look at all the problems that would be given in ICPC. He solved the problems, printed programs out, and brought into ICPC. Since electronic preparati... | 3
10 20 30
7
56 26 62 43 25 80 7
| 100
873
| 23,398 |
s864118278 | p00604 | u633068244 | 1396525919 | Python | Python | py | Accepted | 20 | 4212 | 130 | while 1:
try:
n=input()
p=sorted(map(int,raw_input().split()))
print sum([sum(p[:i+1]) for i in range(n)])
except:
break | p00604 |
<H1><font color="#000000">Problem J:</font> Cheating on ICPC</H1>
<p>
Peter loves any kinds of cheating. A week before ICPC, he broke into Doctor's PC and sneaked a look at all the problems that would be given in ICPC. He solved the problems, printed programs out, and brought into ICPC. Since electronic preparati... | 3
10 20 30
7
56 26 62 43 25 80 7
| 100
873
| 23,399 |
s275866852 | p00604 | u260980560 | 1583162707 | Python | Python3 | py | Accepted | 30 | 5612 | 220 | try:
while 1:
N = int(input())
*A, = map(int, input().split())
A.sort()
ans = 0; su = 0
for a in A:
su += a; ans += su
print(ans)
except EOFError:
...
| p00604 |
<H1><font color="#000000">Problem J:</font> Cheating on ICPC</H1>
<p>
Peter loves any kinds of cheating. A week before ICPC, he broke into Doctor's PC and sneaked a look at all the problems that would be given in ICPC. He solved the problems, printed programs out, and brought into ICPC. Since electronic preparati... | 3
10 20 30
7
56 26 62 43 25 80 7
| 100
873
| 23,400 |
s176318552 | p00604 | u430736685 | 1573726381 | Python | Python3 | py | Accepted | 30 | 5844 | 335 | import fileinput
tokens = []
for line in fileinput.input():
tokens.append(list(map(int, line.strip().split())))
for i in range(len(tokens)):
if i%2==0:
continue
else:
S = 0
token_s = sorted(tokens[i])
for i,name in enumerate(token_s):
S += name*(len(token_s)-i)
... | p00604 |
<H1><font color="#000000">Problem J:</font> Cheating on ICPC</H1>
<p>
Peter loves any kinds of cheating. A week before ICPC, he broke into Doctor's PC and sneaked a look at all the problems that would be given in ICPC. He solved the problems, printed programs out, and brought into ICPC. Since electronic preparati... | 3
10 20 30
7
56 26 62 43 25 80 7
| 100
873
| 23,401 |
s126972121 | p00604 | u015993536 | 1573726133 | Python | Python3 | py | Accepted | 30 | 5620 | 228 | while True:
try:
n=int(input())
A=sorted(list(map(int,input().split())))
S=0
K=0
for i in range(n):
S+=A[i]*(n-i)
print(S)
except EOFError:
break
| p00604 |
<H1><font color="#000000">Problem J:</font> Cheating on ICPC</H1>
<p>
Peter loves any kinds of cheating. A week before ICPC, he broke into Doctor's PC and sneaked a look at all the problems that would be given in ICPC. He solved the problems, printed programs out, and brought into ICPC. Since electronic preparati... | 3
10 20 30
7
56 26 62 43 25 80 7
| 100
873
| 23,402 |
s379043183 | p00604 | u048191691 | 1573724334 | Python | Python3 | py | Accepted | 30 | 5612 | 202 |
for j in range(100):
n = int(input())
a = list(map(int,input().split()))
a.sort()
now = 0
ans = 0
for i in range(n):
now += a[i]
ans += now
print (ans)
| p00604 |
<H1><font color="#000000">Problem J:</font> Cheating on ICPC</H1>
<p>
Peter loves any kinds of cheating. A week before ICPC, he broke into Doctor's PC and sneaked a look at all the problems that would be given in ICPC. He solved the problems, printed programs out, and brought into ICPC. Since electronic preparati... | 3
10 20 30
7
56 26 62 43 25 80 7
| 100
873
| 23,403 |
s527710265 | p00604 | u123563150 | 1573724137 | Python | Python3 | py | Accepted | 30 | 5612 | 150 | while True:
try:
n=int(input())
except:
exit()
a=list(map(int,input().split()))
a.sort()
for i in range(n-1):
a[i+1]+=a[i]
print(sum(a))
| p00604 |
<H1><font color="#000000">Problem J:</font> Cheating on ICPC</H1>
<p>
Peter loves any kinds of cheating. A week before ICPC, he broke into Doctor's PC and sneaked a look at all the problems that would be given in ICPC. He solved the problems, printed programs out, and brought into ICPC. Since electronic preparati... | 3
10 20 30
7
56 26 62 43 25 80 7
| 100
873
| 23,404 |
s722402535 | p00606 | u847467233 | 1530782562 | Python | Python3 | py | Accepted | 80 | 5632 | 595 | # AOJ 1020: Cleaning Robot
# Python3 2018.7.5 bal4u
mv = ((-1,0),(0,1),(1,0),(0,-1))
while True:
n = int(input())
if n == 0: break
t1, t2, t3 = input().split()
s, t, b = ord(t1)-ord('A'), ord(t2)-ord('A'), ord(t3)-ord('A')
f = [[[0.0 for a in range(3)] for c in range(3)] for r in range(17)]
f[0][s//3][s%3] = 1
... | p00606 |
<H1><font color="#000000">Problem B:</font> Cleaning Robot</H1>
<p>
Dr. Asimov, a robotics researcher, loves to research, but hates houseworks and his house were really dirty. So, he has developed a cleaning robot.
</p>
<p>
As shown in the following figure, his house has 9 rooms, where each room is identified by an ... | 1
E A C
1
E B C
2
E A B
0
| 0.00000000
0.25000000
0.06250000
| 23,405 |
s045969688 | p00606 | u372789658 | 1480742042 | Python | Python | py | Accepted | 20 | 6400 | 1,068 | time = -1
place = ["a","b","c","d","e","f","g","h","i"]
empty_count={}
for i in place:
empty_count[i] = 0
count_d = empty_count.copy()
def reset():
global d
global count_d
d={"a":["a","a","b","d"],"b":["a","e","c","b"],"c":["b","f","c","c"],"d":["a","e","g","d"],"e":["b","d","f","h"],"f":["c","e","i","f"],"g":["d... | p00606 |
<H1><font color="#000000">Problem B:</font> Cleaning Robot</H1>
<p>
Dr. Asimov, a robotics researcher, loves to research, but hates houseworks and his house were really dirty. So, he has developed a cleaning robot.
</p>
<p>
As shown in the following figure, his house has 9 rooms, where each room is identified by an ... | 1
E A C
1
E B C
2
E A B
0
| 0.00000000
0.25000000
0.06250000
| 23,406 |
s722639866 | p00606 | u266872031 | 1482938372 | Python | Python | py | Accepted | 20 | 6340 | 771 | while(1):
n=int(raw_input())
if n==0:
break
else:
[s,t,b]=raw_input().split()
rm='ABCDEFGHI'
nxt={}
A={}
B={}
nxt["A"]='AABD'
nxt["B"]='ABEC'
nxt["C"]='CCBF'
nxt["D"]='ADEG'
nxt["E"]='BDHF'
nxt["F"]='CEFI'
... | p00606 |
<H1><font color="#000000">Problem B:</font> Cleaning Robot</H1>
<p>
Dr. Asimov, a robotics researcher, loves to research, but hates houseworks and his house were really dirty. So, he has developed a cleaning robot.
</p>
<p>
As shown in the following figure, his house has 9 rooms, where each room is identified by an ... | 1
E A C
1
E B C
2
E A B
0
| 0.00000000
0.25000000
0.06250000
| 23,407 |
s293732468 | p00606 | u303753902 | 1367170048 | Python | Python | py | Accepted | 40 | 4520 | 1,389 | #!/usr/bin/python
import os
import sys
import itertools
f = sys.stdin
d = {'A': (0,0), 'B': (0,1), 'C': (0,2),
'D': (1,0), 'E': (1,1), 'F': (1,2),
'G': (2,0), 'H': (2,1), 'I': (2,2)}
while True:
n = int(f.readline().strip())
if n==0: sys.exit()
s,t,b = f.readline().split()
dp = [dict([((j... | p00606 |
<H1><font color="#000000">Problem B:</font> Cleaning Robot</H1>
<p>
Dr. Asimov, a robotics researcher, loves to research, but hates houseworks and his house were really dirty. So, he has developed a cleaning robot.
</p>
<p>
As shown in the following figure, his house has 9 rooms, where each room is identified by an ... | 1
E A C
1
E B C
2
E A B
0
| 0.00000000
0.25000000
0.06250000
| 23,408 |
s937164065 | p00606 | u351182591 | 1381339918 | Python | Python | py | Accepted | 30 | 4336 | 903 | x = []
for y in range(9):
x += [[chr(65+y),y]]
Room = dict(x)
By = [[0,0,1,3],[0,1,2,4],[1,2,2,5],[0,3,4,6],[1,3,5,7]]
By += [[2,4,5,8],[3,6,6,7],[4,6,7,8],[5,7,8,8]]
while 1:
BatP = input()
if BatP == 0:
break
Info = raw_input().split()
Prob = [0 for x in range... | p00606 |
<H1><font color="#000000">Problem B:</font> Cleaning Robot</H1>
<p>
Dr. Asimov, a robotics researcher, loves to research, but hates houseworks and his house were really dirty. So, he has developed a cleaning robot.
</p>
<p>
As shown in the following figure, his house has 9 rooms, where each room is identified by an ... | 1
E A C
1
E B C
2
E A B
0
| 0.00000000
0.25000000
0.06250000
| 23,409 |
s548438071 | p00606 | u647766105 | 1390123326 | Python | Python | py | Accepted | 40 | 4384 | 770 | dic = {"A":(0,0), "B":(0,1), "C":(0,2),
"D":(1,0), "E":(1,1), "F":(1,2),
"G":(2,0), "H":(2,1), "I":(2,2)}
while True:
n = input()
if n == 0:
break
dp = [[[0] * 3 for _ in xrange(3)] for _ in xrange(n + 1)]
s, t, b = raw_input().split()
dp[0][dic[s][0]][dic[s][1]] = 1
for i ... | p00606 |
<H1><font color="#000000">Problem B:</font> Cleaning Robot</H1>
<p>
Dr. Asimov, a robotics researcher, loves to research, but hates houseworks and his house were really dirty. So, he has developed a cleaning robot.
</p>
<p>
As shown in the following figure, his house has 9 rooms, where each room is identified by an ... | 1
E A C
1
E B C
2
E A B
0
| 0.00000000
0.25000000
0.06250000
| 23,410 |
s593988516 | p00606 | u260980560 | 1583161325 | Python | Python3 | py | Accepted | 60 | 5624 | 893 | index = "ABCDEFGHI".index
dd = ((-1, 0), (0, -1), (1, 0), (0, 1))
while 1:
N = int(input())
if N == 0:
break
s, t, b = map(index, input().split())
S = [[0]*3 for i in range(3)]
sy, sx = divmod(s, 3)
ty, tx = divmod(t, 3)
by, bx = divmod(b, 3)
T = [[0]*3 for i in range(3)]
S[s... | p00606 |
<H1><font color="#000000">Problem B:</font> Cleaning Robot</H1>
<p>
Dr. Asimov, a robotics researcher, loves to research, but hates houseworks and his house were really dirty. So, he has developed a cleaning robot.
</p>
<p>
As shown in the following figure, his house has 9 rooms, where each room is identified by an ... | 1
E A C
1
E B C
2
E A B
0
| 0.00000000
0.25000000
0.06250000
| 23,411 |
s833734077 | p00606 | u467175809 | 1533530468 | Python | Python | py | Accepted | 30 | 5076 | 1,243 | #!/usr/bin/env python
from collections import deque
import itertools as it
import sys
import math
sys.setrecursionlimit(10000000)
while True:
n = input()
if n == 0:
break
s, t, b = raw_input().split()
s = ord(s) - ord('A')
t = ord(t) - ord('A')
b = ord(b) - ord('A')
lst = [0.0 for... | p00606 |
<H1><font color="#000000">Problem B:</font> Cleaning Robot</H1>
<p>
Dr. Asimov, a robotics researcher, loves to research, but hates houseworks and his house were really dirty. So, he has developed a cleaning robot.
</p>
<p>
As shown in the following figure, his house has 9 rooms, where each room is identified by an ... | 1
E A C
1
E B C
2
E A B
0
| 0.00000000
0.25000000
0.06250000
| 23,412 |
s228659986 | p00606 | u352394527 | 1532791280 | Python | Python3 | py | Accepted | 40 | 5620 | 611 | while True:
n = int(input())
if n == 0:
break
s, t, b = input().split()
base = ord("A")
blank = ord(b) - base
dp = [[0] * 9 for _ in range(n + 1)]
dp[0][ord(s) - base] = 1
to = {0:(0, 0, 1, 3), 1:(0, 1, 2, 4), 2:(1, 2, 2, 5), 3:(0, 3, 4, 6),
4:(1, 3, 5, 7), 5:(2, 4, 5, 8), 6:(3, 6, 6, 7)... | p00606 |
<H1><font color="#000000">Problem B:</font> Cleaning Robot</H1>
<p>
Dr. Asimov, a robotics researcher, loves to research, but hates houseworks and his house were really dirty. So, he has developed a cleaning robot.
</p>
<p>
As shown in the following figure, his house has 9 rooms, where each room is identified by an ... | 1
E A C
1
E B C
2
E A B
0
| 0.00000000
0.25000000
0.06250000
| 23,413 |
s406751982 | p00607 | u703343271 | 1578439722 | Python | Python3 | py | Accepted | 20 | 5752 | 4,610 | import sys
class Cursor:
BOL = (0,1)
def __init__(self, text):
assert isinstance(text, list)
self.text = text
for i in range(len(self.text)):
self.text[i] = list(self.text[i])
self.buffer = ""
self.line = 1
self.pos = self.BOL
def _check(self... | p00607 |
<H1><font color="#000000">Problem C:</font> Emacs-like Editor</H1>
<p>
Emacs is a text editor which is widely used by many programmers.
</p>
<p>
The advantage of Emacs is that we can move a cursor without arrow keys and the mice. For example, the cursor can be moved right, left, down, and up by pushing <span>f</span>... | hyo
ni
END_OF_TEXT
f
d
f
f
k
p
p
e
y
a
k
y
y
n
y
-
| honihoni
honi
| 23,414 |
s196419657 | p00607 | u317300579 | 1545192002 | Python | Python3 | py | Accepted | 20 | 5632 | 4,936 | class Editer:
def __init__(self, text):
# カーソルの位置
self.row = 0 #行
self.col = 0 #列
# 編集中のテキスト
self.text = [list(t) + ['\n'] for t in text]
# バッファー
self.buffer = []
def row_head(self):
return 0
def row_tail(self):
return len(self.text)... | p00607 |
<H1><font color="#000000">Problem C:</font> Emacs-like Editor</H1>
<p>
Emacs is a text editor which is widely used by many programmers.
</p>
<p>
The advantage of Emacs is that we can move a cursor without arrow keys and the mice. For example, the cursor can be moved right, left, down, and up by pushing <span>f</span>... | hyo
ni
END_OF_TEXT
f
d
f
f
k
p
p
e
y
a
k
y
y
n
y
-
| honihoni
honi
| 23,415 |
s460972668 | p00607 | u352394527 | 1543934351 | Python | Python3 | py | Accepted | 20 | 5584 | 1,306 | text = []
while True:
s = input()
if s == "END_OF_TEXT":
break
text.append(s)
x, y = 0, 0
buff = ""
while True:
c = input()
if c == "-":
break
elif c == "a":
x = 0
elif c == "e":
x = len(text[y])
elif c == "p":
if y == 0:
x = 0
else:
x = 0
y -= 1
elif c =... | p00607 |
<H1><font color="#000000">Problem C:</font> Emacs-like Editor</H1>
<p>
Emacs is a text editor which is widely used by many programmers.
</p>
<p>
The advantage of Emacs is that we can move a cursor without arrow keys and the mice. For example, the cursor can be moved right, left, down, and up by pushing <span>f</span>... | hyo
ni
END_OF_TEXT
f
d
f
f
k
p
p
e
y
a
k
y
y
n
y
-
| honihoni
honi
| 23,416 |
s625977340 | p00613 | u847467233 | 1530792054 | Python | Python3 | py | Accepted | 60 | 5756 | 154 | # AOJ 1027: A Piece of Cake
# Python3 2018.7.5 bal4u
while True:
K = int(input())
if K == 0: break
print(sum(list(map(int, input().split())))//(K-1))
| p00613 |
<H1><font color="#000000">Problem I:</font> A Piece of Cake</H1>
<p>
In the city, there are two pastry shops. One shop was very popular because its cakes are pretty tasty.
However, there was a man who is displeased at the shop. He was an owner of another shop. Although cause of his shop's unpopularity is incredi... | 2
2
3
5 4 3
0
| 2
6
| 23,419 |
s614298588 | p00613 | u043254318 | 1559150318 | Python | Python3 | py | Accepted | 80 | 5772 | 193 |
while True:
K = int(input())
if K == 0:
break
c = [int(i) for i in input().split()]
S = 0
for i in range(len(c)):
S = S + c[i]
print(int(S/(K-1)))
| p00613 |
<H1><font color="#000000">Problem I:</font> A Piece of Cake</H1>
<p>
In the city, there are two pastry shops. One shop was very popular because its cakes are pretty tasty.
However, there was a man who is displeased at the shop. He was an owner of another shop. Although cause of his shop's unpopularity is incredi... | 2
2
3
5 4 3
0
| 2
6
| 23,420 |
s347842841 | p00613 | u077582668 | 1445963978 | Python | Python | py | Accepted | 50 | 6540 | 147 |
while 1:
n = int(raw_input())
if(n==0): break;
lisx = map(int, raw_input().split())
sum2 = sum(lisx) / (n-1)
print sum2 | p00613 |
<H1><font color="#000000">Problem I:</font> A Piece of Cake</H1>
<p>
In the city, there are two pastry shops. One shop was very popular because its cakes are pretty tasty.
However, there was a man who is displeased at the shop. He was an owner of another shop. Although cause of his shop's unpopularity is incredi... | 2
2
3
5 4 3
0
| 2
6
| 23,421 |
s688486833 | p00613 | u073437081 | 1469002711 | Python | Python3 | py | Accepted | 70 | 7764 | 139 | while True:
k = int(input())
if k == 0:
break
sums = sum(int(n) for n in input().split())
print( sums // (k - 1)) | p00613 |
<H1><font color="#000000">Problem I:</font> A Piece of Cake</H1>
<p>
In the city, there are two pastry shops. One shop was very popular because its cakes are pretty tasty.
However, there was a man who is displeased at the shop. He was an owner of another shop. Although cause of his shop's unpopularity is incredi... | 2
2
3
5 4 3
0
| 2
6
| 23,422 |
s732928212 | p00613 | u078042885 | 1484140328 | Python | Python3 | py | Accepted | 60 | 7552 | 93 | while 1:
k=int(input())
if k==0:break
print(sum(map(int,input().split()))//(k-1)) | p00613 |
<H1><font color="#000000">Problem I:</font> A Piece of Cake</H1>
<p>
In the city, there are two pastry shops. One shop was very popular because its cakes are pretty tasty.
However, there was a man who is displeased at the shop. He was an owner of another shop. Although cause of his shop's unpopularity is incredi... | 2
2
3
5 4 3
0
| 2
6
| 23,423 |
s770197746 | p00613 | u078042885 | 1486255923 | Python | Python3 | py | Accepted | 50 | 7728 | 90 | while 1:
k=int(input())-1
if k<0:break
print(sum(map(int,input().split()))//k) | p00613 |
<H1><font color="#000000">Problem I:</font> A Piece of Cake</H1>
<p>
In the city, there are two pastry shops. One shop was very popular because its cakes are pretty tasty.
However, there was a man who is displeased at the shop. He was an owner of another shop. Although cause of his shop's unpopularity is incredi... | 2
2
3
5 4 3
0
| 2
6
| 23,424 |
s955218501 | p00613 | u471400255 | 1513677665 | Python | Python3 | py | Accepted | 50 | 5772 | 197 | while True:
K = int(input())
if K == 0:
break
elif K == 1:
print(int(input()))
else:
po = [int(i) for i in input().split()]
print(int(sum(po)/(K-1))) | p00613 |
<H1><font color="#000000">Problem I:</font> A Piece of Cake</H1>
<p>
In the city, there are two pastry shops. One shop was very popular because its cakes are pretty tasty.
However, there was a man who is displeased at the shop. He was an owner of another shop. Although cause of his shop's unpopularity is incredi... | 2
2
3
5 4 3
0
| 2
6
| 23,425 |
s041866910 | p00613 | u759949288 | 1363801199 | Python | Python | py | Accepted | 40 | 4312 | 94 | while True:
k = input()
if k == 0: break
print sum(map(int, raw_input().split())) / (k - 1) | p00613 |
<H1><font color="#000000">Problem I:</font> A Piece of Cake</H1>
<p>
In the city, there are two pastry shops. One shop was very popular because its cakes are pretty tasty.
However, there was a man who is displeased at the shop. He was an owner of another shop. Although cause of his shop's unpopularity is incredi... | 2
2
3
5 4 3
0
| 2
6
| 23,426 |
s767295699 | p00613 | u260980560 | 1385476569 | Python | Python | py | Accepted | 40 | 4300 | 94 | while 1:
k = input()
if k==0: break
print sum(map(int, raw_input().split()))/(k-1) | p00613 |
<H1><font color="#000000">Problem I:</font> A Piece of Cake</H1>
<p>
In the city, there are two pastry shops. One shop was very popular because its cakes are pretty tasty.
However, there was a man who is displeased at the shop. He was an owner of another shop. Although cause of his shop's unpopularity is incredi... | 2
2
3
5 4 3
0
| 2
6
| 23,427 |
s843577480 | p00613 | u621997536 | 1388319546 | Python | Python | py | Accepted | 40 | 4300 | 102 |
while True:
k = input()
if not k:
break
print sum(map(int, raw_input().split())) / (k - 1) | p00613 |
<H1><font color="#000000">Problem I:</font> A Piece of Cake</H1>
<p>
In the city, there are two pastry shops. One shop was very popular because its cakes are pretty tasty.
However, there was a man who is displeased at the shop. He was an owner of another shop. Although cause of his shop's unpopularity is incredi... | 2
2
3
5 4 3
0
| 2
6
| 23,428 |
s122526358 | p00613 | u633068244 | 1395162242 | Python | Python | py | Accepted | 30 | 4340 | 108 | while True:
k = int(raw_input())
if k == 0:
break
c = map(int, raw_input().split())
print sum(c)/(k-1) | p00613 |
<H1><font color="#000000">Problem I:</font> A Piece of Cake</H1>
<p>
In the city, there are two pastry shops. One shop was very popular because its cakes are pretty tasty.
However, there was a man who is displeased at the shop. He was an owner of another shop. Although cause of his shop's unpopularity is incredi... | 2
2
3
5 4 3
0
| 2
6
| 23,429 |
s610716676 | p00613 | u633068244 | 1395162290 | Python | Python | py | Accepted | 40 | 4300 | 99 | while True:
k = int(raw_input())
if k == 0: break
print sum(map(int, raw_input().split()))/(k-1) | p00613 |
<H1><font color="#000000">Problem I:</font> A Piece of Cake</H1>
<p>
In the city, there are two pastry shops. One shop was very popular because its cakes are pretty tasty.
However, there was a man who is displeased at the shop. He was an owner of another shop. Although cause of his shop's unpopularity is incredi... | 2
2
3
5 4 3
0
| 2
6
| 23,430 |
s631867100 | p00613 | u633068244 | 1395162340 | Python | Python | py | Accepted | 40 | 4300 | 95 | while 1:
k = int(raw_input())
if not k: break
print sum(map(int, raw_input().split()))/(k-1) | p00613 |
<H1><font color="#000000">Problem I:</font> A Piece of Cake</H1>
<p>
In the city, there are two pastry shops. One shop was very popular because its cakes are pretty tasty.
However, there was a man who is displeased at the shop. He was an owner of another shop. Although cause of his shop's unpopularity is incredi... | 2
2
3
5 4 3
0
| 2
6
| 23,431 |
s666067454 | p00613 | u633068244 | 1395162365 | Python | Python | py | Accepted | 30 | 4304 | 86 | while 1:
k = input()
if not k: break
print sum(map(int, raw_input().split()))/(k-1) | p00613 |
<H1><font color="#000000">Problem I:</font> A Piece of Cake</H1>
<p>
In the city, there are two pastry shops. One shop was very popular because its cakes are pretty tasty.
However, there was a man who is displeased at the shop. He was an owner of another shop. Although cause of his shop's unpopularity is incredi... | 2
2
3
5 4 3
0
| 2
6
| 23,432 |
s499169163 | p00613 | u633068244 | 1395162729 | Python | Python | py | Accepted | 40 | 4304 | 97 | while True:
k = input() - 1
if k < 0: break
print sum(map(int,raw_input().split()))/k | p00613 |
<H1><font color="#000000">Problem I:</font> A Piece of Cake</H1>
<p>
In the city, there are two pastry shops. One shop was very popular because its cakes are pretty tasty.
However, there was a man who is displeased at the shop. He was an owner of another shop. Although cause of his shop's unpopularity is incredi... | 2
2
3
5 4 3
0
| 2
6
| 23,433 |
s104282960 | p00613 | u633068244 | 1395162770 | Python | Python | py | Accepted | 40 | 4304 | 94 | while 1:
k = input() - 1
if k < 0: break
print sum(map(int,raw_input().split()))/k | p00613 |
<H1><font color="#000000">Problem I:</font> A Piece of Cake</H1>
<p>
In the city, there are two pastry shops. One shop was very popular because its cakes are pretty tasty.
However, there was a man who is displeased at the shop. He was an owner of another shop. Although cause of his shop's unpopularity is incredi... | 2
2
3
5 4 3
0
| 2
6
| 23,434 |
s842982278 | p00613 | u633068244 | 1395162822 | Python | Python | py | Accepted | 40 | 4304 | 96 | while 1:
k = input() - 1
if not k+1: break
print sum(map(int,raw_input().split()))/k | p00613 |
<H1><font color="#000000">Problem I:</font> A Piece of Cake</H1>
<p>
In the city, there are two pastry shops. One shop was very popular because its cakes are pretty tasty.
However, there was a man who is displeased at the shop. He was an owner of another shop. Although cause of his shop's unpopularity is incredi... | 2
2
3
5 4 3
0
| 2
6
| 23,435 |
s558885722 | p00613 | u633068244 | 1395162853 | Python | Python | py | Accepted | 30 | 4300 | 90 | while 1:
k = input() - 1
if not k+1: break
print sum(map(int,raw_input().split()))/k | p00613 |
<H1><font color="#000000">Problem I:</font> A Piece of Cake</H1>
<p>
In the city, there are two pastry shops. One shop was very popular because its cakes are pretty tasty.
However, there was a man who is displeased at the shop. He was an owner of another shop. Although cause of his shop's unpopularity is incredi... | 2
2
3
5 4 3
0
| 2
6
| 23,436 |
s247313480 | p00613 | u633068244 | 1395162855 | Python | Python | py | Accepted | 40 | 4300 | 90 | while 1:
k = input() - 1
if not k+1: break
print sum(map(int,raw_input().split()))/k | p00613 |
<H1><font color="#000000">Problem I:</font> A Piece of Cake</H1>
<p>
In the city, there are two pastry shops. One shop was very popular because its cakes are pretty tasty.
However, there was a man who is displeased at the shop. He was an owner of another shop. Although cause of his shop's unpopularity is incredi... | 2
2
3
5 4 3
0
| 2
6
| 23,437 |
s127760948 | p00613 | u633068244 | 1395162890 | Python | Python | py | Accepted | 30 | 4304 | 86 | while 1:
k=input()
if not k:break
print sum(map(int, raw_input().split()))/(k-1) | p00613 |
<H1><font color="#000000">Problem I:</font> A Piece of Cake</H1>
<p>
In the city, there are two pastry shops. One shop was very popular because its cakes are pretty tasty.
However, there was a man who is displeased at the shop. He was an owner of another shop. Although cause of his shop's unpopularity is incredi... | 2
2
3
5 4 3
0
| 2
6
| 23,438 |
s688041429 | p00613 | u633068244 | 1395163861 | Python | Python | py | Accepted | 40 | 4300 | 85 | while 1:
k=input()
if k==0:break
print sum(map(int, raw_input().split()))/(k-1) | p00613 |
<H1><font color="#000000">Problem I:</font> A Piece of Cake</H1>
<p>
In the city, there are two pastry shops. One shop was very popular because its cakes are pretty tasty.
However, there was a man who is displeased at the shop. He was an owner of another shop. Although cause of his shop's unpopularity is incredi... | 2
2
3
5 4 3
0
| 2
6
| 23,439 |
s331943933 | p00613 | u633068244 | 1395163922 | Python | Python | py | Accepted | 40 | 4300 | 84 | while 1:
k=input()-1
if k==-1:break
print sum(map(int, raw_input().split()))/k | p00613 |
<H1><font color="#000000">Problem I:</font> A Piece of Cake</H1>
<p>
In the city, there are two pastry shops. One shop was very popular because its cakes are pretty tasty.
However, there was a man who is displeased at the shop. He was an owner of another shop. Although cause of his shop's unpopularity is incredi... | 2
2
3
5 4 3
0
| 2
6
| 23,440 |
s909468147 | p00613 | u633068244 | 1395163929 | Python | Python | py | Accepted | 40 | 4296 | 84 | while 1:
k=input()-1
if k==-1:break
print sum(map(int, raw_input().split()))/k | p00613 |
<H1><font color="#000000">Problem I:</font> A Piece of Cake</H1>
<p>
In the city, there are two pastry shops. One shop was very popular because its cakes are pretty tasty.
However, there was a man who is displeased at the shop. He was an owner of another shop. Although cause of his shop's unpopularity is incredi... | 2
2
3
5 4 3
0
| 2
6
| 23,441 |
s677879883 | p00613 | u352394527 | 1532792071 | Python | Python3 | py | Accepted | 50 | 5708 | 106 | while True:
k = int(input())
if k == 0:
break
print(sum(map(int, input().split())) // (k - 1))
| p00613 |
<H1><font color="#000000">Problem I:</font> A Piece of Cake</H1>
<p>
In the city, there are two pastry shops. One shop was very popular because its cakes are pretty tasty.
However, there was a man who is displeased at the shop. He was an owner of another shop. Although cause of his shop's unpopularity is incredi... | 2
2
3
5 4 3
0
| 2
6
| 23,442 |
s834264651 | p00615 | u489809100 | 1448010958 | Python | Python | py | Accepted | 70 | 7380 | 352 | while True:
n,m = map(int,raw_input().split())
if n == 0 and m == 0 : break
traffic = [0]
if n != 0:
traffic = map(int,raw_input().split())
if m != 0:
traffic += map(int,raw_input().split())
traffic.sort()
max = traffic[0]
next = traffic[0]
for var in traffic[1:]:
if var - next > max:
max = var -... | p00615 |
<h1><font color="#000000">Problem A:</font> Traffic Analysis</h1>
<p>
There are two cameras which observe the up line and the down line respectively on the double lane (please see the following figure). These cameras are located on a line perpendicular to the lane, and we call the line 'monitoring line.' (the red lin... | 4 5
20 35 60 70
15 30 40 80 90
3 2
10 20 30
42 60
0 1
100
1 1
10
50
0 0
| 20
18
100
40
| 23,443 |
s966540163 | p00615 | u078042885 | 1484212336 | Python | Python3 | py | Accepted | 50 | 9032 | 205 | while 1:
t,(n,m)=[0],map(int,input().split())
if n==m==0:break
if n:t+=map(int,input().split())
if m:t+=map(int,input().split())
t.sort()
print(max(t[i+1]-t[i] for i in range(n+m))) | p00615 |
<h1><font color="#000000">Problem A:</font> Traffic Analysis</h1>
<p>
There are two cameras which observe the up line and the down line respectively on the double lane (please see the following figure). These cameras are located on a line perpendicular to the lane, and we call the line 'monitoring line.' (the red lin... | 4 5
20 35 60 70
15 30 40 80 90
3 2
10 20 30
42 60
0 1
100
1 1
10
50
0 0
| 20
18
100
40
| 23,444 |
s414255023 | p00615 | u104911888 | 1371907214 | Python | Python | py | Accepted | 50 | 5484 | 326 | while True:
n,m=map(int,raw_input().split())
if n==m==0:break
up=map(int,raw_input().split()) if n!=0 else []
down=map(int,raw_input().split()) if m!=0 else []
upDown=up+down
upDown.sort()
maxlen=upDown[0]
for i in range(n+m-1):
maxlen=max(maxlen,upDown[i+1]-upDown[i])
print ... | p00615 |
<h1><font color="#000000">Problem A:</font> Traffic Analysis</h1>
<p>
There are two cameras which observe the up line and the down line respectively on the double lane (please see the following figure). These cameras are located on a line perpendicular to the lane, and we call the line 'monitoring line.' (the red lin... | 4 5
20 35 60 70
15 30 40 80 90
3 2
10 20 30
42 60
0 1
100
1 1
10
50
0 0
| 20
18
100
40
| 23,445 |
s252517374 | p00615 | u260980560 | 1385478332 | Python | Python | py | Accepted | 50 | 5328 | 229 | get = lambda:map(int, raw_input().split())
while 1:
n,m = get()
if n==m==0: break
t = [0]
if n!=0: t += get()
if m!=0: t += get()
t.sort()
print max(t[i+1]-t[i] for i in xrange(n+m)) if n+m>1 else t[1] | p00615 |
<h1><font color="#000000">Problem A:</font> Traffic Analysis</h1>
<p>
There are two cameras which observe the up line and the down line respectively on the double lane (please see the following figure). These cameras are located on a line perpendicular to the lane, and we call the line 'monitoring line.' (the red lin... | 4 5
20 35 60 70
15 30 40 80 90
3 2
10 20 30
42 60
0 1
100
1 1
10
50
0 0
| 20
18
100
40
| 23,446 |
s795055746 | p00615 | u633068244 | 1399370366 | Python | Python | py | Accepted | 50 | 5336 | 246 | while 1:
n,m = map(int,raw_input().split())
if n == m == 0: break
data = [0]
if n > 0: data += map(int,raw_input().split())
if m > 0: data += map(int,raw_input().split())
data = sorted(data)
print max(data[i+1]-data[i] for i in range(n+m)) | p00615 |
<h1><font color="#000000">Problem A:</font> Traffic Analysis</h1>
<p>
There are two cameras which observe the up line and the down line respectively on the double lane (please see the following figure). These cameras are located on a line perpendicular to the lane, and we call the line 'monitoring line.' (the red lin... | 4 5
20 35 60 70
15 30 40 80 90
3 2
10 20 30
42 60
0 1
100
1 1
10
50
0 0
| 20
18
100
40
| 23,447 |
s606099543 | p00615 | u240091169 | 1590905543 | Python | Python3 | py | Accepted | 90 | 7196 | 573 |
while True :
n, m = map(int, input().split())
if n == 0 and m == 0 :
break
car_list = []
if n != 0 :
A = list(map(int, input().split()))
for i in range(n) :
car_list.append(A[i])
if m != 0 :
A = list(map(int, input().split()))
for i in range(m) :... | p00615 |
<h1><font color="#000000">Problem A:</font> Traffic Analysis</h1>
<p>
There are two cameras which observe the up line and the down line respectively on the double lane (please see the following figure). These cameras are located on a line perpendicular to the lane, and we call the line 'monitoring line.' (the red lin... | 4 5
20 35 60 70
15 30 40 80 90
3 2
10 20 30
42 60
0 1
100
1 1
10
50
0 0
| 20
18
100
40
| 23,448 |
s078107616 | p00615 | u668489394 | 1579137306 | Python | Python3 | py | Accepted | 90 | 7620 | 527 | if __name__ == '__main__':
while True:
L, R = list(map(int, input().strip().split()))
if L == 0 and R == 0:
break
arr = set([ 0 ])
if L > 0:
arr.update( list(map(int, input().strip().split(' '))) )
if R > 0:
arr.update( list(ma... | p00615 |
<h1><font color="#000000">Problem A:</font> Traffic Analysis</h1>
<p>
There are two cameras which observe the up line and the down line respectively on the double lane (please see the following figure). These cameras are located on a line perpendicular to the lane, and we call the line 'monitoring line.' (the red lin... | 4 5
20 35 60 70
15 30 40 80 90
3 2
10 20 30
42 60
0 1
100
1 1
10
50
0 0
| 20
18
100
40
| 23,449 |
s299851473 | p00615 | u352394527 | 1543938391 | Python | Python3 | py | Accepted | 90 | 7540 | 356 | while True:
n, m = map(int, input().split())
if n == 0 and m == 0:
break
if n != 0 and m != 0:
t_all = [0] + sorted(list(map(int, input().split())) + list(map(int, input().split())))
else:
t_all = [0] + sorted(map(int, input().split()))
ans = 0
for i in range(1, n + m + 1):
ans = max(ans, t_... | p00615 |
<h1><font color="#000000">Problem A:</font> Traffic Analysis</h1>
<p>
There are two cameras which observe the up line and the down line respectively on the double lane (please see the following figure). These cameras are located on a line perpendicular to the lane, and we call the line 'monitoring line.' (the red lin... | 4 5
20 35 60 70
15 30 40 80 90
3 2
10 20 30
42 60
0 1
100
1 1
10
50
0 0
| 20
18
100
40
| 23,450 |
s597408942 | p00616 | u197615397 | 1558697638 | Python | Python3 | py | Accepted | 90 | 9776 | 586 | def solve():
while True:
n, h = map(int, input().split())
if n == 0:
break
s = set()
for _ in [0]*h:
t, *a = input().split()
i, j = map(lambda x: int(x)-1, a)
k = 1
if t == "xy":
j *= n
k = n... | p00616 |
<H1><font color="#000000">Problem B:</font> Cubes Without Holes</H1>
<p>
There is a cube which consists of <i>n</i> × <i>n</i> × <i>n</i> small cubes. Small cubes have marks on their surfaces. An example where <i>n</i> = 4 is shown in the following figure.
</p>
<br>
<center>
<img src="https://judgeapi.u... | 4 3
xy 4 4
xz 1 2
yz 2 3
4 5
xy 1 1
xy 3 3
xz 3 3
yz 2 1
yz 3 3
0 0
| 52
46
| 23,451 |
s990569504 | p00617 | u197615397 | 1558697677 | Python | Python3 | py | Accepted | 60 | 6632 | 1,436 | class Panel(object):
def __init__(self, name, depth, child, x1, y1, x2, y2):
self.name = name
self.depth = depth
self.child = child
self.x1 = x1
self.y1 = y1
self.x2 = x2
self.y2 = y2
def touch(self, x, y, depth):
if depth < self.depth and self.x1... | p00617 |
<H1><font color="#000000">Problem C:</font> Simple GUI Application</H1>
<p>
Advanced Creative Mobile 社(ACM社)では、新しいポータブルコンピュータに搭載するGUIアプリケーションの開発を行うことになった。
</p>
<p>
下図に示すように、GUIは1つのメインパネルを持ち、その上にいくつかのパネルが配置され、さらにそれらのパネルの上にもいくつかのパネルが配置されるような入れ子構造になっている。パネルはすべて辺が座標軸に平行・垂直な長方形または正方形である。
</p>
<br>
<center>
<img src="... | 5
<main>10,10,190,150<menu>20,20,70,140</menu><primary>80,20,180,140</primary></main>
10 10
15 15
40 60
2 3
130 80
0
| main 2
main 2
menu 0
OUT OF MAIN PANEL 1
primary 0
| 23,452 |
s609500835 | p00617 | u352394527 | 1547347837 | Python | Python3 | py | Accepted | 30 | 5608 | 1,794 | class Panel:
def __init__(self, name, points, children):
self.name = name
self.x1 = points[0]
self.x2 = points[2]
self.y1 = points[1]
self.y2 = points[3]
self.children = children
self.child_cnt = len(children)
def search(self, x, y):
if not (self.... | p00617 |
<H1><font color="#000000">Problem C:</font> Simple GUI Application</H1>
<p>
Advanced Creative Mobile 社(ACM社)では、新しいポータブルコンピュータに搭載するGUIアプリケーションの開発を行うことになった。
</p>
<p>
下図に示すように、GUIは1つのメインパネルを持ち、その上にいくつかのパネルが配置され、さらにそれらのパネルの上にもいくつかのパネルが配置されるような入れ子構造になっている。パネルはすべて辺が座標軸に平行・垂直な長方形または正方形である。
</p>
<br>
<center>
<img src="... | 5
<main>10,10,190,150<menu>20,20,70,140</menu><primary>80,20,180,140</primary></main>
10 10
15 15
40 60
2 3
130 80
0
| main 2
main 2
menu 0
OUT OF MAIN PANEL 1
primary 0
| 23,453 |
s190577400 | p00621 | u073437081 | 1469067893 | Python | Python3 | py | Accepted | 30 | 7808 | 1,382 | class Cat:
def __init__(self, input):
self.id = int(input[1])
self.size = int(input[2])
def sleep(self, index):
self.index = index
def last(self):
return self.index + self.size
def lastindex(list, val):
result = len(list) - 1
for n in range(len(list)):
if ... | p00621 |
<H1><font color="#000000">Problem A:</font> Sleeping Cats </H1>
<p>
Jackは彼の住む家をとても気に入っていた. 彼の家の塀の上で毎日のように愛くるしいねこたちが昼寝をしているからだ. Jackはねこがとても好きだった.
</p>
<p>
Jackは, 夏休みの自由研究としてねこたちの観察日記を付けることにした. しばらく観察しているうちに, 彼はねこたちの面白い特徴に気付いた.
</p>
<p>
塀は W[尺] の幅があり, ここにねこたちは並んで昼寝をする. それぞれのねこたちは体の大きさが違うので, 昼寝に必要とする幅もまた異なる. 昼寝をしにきた... | 4 6
s 0 2
s 1 3
s 2 1
w 0
s 3 3
s 4 2
3 3
s 0 1
s 1 1
s 2 1
0 0
| 0
impossible
2
impossible
0
END
0
1
2
END
| 23,454 |
s567081054 | p00621 | u266872031 | 1474223078 | Python | Python | py | Accepted | 20 | 6332 | 647 | while(1):
[W,Q]=map(int,raw_input().split())
if W==0 and Q==0: break
se=[(0,0),(W,W)]
idq=[10000,100001]
for i in range(Q):
S=raw_input().split()
Sn=[int(x) for x in S[1:]]
if S[0]=='s':
for i in range(len(se)-1):
if se[i+1][0]-se[i][1]>=Sn[1]:
... | p00621 |
<H1><font color="#000000">Problem A:</font> Sleeping Cats </H1>
<p>
Jackは彼の住む家をとても気に入っていた. 彼の家の塀の上で毎日のように愛くるしいねこたちが昼寝をしているからだ. Jackはねこがとても好きだった.
</p>
<p>
Jackは, 夏休みの自由研究としてねこたちの観察日記を付けることにした. しばらく観察しているうちに, 彼はねこたちの面白い特徴に気付いた.
</p>
<p>
塀は W[尺] の幅があり, ここにねこたちは並んで昼寝をする. それぞれのねこたちは体の大きさが違うので, 昼寝に必要とする幅もまた異なる. 昼寝をしにきた... | 4 6
s 0 2
s 1 3
s 2 1
w 0
s 3 3
s 4 2
3 3
s 0 1
s 1 1
s 2 1
0 0
| 0
impossible
2
impossible
0
END
0
1
2
END
| 23,455 |
s654266602 | p00621 | u633068244 | 1398070153 | Python | Python | py | Accepted | 20 | 4248 | 506 | while 1:
W,Q = map(int,raw_input().split())
if W == 0: break
cat = [map(str,raw_input().split()) for i in range(Q)]
wall = [-1]*W
for i in range(Q):
if cat[i][0] == "s":
id,w = int(cat[i][1]),int(cat[i][2])
for j in range(W-w+1):
if wall[j:j+w] == [-1]*w:
wall[j:j+w] = [id]*w
print j
bre... | p00621 |
<H1><font color="#000000">Problem A:</font> Sleeping Cats </H1>
<p>
Jackは彼の住む家をとても気に入っていた. 彼の家の塀の上で毎日のように愛くるしいねこたちが昼寝をしているからだ. Jackはねこがとても好きだった.
</p>
<p>
Jackは, 夏休みの自由研究としてねこたちの観察日記を付けることにした. しばらく観察しているうちに, 彼はねこたちの面白い特徴に気付いた.
</p>
<p>
塀は W[尺] の幅があり, ここにねこたちは並んで昼寝をする. それぞれのねこたちは体の大きさが違うので, 昼寝に必要とする幅もまた異なる. 昼寝をしにきた... | 4 6
s 0 2
s 1 3
s 2 1
w 0
s 3 3
s 4 2
3 3
s 0 1
s 1 1
s 2 1
0 0
| 0
impossible
2
impossible
0
END
0
1
2
END
| 23,456 |
s475834822 | p00621 | u633068244 | 1398070633 | Python | Python | py | Accepted | 20 | 4268 | 517 | while 1:
W,Q = map(int,raw_input().split())
if W == 0: break
cat = [map(str,raw_input().split()) for i in range(Q)]
dic = {cat[i][1]:[int(cat[i][2]),0] for i in range(Q) if cat[i][0] == "s"}
wall = [-1]*W
for i in range(Q):
if cat[i][0] == "s":
id,w = cat[i][1],int(cat[i][2])
for j in range(W-w+1):
if... | p00621 |
<H1><font color="#000000">Problem A:</font> Sleeping Cats </H1>
<p>
Jackは彼の住む家をとても気に入っていた. 彼の家の塀の上で毎日のように愛くるしいねこたちが昼寝をしているからだ. Jackはねこがとても好きだった.
</p>
<p>
Jackは, 夏休みの自由研究としてねこたちの観察日記を付けることにした. しばらく観察しているうちに, 彼はねこたちの面白い特徴に気付いた.
</p>
<p>
塀は W[尺] の幅があり, ここにねこたちは並んで昼寝をする. それぞれのねこたちは体の大きさが違うので, 昼寝に必要とする幅もまた異なる. 昼寝をしにきた... | 4 6
s 0 2
s 1 3
s 2 1
w 0
s 3 3
s 4 2
3 3
s 0 1
s 1 1
s 2 1
0 0
| 0
impossible
2
impossible
0
END
0
1
2
END
| 23,457 |
s978169810 | p00621 | u633068244 | 1398070709 | Python | Python | py | Accepted | 10 | 4264 | 517 | while 1:
W,Q = map(int,raw_input().split())
if W == 0: break
cat = [map(str,raw_input().split()) for i in range(Q)]
dic = {cat[i][1]:[int(cat[i][2]),0] for i in range(Q) if cat[i][0] == "s"}
wall = [-1]*W
for i in range(Q):
if cat[i][0] == "s":
id,w = cat[i][1],int(cat[i][2])
for j in range(W-w+1):
if... | p00621 |
<H1><font color="#000000">Problem A:</font> Sleeping Cats </H1>
<p>
Jackは彼の住む家をとても気に入っていた. 彼の家の塀の上で毎日のように愛くるしいねこたちが昼寝をしているからだ. Jackはねこがとても好きだった.
</p>
<p>
Jackは, 夏休みの自由研究としてねこたちの観察日記を付けることにした. しばらく観察しているうちに, 彼はねこたちの面白い特徴に気付いた.
</p>
<p>
塀は W[尺] の幅があり, ここにねこたちは並んで昼寝をする. それぞれのねこたちは体の大きさが違うので, 昼寝に必要とする幅もまた異なる. 昼寝をしにきた... | 4 6
s 0 2
s 1 3
s 2 1
w 0
s 3 3
s 4 2
3 3
s 0 1
s 1 1
s 2 1
0 0
| 0
impossible
2
impossible
0
END
0
1
2
END
| 23,458 |
s949735546 | p00621 | u260980560 | 1583165461 | Python | Python3 | py | Accepted | 30 | 5596 | 747 | while 1:
W, Q = map(int, input().split())
if W == Q == 0:
break
A = [0]*W
for i in range(Q):
s, *qs = input().split()
if s == 's':
x, w = map(int, qs)
su = sum(A[:w-1])
k = -1
for i in range(W-w+1):
su += A[i+w-1]
... | p00621 |
<H1><font color="#000000">Problem A:</font> Sleeping Cats </H1>
<p>
Jackは彼の住む家をとても気に入っていた. 彼の家の塀の上で毎日のように愛くるしいねこたちが昼寝をしているからだ. Jackはねこがとても好きだった.
</p>
<p>
Jackは, 夏休みの自由研究としてねこたちの観察日記を付けることにした. しばらく観察しているうちに, 彼はねこたちの面白い特徴に気付いた.
</p>
<p>
塀は W[尺] の幅があり, ここにねこたちは並んで昼寝をする. それぞれのねこたちは体の大きさが違うので, 昼寝に必要とする幅もまた異なる. 昼寝をしにきた... | 4 6
s 0 2
s 1 3
s 2 1
w 0
s 3 3
s 4 2
3 3
s 0 1
s 1 1
s 2 1
0 0
| 0
impossible
2
impossible
0
END
0
1
2
END
| 23,459 |
s320242436 | p00621 | u352394527 | 1543949591 | Python | Python3 | py | Accepted | 30 | 5600 | 564 | while True:
w, q = map(int, input().split())
if w == 0 and q == 0:
break
wall = [None] * w
for _ in range(q):
inp = input().split()
if inp[0] == "s":
ind, wid = int(inp[1]), int(inp[2])
for i in range(w - wid + 1):
if all(x == None for x in wall[i:i + wid]):
print(i)
... | p00621 |
<H1><font color="#000000">Problem A:</font> Sleeping Cats </H1>
<p>
Jackは彼の住む家をとても気に入っていた. 彼の家の塀の上で毎日のように愛くるしいねこたちが昼寝をしているからだ. Jackはねこがとても好きだった.
</p>
<p>
Jackは, 夏休みの自由研究としてねこたちの観察日記を付けることにした. しばらく観察しているうちに, 彼はねこたちの面白い特徴に気付いた.
</p>
<p>
塀は W[尺] の幅があり, ここにねこたちは並んで昼寝をする. それぞれのねこたちは体の大きさが違うので, 昼寝に必要とする幅もまた異なる. 昼寝をしにきた... | 4 6
s 0 2
s 1 3
s 2 1
w 0
s 3 3
s 4 2
3 3
s 0 1
s 1 1
s 2 1
0 0
| 0
impossible
2
impossible
0
END
0
1
2
END
| 23,460 |
s456192595 | p00622 | u847467233 | 1530847187 | Python | Python3 | py | Accepted | 30 | 5560 | 393 | # AOJ 1036: Monster Factory
# Python3 2018.7.6 bal4u
while True:
in1 = list(input())
if in1[0] == '-': break
in2 = list(input())
out = list(input())
k = in2.pop(0)
ans, f = '', True
while len(in1) or len(in2):
if len(out) and out[0] == k:
k = in1.pop(0)
del out[0]
else:
ans += k
if len(in2): k =... | p00622 |
<H1><font color="#000000">Problem B:</font> Monster Factory</H1>
<p>
株式会社南天堂は, Packet Monster というゲームソフトを発売している. このゲームはモンスターを捕まえ, 育て, 戦わせるという趣旨のもので, 世界中で大人気のゲームであった.
</p>
<p>
このゲームには従来のゲームには無い特徴があった. このゲームには Red と Green という2つのバージョンがあり, それぞれのゲームで捕まえられるモンスターが異なるのだ. Red でしか捕まえられないモンスターを Green で入手するには, 通信交換というシステムを使う. ... | CBA
cba
cCa
X
ZY
Z
-
| BbA
XY
| 23,461 |
s293649550 | p00622 | u266872031 | 1482948835 | Python | Python | py | Accepted | 10 | 6244 | 426 | while(1):
up=raw_input()
if up=='-': break
left=raw_input()
down=raw_input()
cen=left[0]
idu=0
idd=0
idl=0
ans=''
for i in range(len(up)+len(left)-1):
if down[idd]==cen: #moved down
cen=up[idu]
idu+=1
idd=min(idd+1,len(down)-1)
... | p00622 |
<H1><font color="#000000">Problem B:</font> Monster Factory</H1>
<p>
株式会社南天堂は, Packet Monster というゲームソフトを発売している. このゲームはモンスターを捕まえ, 育て, 戦わせるという趣旨のもので, 世界中で大人気のゲームであった.
</p>
<p>
このゲームには従来のゲームには無い特徴があった. このゲームには Red と Green という2つのバージョンがあり, それぞれのゲームで捕まえられるモンスターが異なるのだ. Red でしか捕まえられないモンスターを Green で入手するには, 通信交換というシステムを使う. ... | CBA
cba
cCa
X
ZY
Z
-
| BbA
XY
| 23,462 |
s238148404 | p00622 | u352394527 | 1543951790 | Python | Python3 | py | Accepted | 20 | 5560 | 411 | while True:
s1 = list(input())
if s1 == ["-"]:
break
s2 = list(input())
s1.reverse()
s2.reverse()
under = list(input())
under.reverse()
right = []
center = s2.pop()
while s1 or s2:
if under and center == under[-1]:
center = s1.pop()
under.pop()
else:
right.append(center... | p00622 |
<H1><font color="#000000">Problem B:</font> Monster Factory</H1>
<p>
株式会社南天堂は, Packet Monster というゲームソフトを発売している. このゲームはモンスターを捕まえ, 育て, 戦わせるという趣旨のもので, 世界中で大人気のゲームであった.
</p>
<p>
このゲームには従来のゲームには無い特徴があった. このゲームには Red と Green という2つのバージョンがあり, それぞれのゲームで捕まえられるモンスターが異なるのだ. Red でしか捕まえられないモンスターを Green で入手するには, 通信交換というシステムを使う. ... | CBA
cba
cCa
X
ZY
Z
-
| BbA
XY
| 23,463 |
s368079100 | p00623 | u847467233 | 1530852144 | Python | Python3 | py | Accepted | 50 | 5616 | 675 | # AOJ 1037 Midnight Teatime
# Python3 2018.7.6 bal4u
def calc():
global sz
n = sz
sz += 1
if tree[0] == '(':
del tree[0]
left = calc()
del tree[0]
right = calc()
del tree[0]
for i in range(16):
for j in range(16):
k = left[i] * right[j]
if k:
buf[n][i & j] += k
buf[n][i | j] += k
... | p00623 |
<H1><font color="#000000">Problem C:</font> Midnight Teatime</H1>
<p>
ICPCの国内予選に備えて問題を解いていた僕は, その日3つ目のAcceptを貰ったところでキーボードを叩く手を止めた. 時計を見れば, もう日付が変わろうかという時刻だ. 紅茶とお菓子で一服して, 今日はもう寝ることにしよう. そう思って僕はキッチンへと向かった.
</p>
<p>
ダージリンのかぐわしい香りがキッチンを満たした頃, 妹がやってきた. 受験生である彼女は今日もこんな時間まで真面目に勉強していたようだ. 僕は彼女を誘って, 小さな深夜のお茶会を開くことにした.
</p>... | (1 2)
2
0 1 0 1
1 0 1 0
((1 2) 3)
3
1 1 0 0
1 0 1 0
0 0 0 1
END
| 2
2
| 23,464 |
s082460445 | p00623 | u266872031 | 1474241863 | Python | Python | py | Accepted | 30 | 6752 | 2,085 | class Node:
def __init__(self):
self.left=[0]
self.right=[0]
def createleft(self,inp,A):
cnt=0
for cn in range(len(inp)):
c=inp[cn]
if c=='(':
cnt+=1
elif c==')':
cnt-=1
elif cnt==0:
s... | p00623 |
<H1><font color="#000000">Problem C:</font> Midnight Teatime</H1>
<p>
ICPCの国内予選に備えて問題を解いていた僕は, その日3つ目のAcceptを貰ったところでキーボードを叩く手を止めた. 時計を見れば, もう日付が変わろうかという時刻だ. 紅茶とお菓子で一服して, 今日はもう寝ることにしよう. そう思って僕はキッチンへと向かった.
</p>
<p>
ダージリンのかぐわしい香りがキッチンを満たした頃, 妹がやってきた. 受験生である彼女は今日もこんな時間まで真面目に勉強していたようだ. 僕は彼女を誘って, 小さな深夜のお茶会を開くことにした.
</p>... | (1 2)
2
0 1 0 1
1 0 1 0
((1 2) 3)
3
1 1 0 0
1 0 1 0
0 0 0 1
END
| 2
2
| 23,465 |
s272228892 | p00627 | u847467233 | 1530852532 | Python | Python3 | py | Accepted | 20 | 5600 | 168 | # AOJ 1041: Kyudo: A Japanese Art of Archery
# Python3 2018.7.6 bal4u
while True:
n = int(input())
if n == 0: break
print(sum([int(input()) for i in range(n>>2)]))
| p00627 |
<H1><font color="#000000">Problem 01:</font> Kyudo: A Japanese Art of Archery</H1>
<p>
伊藤くんは高校入学後弓道部に入部しました。はじめは的に矢が届かず大苦戦していましたが、高校1年の秋になんとか的まで矢が届くくらいまで上達しました。
</p>
<p>
そんなある日先輩加藤くんから「弓道の近的競技に出場してみないか?」と提案が、、。
伊藤くんは初めての大会にチャレンジする気満々です。
</p>
<p>
近的競技とは、1回に4本行射(矢を射つ)し、そのうち的に当たった数(的中数)を記録します。これを複数回繰り返し、的中数の合計を競います。
... | 20
4
3
2
1
3
8
2
0
0
| 13
2
| 23,466 |
s010344858 | p00627 | u820831349 | 1540821657 | Python | Python3 | py | Accepted | 20 | 5588 | 174 | while True:
n = int(input())
if n == 0:
break
on_mark = 0
for i in range(int(n/4)):
on_mark += int(input())
print(on_mark)
| p00627 |
<H1><font color="#000000">Problem 01:</font> Kyudo: A Japanese Art of Archery</H1>
<p>
伊藤くんは高校入学後弓道部に入部しました。はじめは的に矢が届かず大苦戦していましたが、高校1年の秋になんとか的まで矢が届くくらいまで上達しました。
</p>
<p>
そんなある日先輩加藤くんから「弓道の近的競技に出場してみないか?」と提案が、、。
伊藤くんは初めての大会にチャレンジする気満々です。
</p>
<p>
近的競技とは、1回に4本行射(矢を射つ)し、そのうち的に当たった数(的中数)を記録します。これを複数回繰り返し、的中数の合計を競います。
... | 20
4
3
2
1
3
8
2
0
0
| 13
2
| 23,467 |
s388904001 | p00627 | u809233245 | 1546240883 | Python | Python3 | py | Accepted | 20 | 5596 | 221 | sum_list = []
while True:
n = int(input())
if n == 0:
break
n //= 4
sum = 0
for _ in range(n):
sum += int(input())
sum_list.append(sum)
for sum_e in sum_list:
print(sum_e)
| p00627 |
<H1><font color="#000000">Problem 01:</font> Kyudo: A Japanese Art of Archery</H1>
<p>
伊藤くんは高校入学後弓道部に入部しました。はじめは的に矢が届かず大苦戦していましたが、高校1年の秋になんとか的まで矢が届くくらいまで上達しました。
</p>
<p>
そんなある日先輩加藤くんから「弓道の近的競技に出場してみないか?」と提案が、、。
伊藤くんは初めての大会にチャレンジする気満々です。
</p>
<p>
近的競技とは、1回に4本行射(矢を射つ)し、そのうち的に当たった数(的中数)を記録します。これを複数回繰り返し、的中数の合計を競います。
... | 20
4
3
2
1
3
8
2
0
0
| 13
2
| 23,468 |
s226059943 | p00627 | u858885710 | 1406488361 | Python | Python | py | Accepted | 20 | 4188 | 111 | while True:
n = int(raw_input())
if n == 0: break
print sum([int(raw_input()) for _ in range(n/4)]) | p00627 |
<H1><font color="#000000">Problem 01:</font> Kyudo: A Japanese Art of Archery</H1>
<p>
伊藤くんは高校入学後弓道部に入部しました。はじめは的に矢が届かず大苦戦していましたが、高校1年の秋になんとか的まで矢が届くくらいまで上達しました。
</p>
<p>
そんなある日先輩加藤くんから「弓道の近的競技に出場してみないか?」と提案が、、。
伊藤くんは初めての大会にチャレンジする気満々です。
</p>
<p>
近的競技とは、1回に4本行射(矢を射つ)し、そのうち的に当たった数(的中数)を記録します。これを複数回繰り返し、的中数の合計を競います。
... | 20
4
3
2
1
3
8
2
0
0
| 13
2
| 23,469 |
s711944508 | p00627 | u881100444 | 1430196658 | Python | Python | py | Accepted | 20 | 4188 | 149 | while True:
a = input()
if a == 0:
break
sum = 0
for i in range(a/4):
b = input()
sum += b
print sum | p00627 |
<H1><font color="#000000">Problem 01:</font> Kyudo: A Japanese Art of Archery</H1>
<p>
伊藤くんは高校入学後弓道部に入部しました。はじめは的に矢が届かず大苦戦していましたが、高校1年の秋になんとか的まで矢が届くくらいまで上達しました。
</p>
<p>
そんなある日先輩加藤くんから「弓道の近的競技に出場してみないか?」と提案が、、。
伊藤くんは初めての大会にチャレンジする気満々です。
</p>
<p>
近的競技とは、1回に4本行射(矢を射つ)し、そのうち的に当たった数(的中数)を記録します。これを複数回繰り返し、的中数の合計を競います。
... | 20
4
3
2
1
3
8
2
0
0
| 13
2
| 23,470 |
s343369434 | p00627 | u778333573 | 1440453226 | Python | Python | py | Accepted | 10 | 6348 | 91 | while True:
n = input()
if n == 0: break
print sum(input() for i in range(n/4)) | p00627 |
<H1><font color="#000000">Problem 01:</font> Kyudo: A Japanese Art of Archery</H1>
<p>
伊藤くんは高校入学後弓道部に入部しました。はじめは的に矢が届かず大苦戦していましたが、高校1年の秋になんとか的まで矢が届くくらいまで上達しました。
</p>
<p>
そんなある日先輩加藤くんから「弓道の近的競技に出場してみないか?」と提案が、、。
伊藤くんは初めての大会にチャレンジする気満々です。
</p>
<p>
近的競技とは、1回に4本行射(矢を射つ)し、そのうち的に当たった数(的中数)を記録します。これを複数回繰り返し、的中数の合計を競います。
... | 20
4
3
2
1
3
8
2
0
0
| 13
2
| 23,471 |
s611425914 | p00627 | u078042885 | 1483835225 | Python | Python3 | py | Accepted | 20 | 7668 | 104 | while 1:
s,n=0,int(input())
if n==0:break
for _ in range(n//4):s+=int(input())
print(s) | p00627 |
<H1><font color="#000000">Problem 01:</font> Kyudo: A Japanese Art of Archery</H1>
<p>
伊藤くんは高校入学後弓道部に入部しました。はじめは的に矢が届かず大苦戦していましたが、高校1年の秋になんとか的まで矢が届くくらいまで上達しました。
</p>
<p>
そんなある日先輩加藤くんから「弓道の近的競技に出場してみないか?」と提案が、、。
伊藤くんは初めての大会にチャレンジする気満々です。
</p>
<p>
近的競技とは、1回に4本行射(矢を射つ)し、そのうち的に当たった数(的中数)を記録します。これを複数回繰り返し、的中数の合計を競います。
... | 20
4
3
2
1
3
8
2
0
0
| 13
2
| 23,472 |
s801866075 | p00627 | u078042885 | 1483835379 | Python | Python3 | py | Accepted | 30 | 7720 | 102 | while 1:
s,n=0,int(input())
if n==0:break
print(sum([int(input()) for _ in range(n//4)])) | p00627 |
<H1><font color="#000000">Problem 01:</font> Kyudo: A Japanese Art of Archery</H1>
<p>
伊藤くんは高校入学後弓道部に入部しました。はじめは的に矢が届かず大苦戦していましたが、高校1年の秋になんとか的まで矢が届くくらいまで上達しました。
</p>
<p>
そんなある日先輩加藤くんから「弓道の近的競技に出場してみないか?」と提案が、、。
伊藤くんは初めての大会にチャレンジする気満々です。
</p>
<p>
近的競技とは、1回に4本行射(矢を射つ)し、そのうち的に当たった数(的中数)を記録します。これを複数回繰り返し、的中数の合計を競います。
... | 20
4
3
2
1
3
8
2
0
0
| 13
2
| 23,473 |
s795211882 | p00627 | u546285759 | 1489471544 | Python | Python3 | py | Accepted | 30 | 7652 | 105 | while True:
n = int(input())
if n == 0: break
print(sum([int(input()) for _ in range(n//4)])) | p00627 |
<H1><font color="#000000">Problem 01:</font> Kyudo: A Japanese Art of Archery</H1>
<p>
伊藤くんは高校入学後弓道部に入部しました。はじめは的に矢が届かず大苦戦していましたが、高校1年の秋になんとか的まで矢が届くくらいまで上達しました。
</p>
<p>
そんなある日先輩加藤くんから「弓道の近的競技に出場してみないか?」と提案が、、。
伊藤くんは初めての大会にチャレンジする気満々です。
</p>
<p>
近的競技とは、1回に4本行射(矢を射つ)し、そのうち的に当たった数(的中数)を記録します。これを複数回繰り返し、的中数の合計を競います。
... | 20
4
3
2
1
3
8
2
0
0
| 13
2
| 23,474 |
s308623769 | p00627 | u662126750 | 1497369407 | Python | Python3 | py | Accepted | 20 | 7628 | 132 | while True:
n = int(input())
if n==0: break
ans = 0
for i in range(n//4):
ans += int(input())
print(ans) | p00627 |
<H1><font color="#000000">Problem 01:</font> Kyudo: A Japanese Art of Archery</H1>
<p>
伊藤くんは高校入学後弓道部に入部しました。はじめは的に矢が届かず大苦戦していましたが、高校1年の秋になんとか的まで矢が届くくらいまで上達しました。
</p>
<p>
そんなある日先輩加藤くんから「弓道の近的競技に出場してみないか?」と提案が、、。
伊藤くんは初めての大会にチャレンジする気満々です。
</p>
<p>
近的競技とは、1回に4本行射(矢を射つ)し、そのうち的に当たった数(的中数)を記録します。これを複数回繰り返し、的中数の合計を競います。
... | 20
4
3
2
1
3
8
2
0
0
| 13
2
| 23,475 |
s603465471 | p00627 | u957028788 | 1502004515 | Python | Python3 | py | Accepted | 20 | 7652 | 146 | while True:
times = int(input())
if times == 0:
break
time = int(times/4)
ans = 0
for i in range(0,time):
ans += int(input())
print(ans) | p00627 |
<H1><font color="#000000">Problem 01:</font> Kyudo: A Japanese Art of Archery</H1>
<p>
伊藤くんは高校入学後弓道部に入部しました。はじめは的に矢が届かず大苦戦していましたが、高校1年の秋になんとか的まで矢が届くくらいまで上達しました。
</p>
<p>
そんなある日先輩加藤くんから「弓道の近的競技に出場してみないか?」と提案が、、。
伊藤くんは初めての大会にチャレンジする気満々です。
</p>
<p>
近的競技とは、1回に4本行射(矢を射つ)し、そのうち的に当たった数(的中数)を記録します。これを複数回繰り返し、的中数の合計を競います。
... | 20
4
3
2
1
3
8
2
0
0
| 13
2
| 23,476 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.