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
s627756226
p01143
u633333374
1488034125
Python
Python
py
Accepted
70
6328
299
while 1: N,M,P = map(int,raw_input().split()) if N == 0 and M == 0 and P == 0: break total = 0 for i in range(N): x = int(input()) total += x*100 if i+1 == M: y = x if y == 0: print 0 else: print total*(100-P)/100/y
p01143
<!-- begin en only --> <h3><U> Princess' Gamble </U></h3> <!-- end en only --> <!-- begin ja only --> <h3><U> お姫様のギャンブル </U></h3> <!-- end ja only --> <!-- begin en only --> <p> English text is not available in this practice contest. </p> <!-- end en only --> <!-- begin ja only --> <p> ある貧乏な国のおてんばで勇敢なお姫様は,ある日部屋の壁を壊...
3 2 50 1 2 3 4 4 75 1 2 3 0 3 1 10 8 1 1 0 0 0
150 0 112
25,844
s313784264
p01143
u741801763
1506177146
Python
Python3
py
Accepted
40
7560
324
if __name__ == '__main__': while 1: n,m,p = list(map(int,input().strip().split())) if n ==0 and m ==0 and p ==0:break player = [] for _ in range(n):player.append(int(input())) bet = sum(player) *(100 - p) if player[m-1] == 0:print(0) else: ans = bet/player[m-1] print(int(a...
p01143
<!-- begin en only --> <h3><U> Princess' Gamble </U></h3> <!-- end en only --> <!-- begin ja only --> <h3><U> お姫様のギャンブル </U></h3> <!-- end ja only --> <!-- begin en only --> <p> English text is not available in this practice contest. </p> <!-- end en only --> <!-- begin ja only --> <p> ある貧乏な国のおてんばで勇敢なお姫様は,ある日部屋の壁を壊...
3 2 50 1 2 3 4 4 75 1 2 3 0 3 1 10 8 1 1 0 0 0
150 0 112
25,845
s968418672
p01143
u797673668
1510311949
Python
Python3
py
Accepted
40
7784
250
while True: n, m, p = map(int, input().split()) if n == 0: break players = [int(input()) for _ in range(n)] gold_div = sum(players) * (100 - p) winner = players[m - 1] print(int(gold_div / winner) if winner > 0 else 0)
p01143
<!-- begin en only --> <h3><U> Princess' Gamble </U></h3> <!-- end en only --> <!-- begin ja only --> <h3><U> お姫様のギャンブル </U></h3> <!-- end ja only --> <!-- begin en only --> <p> English text is not available in this practice contest. </p> <!-- end en only --> <!-- begin ja only --> <p> ある貧乏な国のおてんばで勇敢なお姫様は,ある日部屋の壁を壊...
3 2 50 1 2 3 4 4 75 1 2 3 0 3 1 10 8 1 1 0 0 0
150 0 112
25,846
s959773161
p01143
u048595360
1512751794
Python
Python3
py
Accepted
50
5616
249
while True: n,m,p = map(int, input().split()) if n==0: break players =[int(input()) for _ in range(n)] winTickets = players[m-1] retGld = sum(players) * (100-p) print(int(retGld / winTickets) if winTickets > 0 else 0)
p01143
<!-- begin en only --> <h3><U> Princess' Gamble </U></h3> <!-- end en only --> <!-- begin ja only --> <h3><U> お姫様のギャンブル </U></h3> <!-- end ja only --> <!-- begin en only --> <p> English text is not available in this practice contest. </p> <!-- end en only --> <!-- begin ja only --> <p> ある貧乏な国のおてんばで勇敢なお姫様は,ある日部屋の壁を壊...
3 2 50 1 2 3 4 4 75 1 2 3 0 3 1 10 8 1 1 0 0 0
150 0 112
25,847
s141502485
p01143
u506554532
1512960388
Python
Python3
py
Accepted
40
5616
207
while True: N,M,P = map(int,input().split()) if N == 0: break src = [int(input()) for i in range(N)] if src[M-1] == 0: print(0) else: print((100-P) * sum(src) // src[M-1])
p01143
<!-- begin en only --> <h3><U> Princess' Gamble </U></h3> <!-- end en only --> <!-- begin ja only --> <h3><U> お姫様のギャンブル </U></h3> <!-- end ja only --> <!-- begin en only --> <p> English text is not available in this practice contest. </p> <!-- end en only --> <!-- begin ja only --> <p> ある貧乏な国のおてんばで勇敢なお姫様は,ある日部屋の壁を壊...
3 2 50 1 2 3 4 4 75 1 2 3 0 3 1 10 8 1 1 0 0 0
150 0 112
25,848
s638531400
p01143
u672443148
1517330306
Python
Python3
py
Accepted
40
5680
351
import math while True: N,M,P=map(int,input().split()) if N==M==P: break divSum=0 for i in range(N): temp=int(input()) divSum+=temp*100 if i==M-1: numWin=temp divSum=int(divSum*(100-P)/100) if numWin!=0: dividents=math.floor(divSum/numWin) else: di...
p01143
<!-- begin en only --> <h3><U> Princess' Gamble </U></h3> <!-- end en only --> <!-- begin ja only --> <h3><U> お姫様のギャンブル </U></h3> <!-- end ja only --> <!-- begin en only --> <p> English text is not available in this practice contest. </p> <!-- end en only --> <!-- begin ja only --> <p> ある貧乏な国のおてんばで勇敢なお姫様は,ある日部屋の壁を壊...
3 2 50 1 2 3 4 4 75 1 2 3 0 3 1 10 8 1 1 0 0 0
150 0 112
25,849
s344297271
p01143
u146816547
1524579641
Python
Python
py
Accepted
10
4636
215
while True: N, M, P = map(int, raw_input().split()) if N == 0 and M == 0 and P == 0: break X = [int(raw_input()) for _ in range(N)] print 0 if X[M-1] == 0 else sum(X) * (100-P) / X[M-1]
p01143
<!-- begin en only --> <h3><U> Princess' Gamble </U></h3> <!-- end en only --> <!-- begin ja only --> <h3><U> お姫様のギャンブル </U></h3> <!-- end ja only --> <!-- begin en only --> <p> English text is not available in this practice contest. </p> <!-- end en only --> <!-- begin ja only --> <p> ある貧乏な国のおてんばで勇敢なお姫様は,ある日部屋の壁を壊...
3 2 50 1 2 3 4 4 75 1 2 3 0 3 1 10 8 1 1 0 0 0
150 0 112
25,850
s476003656
p01143
u888729801
1526290598
Python
Python3
py
Accepted
40
5680
274
import math while True: n,m,p = map(int, input().split(" ")) if n+m+p == 0: break total = 0 winner = 0 for i in range(1, n+1): x = int(input()) total += x if i == m: winner = x print(math.floor(100 * total * (100 - p) / 100 / winner) if winner > 0 else 0)
p01143
<!-- begin en only --> <h3><U> Princess' Gamble </U></h3> <!-- end en only --> <!-- begin ja only --> <h3><U> お姫様のギャンブル </U></h3> <!-- end ja only --> <!-- begin en only --> <p> English text is not available in this practice contest. </p> <!-- end en only --> <!-- begin ja only --> <p> ある貧乏な国のおてんばで勇敢なお姫様は,ある日部屋の壁を壊...
3 2 50 1 2 3 4 4 75 1 2 3 0 3 1 10 8 1 1 0 0 0
150 0 112
25,851
s482275906
p01143
u023471147
1526604711
Python
Python3
py
Accepted
50
5620
258
while True: n, m, p = map(int, input().split()) if n == 0 and m == 0 and p == 0: break x = [int(input()) for i in range(n)] total = sum(x) * (100 - p) if x[m - 1] == 0: print(0) else: print(total // x[m - 1])
p01143
<!-- begin en only --> <h3><U> Princess' Gamble </U></h3> <!-- end en only --> <!-- begin ja only --> <h3><U> お姫様のギャンブル </U></h3> <!-- end ja only --> <!-- begin en only --> <p> English text is not available in this practice contest. </p> <!-- end en only --> <!-- begin ja only --> <p> ある貧乏な国のおてんばで勇敢なお姫様は,ある日部屋の壁を壊...
3 2 50 1 2 3 4 4 75 1 2 3 0 3 1 10 8 1 1 0 0 0
150 0 112
25,852
s406092885
p01143
u509278866
1527825195
Python
Python3
py
Accepted
70
9056
902
import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,random,time,copy,functools sys.setrecursionlimit(10**7) inf = 10**3 eps = 1.0 / 10**10 mod = 10**9+7 def LI(): return [int(x) for x in sys.stdin.readline().split()] def LI_(): return [int(x)-1 for x in sys.stdin.readline().split()] def LF():...
p01143
<!-- begin en only --> <h3><U> Princess' Gamble </U></h3> <!-- end en only --> <!-- begin ja only --> <h3><U> お姫様のギャンブル </U></h3> <!-- end ja only --> <!-- begin en only --> <p> English text is not available in this practice contest. </p> <!-- end en only --> <!-- begin ja only --> <p> ある貧乏な国のおてんばで勇敢なお姫様は,ある日部屋の壁を壊...
3 2 50 1 2 3 4 4 75 1 2 3 0 3 1 10 8 1 1 0 0 0
150 0 112
25,853
s486827453
p01143
u136916346
1529994939
Python
Python3
py
Accepted
40
5624
191
while 1: N,M,P=map(int,input().split()) if not N and not M and not P:break X=[int(input()) for _ in range(N)] if not X[M-1]:r=0 else:r=int(sum(X)*100*(100-P)/100/X[M-1]) print(r)
p01143
<!-- begin en only --> <h3><U> Princess' Gamble </U></h3> <!-- end en only --> <!-- begin ja only --> <h3><U> お姫様のギャンブル </U></h3> <!-- end ja only --> <!-- begin en only --> <p> English text is not available in this practice contest. </p> <!-- end en only --> <!-- begin ja only --> <p> ある貧乏な国のおてんばで勇敢なお姫様は,ある日部屋の壁を壊...
3 2 50 1 2 3 4 4 75 1 2 3 0 3 1 10 8 1 1 0 0 0
150 0 112
25,854
s869370536
p01143
u853052478
1530186699
Python
Python3
py
Accepted
40
5628
411
result_all = [] counter = 0 while True: N,M,P = map(int, input().split()) if(N == 0 and M == 0 and P == 0): break X = [int(input()) for i in range(N)] X_sum = sum(X) if(X[M-1] == 0): result_all.append(0) continue result = ((X_sum * 100) - ((X_sum * 100) * (P / 100))) / X[M-1] ...
p01143
<!-- begin en only --> <h3><U> Princess' Gamble </U></h3> <!-- end en only --> <!-- begin ja only --> <h3><U> お姫様のギャンブル </U></h3> <!-- end ja only --> <!-- begin en only --> <p> English text is not available in this practice contest. </p> <!-- end en only --> <!-- begin ja only --> <p> ある貧乏な国のおてんばで勇敢なお姫様は,ある日部屋の壁を壊...
3 2 50 1 2 3 4 4 75 1 2 3 0 3 1 10 8 1 1 0 0 0
150 0 112
25,855
s433121097
p01143
u853052478
1530186911
Python
Python3
py
Accepted
40
5620
412
result_all = [] counter = 0 while True: N,M,P = map(int, input().split()) if(N == 0 and M == 0 and P == 0): break X = [int(input()) for i in range(N)] X_sum = sum(X) if(X[M-1] == 0): result_all.append(0) continue result = ((X_sum * 100) - ((X_sum * 100) * (P / 100))) / X[M-1] ...
p01143
<!-- begin en only --> <h3><U> Princess' Gamble </U></h3> <!-- end en only --> <!-- begin ja only --> <h3><U> お姫様のギャンブル </U></h3> <!-- end ja only --> <!-- begin en only --> <p> English text is not available in this practice contest. </p> <!-- end en only --> <!-- begin ja only --> <p> ある貧乏な国のおてんばで勇敢なお姫様は,ある日部屋の壁を壊...
3 2 50 1 2 3 4 4 75 1 2 3 0 3 1 10 8 1 1 0 0 0
150 0 112
25,856
s021849594
p01143
u258535552
1530277120
Python
Python3
py
Accepted
40
5612
419
ansli=[] while 1: a=input().split() if a[0]=="0" and a[1]=="0" and a[2]=="0": break for i in range(len(a)): a[i]=int(a[i]) x=[] for i in range(a[0]): x.append(int(input())) sum0=0 for i in x: sum0+=i sum=sum0*(100-a[2]) hit=x[a[1]-1] if hit==0: ...
p01143
<!-- begin en only --> <h3><U> Princess' Gamble </U></h3> <!-- end en only --> <!-- begin ja only --> <h3><U> お姫様のギャンブル </U></h3> <!-- end ja only --> <!-- begin en only --> <p> English text is not available in this practice contest. </p> <!-- end en only --> <!-- begin ja only --> <p> ある貧乏な国のおてんばで勇敢なお姫様は,ある日部屋の壁を壊...
3 2 50 1 2 3 4 4 75 1 2 3 0 3 1 10 8 1 1 0 0 0
150 0 112
25,857
s354114430
p01143
u918572590
1352572060
Python
Python
py
Accepted
20
4240
353
def main(): while True: N,M,P=map(int, raw_input().split(" ")) if N|M|P == 0: break solve(N,M,P) def solve(N,M,P): x=[] s=0 N2=N while N2>0: x.append( int( raw_input() ) ) s+=x[-1]*100 N2-=1 s-=(s/100)*P M-=1 print s/x[M] if x[M]>0 else 0...
p01143
<!-- begin en only --> <h3><U> Princess' Gamble </U></h3> <!-- end en only --> <!-- begin ja only --> <h3><U> お姫様のギャンブル </U></h3> <!-- end ja only --> <!-- begin en only --> <p> English text is not available in this practice contest. </p> <!-- end en only --> <!-- begin ja only --> <p> ある貧乏な国のおてんばで勇敢なお姫様は,ある日部屋の壁を壊...
3 2 50 1 2 3 4 4 75 1 2 3 0 3 1 10 8 1 1 0 0 0
150 0 112
25,858
s765296897
p01143
u109084363
1359100354
Python
Python
py
Accepted
20
4608
320
import sys import collections while True: N, M, P = map(int, sys.stdin.readline().split()) if N == 0: break X = [] for n in xrange(N): X.append(int(sys.stdin.readline())) if X[M - 1] == 0: print 0 else: print int(float(sum(X)) * 100 * (100 - P) / 100 / X[M - 1])
p01143
<!-- begin en only --> <h3><U> Princess' Gamble </U></h3> <!-- end en only --> <!-- begin ja only --> <h3><U> お姫様のギャンブル </U></h3> <!-- end ja only --> <!-- begin en only --> <p> English text is not available in this practice contest. </p> <!-- end en only --> <!-- begin ja only --> <p> ある貧乏な国のおてんばで勇敢なお姫様は,ある日部屋の壁を壊...
3 2 50 1 2 3 4 4 75 1 2 3 0 3 1 10 8 1 1 0 0 0
150 0 112
25,859
s961715106
p01143
u759949288
1361807636
Python
Python
py
Accepted
40
4224
255
while True: n, m, p = map(int, raw_input().split()) if n == m == p == 0: break gambler = 0; for i in xrange(n): x = input() gambler += x; if i + 1 == m: hit = x if hit: pool = gambler * 100 - gambler * p print pool / hit else: print 0
p01143
<!-- begin en only --> <h3><U> Princess' Gamble </U></h3> <!-- end en only --> <!-- begin ja only --> <h3><U> お姫様のギャンブル </U></h3> <!-- end ja only --> <!-- begin en only --> <p> English text is not available in this practice contest. </p> <!-- end en only --> <!-- begin ja only --> <p> ある貧乏な国のおてんばで勇敢なお姫様は,ある日部屋の壁を壊...
3 2 50 1 2 3 4 4 75 1 2 3 0 3 1 10 8 1 1 0 0 0
150 0 112
25,860
s180612383
p01143
u104911888
1372171398
Python
Python
py
Accepted
60
4252
232
while True: N,M,P=map(int,raw_input().split()) if N==M==P==0:break s,b=0,-1 for i in range(1,N+1): x=input() s+=x if i==M: b=x print int(s*100*(100-P)/(100.0*b)) if b!=0 else 0
p01143
<!-- begin en only --> <h3><U> Princess' Gamble </U></h3> <!-- end en only --> <!-- begin ja only --> <h3><U> お姫様のギャンブル </U></h3> <!-- end ja only --> <!-- begin en only --> <p> English text is not available in this practice contest. </p> <!-- end en only --> <!-- begin ja only --> <p> ある貧乏な国のおてんばで勇敢なお姫様は,ある日部屋の壁を壊...
3 2 50 1 2 3 4 4 75 1 2 3 0 3 1 10 8 1 1 0 0 0
150 0 112
25,861
s618024138
p01143
u621997536
1387243635
Python
Python
py
Accepted
60
4208
262
while 1: n, m, p = map(int, raw_input().split()) if not n: break x = [0] * n sum = 0 for i in range(n): x[i] = input() sum += x[i] if not x[m - 1]: print 0 else: print sum * (100 - p) / x[m - 1]
p01143
<!-- begin en only --> <h3><U> Princess' Gamble </U></h3> <!-- end en only --> <!-- begin ja only --> <h3><U> お姫様のギャンブル </U></h3> <!-- end ja only --> <!-- begin en only --> <p> English text is not available in this practice contest. </p> <!-- end en only --> <!-- begin ja only --> <p> ある貧乏な国のおてんばで勇敢なお姫様は,ある日部屋の壁を壊...
3 2 50 1 2 3 4 4 75 1 2 3 0 3 1 10 8 1 1 0 0 0
150 0 112
25,862
s411508513
p01143
u553881259
1391356863
Python
Python
py
Accepted
50
4248
225
while 1: n, winner, rate = map(int, raw_input().split()) if not (n|winner|rate): break ls = [input() for x in range(n)] if not ls[winner-1]: print 0 else: print int(sum(ls) * (100-rate) * 1.0/ls[winner-1])
p01143
<!-- begin en only --> <h3><U> Princess' Gamble </U></h3> <!-- end en only --> <!-- begin ja only --> <h3><U> お姫様のギャンブル </U></h3> <!-- end ja only --> <!-- begin en only --> <p> English text is not available in this practice contest. </p> <!-- end en only --> <!-- begin ja only --> <p> ある貧乏な国のおてんばで勇敢なお姫様は,ある日部屋の壁を壊...
3 2 50 1 2 3 4 4 75 1 2 3 0 3 1 10 8 1 1 0 0 0
150 0 112
25,863
s211602830
p01143
u633068244
1396540993
Python
Python
py
Accepted
50
4240
167
while 1: n,m,p=map(int,raw_input().split()) if n==0:break x=[input() for i in range(n)] if x[m-1]==0: print 0 continue print int((100-p)*sum(x)/float(x[m-1]))
p01143
<!-- begin en only --> <h3><U> Princess' Gamble </U></h3> <!-- end en only --> <!-- begin ja only --> <h3><U> お姫様のギャンブル </U></h3> <!-- end ja only --> <!-- begin en only --> <p> English text is not available in this practice contest. </p> <!-- end en only --> <!-- begin ja only --> <p> ある貧乏な国のおてんばで勇敢なお姫様は,ある日部屋の壁を壊...
3 2 50 1 2 3 4 4 75 1 2 3 0 3 1 10 8 1 1 0 0 0
150 0 112
25,864
s277712431
p01143
u633068244
1396541054
Python
Python
py
Accepted
50
4220
139
while 1: n,m,p=map(int,raw_input().split()) if n==0:break x=[input() for i in range(n)] print (100-p)*sum(x)/x[m-1] if x[m-1]!=0 else 0
p01143
<!-- begin en only --> <h3><U> Princess' Gamble </U></h3> <!-- end en only --> <!-- begin ja only --> <h3><U> お姫様のギャンブル </U></h3> <!-- end ja only --> <!-- begin en only --> <p> English text is not available in this practice contest. </p> <!-- end en only --> <!-- begin ja only --> <p> ある貧乏な国のおてんばで勇敢なお姫様は,ある日部屋の壁を壊...
3 2 50 1 2 3 4 4 75 1 2 3 0 3 1 10 8 1 1 0 0 0
150 0 112
25,865
s744524788
p01143
u633068244
1396541111
Python
Python
py
Accepted
20
4204
148
while 1: n,m,p=map(int,raw_input().split()) if n==0:break x=[int(raw_input()) for i in range(n)] print (100-p)*sum(x)/x[m-1] if x[m-1]!=0 else 0
p01143
<!-- begin en only --> <h3><U> Princess' Gamble </U></h3> <!-- end en only --> <!-- begin ja only --> <h3><U> お姫様のギャンブル </U></h3> <!-- end ja only --> <!-- begin en only --> <p> English text is not available in this practice contest. </p> <!-- end en only --> <!-- begin ja only --> <p> ある貧乏な国のおてんばで勇敢なお姫様は,ある日部屋の壁を壊...
3 2 50 1 2 3 4 4 75 1 2 3 0 3 1 10 8 1 1 0 0 0
150 0 112
25,866
s321072763
p01143
u057189799
1596948625
Python
Python3
py
Accepted
50
5620
284
while True: N, M, P = map(int, input().split()) if N == 0 and M == 0 and P == 0: break X = [0 for i in range(N)] for i in range(N): X[i] = int(input()) if X[M - 1] != 0: print(sum(X) * (100 - P) // X[M - 1]) else: print(0)
p01143
<!-- begin en only --> <h3><U> Princess' Gamble </U></h3> <!-- end en only --> <!-- begin ja only --> <h3><U> お姫様のギャンブル </U></h3> <!-- end ja only --> <!-- begin en only --> <p> English text is not available in this practice contest. </p> <!-- end en only --> <!-- begin ja only --> <p> ある貧乏な国のおてんばで勇敢なお姫様は,ある日部屋の壁を壊...
3 2 50 1 2 3 4 4 75 1 2 3 0 3 1 10 8 1 1 0 0 0
150 0 112
25,867
s073619255
p01143
u301153456
1594808450
Python
Python3
py
Accepted
50
5608
522
l = input() while l != '0 0 0': l_split = l.split(' ') athletes = int(l_split[0]) winner = int(l_split[1]) percent = int(l_split[2]) total_ticket = 0 win_ticket = 0 for i in range(athletes): tickets = int(input()) total_ticket += tickets if i + 1 == winner and tickets...
p01143
<!-- begin en only --> <h3><U> Princess' Gamble </U></h3> <!-- end en only --> <!-- begin ja only --> <h3><U> お姫様のギャンブル </U></h3> <!-- end ja only --> <!-- begin en only --> <p> English text is not available in this practice contest. </p> <!-- end en only --> <!-- begin ja only --> <p> ある貧乏な国のおてんばで勇敢なお姫様は,ある日部屋の壁を壊...
3 2 50 1 2 3 4 4 75 1 2 3 0 3 1 10 8 1 1 0 0 0
150 0 112
25,868
s678137371
p01143
u489396453
1592670998
Python
Python3
py
Accepted
40
5688
482
import math while True: data = input().split() n, m ,p = int(data[0]),int(data[1]),int(data[2]) if n == 0 and m == 0 and p == 0: break x = [] pool = 0 for i in range(n): bets = int(input()) pool += bets * 100 x.append(bets) winner = m-1 if x[winner] == 0: ...
p01143
<!-- begin en only --> <h3><U> Princess' Gamble </U></h3> <!-- end en only --> <!-- begin ja only --> <h3><U> お姫様のギャンブル </U></h3> <!-- end ja only --> <!-- begin en only --> <p> English text is not available in this practice contest. </p> <!-- end en only --> <!-- begin ja only --> <p> ある貧乏な国のおてんばで勇敢なお姫様は,ある日部屋の壁を壊...
3 2 50 1 2 3 4 4 75 1 2 3 0 3 1 10 8 1 1 0 0 0
150 0 112
25,869
s293366748
p01143
u240091169
1591262855
Python
Python3
py
Accepted
50
5616
341
while True : N, M, P = map(int, input().split()) if N == 0 and M == 0 and P == 0 : break Sum = 0 for i in range(N) : x = int(input()) Sum += x if i == M - 1 : winner = x if winner == 0 : print(0) else : print(int(Sum * 100 * (100 -...
p01143
<!-- begin en only --> <h3><U> Princess' Gamble </U></h3> <!-- end en only --> <!-- begin ja only --> <h3><U> お姫様のギャンブル </U></h3> <!-- end ja only --> <!-- begin en only --> <p> English text is not available in this practice contest. </p> <!-- end en only --> <!-- begin ja only --> <p> ある貧乏な国のおてんばで勇敢なお姫様は,ある日部屋の壁を壊...
3 2 50 1 2 3 4 4 75 1 2 3 0 3 1 10 8 1 1 0 0 0
150 0 112
25,870
s036036761
p01143
u353888999
1585947833
Python
Python3
py
Accepted
40
5624
347
while 1: n,m,p = map(int,input().split()) if n == 0 and m == 0 and p == 0: break x = [int(input()) for i in range(n)] Sum_kingaku = sum(x)*100 p = p / 100 koujyo = Sum_kingaku * p kakekin = Sum_kingaku - koujyo if x[m-1] == 0: ans = 0 else: ans = kakekin // x[...
p01143
<!-- begin en only --> <h3><U> Princess' Gamble </U></h3> <!-- end en only --> <!-- begin ja only --> <h3><U> お姫様のギャンブル </U></h3> <!-- end ja only --> <!-- begin en only --> <p> English text is not available in this practice contest. </p> <!-- end en only --> <!-- begin ja only --> <p> ある貧乏な国のおてんばで勇敢なお姫様は,ある日部屋の壁を壊...
3 2 50 1 2 3 4 4 75 1 2 3 0 3 1 10 8 1 1 0 0 0
150 0 112
25,871
s220786871
p01143
u206124123
1583560528
Python
Python3
py
Accepted
50
5696
1,351
import math TICKET_PRICE = 100 def get_data_list(): data_list = input().split() for i in range(len(data_list)): data_list[i] = int(data_list[i]) return data_list def get_input(): input_data = int(input()) return input_data def make_ticket_dict(player): ticket_sum = 0 ticket_list ...
p01143
<!-- begin en only --> <h3><U> Princess' Gamble </U></h3> <!-- end en only --> <!-- begin ja only --> <h3><U> お姫様のギャンブル </U></h3> <!-- end ja only --> <!-- begin en only --> <p> English text is not available in this practice contest. </p> <!-- end en only --> <!-- begin ja only --> <p> ある貧乏な国のおてんばで勇敢なお姫様は,ある日部屋の壁を壊...
3 2 50 1 2 3 4 4 75 1 2 3 0 3 1 10 8 1 1 0 0 0
150 0 112
25,872
s395859100
p01143
u153447291
1581844191
Python
Python3
py
Accepted
40
5680
244
import math while True: n,m,p = map(int,input().split()) if n == m == p == 0: break m -= 1 x = [int(input()) for i in range(n)] if x[m] == 0: print(0) else: print(math.floor((100-p)*sum(x)/x[m]))
p01143
<!-- begin en only --> <h3><U> Princess' Gamble </U></h3> <!-- end en only --> <!-- begin ja only --> <h3><U> お姫様のギャンブル </U></h3> <!-- end ja only --> <!-- begin en only --> <p> English text is not available in this practice contest. </p> <!-- end en only --> <!-- begin ja only --> <p> ある貧乏な国のおてんばで勇敢なお姫様は,ある日部屋の壁を壊...
3 2 50 1 2 3 4 4 75 1 2 3 0 3 1 10 8 1 1 0 0 0
150 0 112
25,873
s562247599
p01143
u492405338
1580121674
Python
Python3
py
Accepted
50
5616
239
while True: n, m, p = [int(i) for i in input().split()] if n == 0 and m == 0 and p == 0: break x = [int(input()) for i in range(n)] s = sum(x) print(s*(100 - p) // x[m - 1]) if x[m - 1] != 0 else print(0)
p01143
<!-- begin en only --> <h3><U> Princess' Gamble </U></h3> <!-- end en only --> <!-- begin ja only --> <h3><U> お姫様のギャンブル </U></h3> <!-- end ja only --> <!-- begin en only --> <p> English text is not available in this practice contest. </p> <!-- end en only --> <!-- begin ja only --> <p> ある貧乏な国のおてんばで勇敢なお姫様は,ある日部屋の壁を壊...
3 2 50 1 2 3 4 4 75 1 2 3 0 3 1 10 8 1 1 0 0 0
150 0 112
25,874
s118656024
p01143
u264450287
1562473504
Python
Python3
py
Accepted
40
5624
288
while True: N,M,P=map(int,input().split()) if N==0 and M==0 and P==0: break card=[] for i in range(N): card.append(int(input())) if card[M-1]==0: print(0) else: sc=sum(card) kati=sc*100-(sc*100*(P/100)) haitou=kati//(card[M-1]) print(int(haitou))
p01143
<!-- begin en only --> <h3><U> Princess' Gamble </U></h3> <!-- end en only --> <!-- begin ja only --> <h3><U> お姫様のギャンブル </U></h3> <!-- end ja only --> <!-- begin en only --> <p> English text is not available in this practice contest. </p> <!-- end en only --> <!-- begin ja only --> <p> ある貧乏な国のおてんばで勇敢なお姫様は,ある日部屋の壁を壊...
3 2 50 1 2 3 4 4 75 1 2 3 0 3 1 10 8 1 1 0 0 0
150 0 112
25,875
s640611018
p01143
u037441960
1560957556
Python
Python3
py
Accepted
50
5612
300
while True : N, M, P = map(int, input().split()) if(N == 0 and M == 0 and P == 0) : break else : X = list() for i in range(N) : x = int(input()) X.append(x) top = X[M - 1] Sum = sum(X) all = Sum * (100 - P) if(top == 0) : print(0) else : ans = all // top print(ans)
p01143
<!-- begin en only --> <h3><U> Princess' Gamble </U></h3> <!-- end en only --> <!-- begin ja only --> <h3><U> お姫様のギャンブル </U></h3> <!-- end ja only --> <!-- begin en only --> <p> English text is not available in this practice contest. </p> <!-- end en only --> <!-- begin ja only --> <p> ある貧乏な国のおてんばで勇敢なお姫様は,ある日部屋の壁を壊...
3 2 50 1 2 3 4 4 75 1 2 3 0 3 1 10 8 1 1 0 0 0
150 0 112
25,876
s355377459
p01143
u489876484
1560403247
Python
Python3
py
Accepted
40
5624
366
def main(): while True: n,m,p = map(int,input().split()) if (n,m,p) == (0,0,0): return ps = [int(input()) for _ in range(n)] pool = sum(ps) * 100 pool = pool * (100-p) // 100 if ps[m-1] == 0: print(0) else: print(pool // ps...
p01143
<!-- begin en only --> <h3><U> Princess' Gamble </U></h3> <!-- end en only --> <!-- begin ja only --> <h3><U> お姫様のギャンブル </U></h3> <!-- end ja only --> <!-- begin en only --> <p> English text is not available in this practice contest. </p> <!-- end en only --> <!-- begin ja only --> <p> ある貧乏な国のおてんばで勇敢なお姫様は,ある日部屋の壁を壊...
3 2 50 1 2 3 4 4 75 1 2 3 0 3 1 10 8 1 1 0 0 0
150 0 112
25,877
s099148396
p01143
u990228206
1554985081
Python
Python3
py
Accepted
40
5612
212
while 1: n,m,p=map(int,input().split()) if n==m==p==0:break ticket=[] for i in range(n):ticket.append(int(input())) if ticket[m-1]==0:print(0) else:print(sum(ticket)*(100-p)//ticket[m-1])
p01143
<!-- begin en only --> <h3><U> Princess' Gamble </U></h3> <!-- end en only --> <!-- begin ja only --> <h3><U> お姫様のギャンブル </U></h3> <!-- end ja only --> <!-- begin en only --> <p> English text is not available in this practice contest. </p> <!-- end en only --> <!-- begin ja only --> <p> ある貧乏な国のおてんばで勇敢なお姫様は,ある日部屋の壁を壊...
3 2 50 1 2 3 4 4 75 1 2 3 0 3 1 10 8 1 1 0 0 0
150 0 112
25,878
s700999921
p01143
u717526540
1545117045
Python
Python3
py
Accepted
50
5612
282
while 1: n, m, p = map(int, input().split()) if n == 0: break vote = [] for _ in range(n): vote.append(int(input())) total = sum(vote) * 100 * (100 - p) // 100 if vote[m-1] == 0: print(0) else: print(total // vote[m-1])
p01143
<!-- begin en only --> <h3><U> Princess' Gamble </U></h3> <!-- end en only --> <!-- begin ja only --> <h3><U> お姫様のギャンブル </U></h3> <!-- end ja only --> <!-- begin en only --> <p> English text is not available in this practice contest. </p> <!-- end en only --> <!-- begin ja only --> <p> ある貧乏な国のおてんばで勇敢なお姫様は,ある日部屋の壁を壊...
3 2 50 1 2 3 4 4 75 1 2 3 0 3 1 10 8 1 1 0 0 0
150 0 112
25,879
s467020324
p01143
u260980560
1542541094
Python
Python3
py
Accepted
30
5628
325
readline = open(0).readline ans = [] while 1: N, M, P = map(int, readline().split()) if N == 0: break X = [int(readline()) for i in range(N)] s = sum(X) t = X[M-1] if t == 0: ans.append("0\n") continue ans.append("%d\n" % int(s * (100-P) / t)) open(1, 'w').writelines(...
p01143
<!-- begin en only --> <h3><U> Princess' Gamble </U></h3> <!-- end en only --> <!-- begin ja only --> <h3><U> お姫様のギャンブル </U></h3> <!-- end ja only --> <!-- begin en only --> <p> English text is not available in this practice contest. </p> <!-- end en only --> <!-- begin ja only --> <p> ある貧乏な国のおてんばで勇敢なお姫様は,ある日部屋の壁を壊...
3 2 50 1 2 3 4 4 75 1 2 3 0 3 1 10 8 1 1 0 0 0
150 0 112
25,880
s072431251
p01143
u281836941
1513272221
Python
Python3
py
Accepted
50
5616
203
while 1: n,m,p=map(int,input().split()) if n==0: break data=[] for i in range(n): data.append(int(input())) print(sum(data)*(100-p)//data[m-1] if data[m-1]!=0 else 0)
p01143
<!-- begin en only --> <h3><U> Princess' Gamble </U></h3> <!-- end en only --> <!-- begin ja only --> <h3><U> お姫様のギャンブル </U></h3> <!-- end ja only --> <!-- begin en only --> <p> English text is not available in this practice contest. </p> <!-- end en only --> <!-- begin ja only --> <p> ある貧乏な国のおてんばで勇敢なお姫様は,ある日部屋の壁を壊...
3 2 50 1 2 3 4 4 75 1 2 3 0 3 1 10 8 1 1 0 0 0
150 0 112
25,881
s114803688
p01143
u717727327
1421059374
Python
Python
py
Accepted
30
4212
271
def solve(N, M, P, X): if X[M-1] == 0: return 0 return sum(X) * (100-P) / X[M-1] while True: N, M, P = map(int, raw_input().split(" ")) if N == M == P == 0: break X = [int(raw_input()) for _ in range(N)] print solve(N, M, P, X)
p01143
<!-- begin en only --> <h3><U> Princess' Gamble </U></h3> <!-- end en only --> <!-- begin ja only --> <h3><U> お姫様のギャンブル </U></h3> <!-- end ja only --> <!-- begin en only --> <p> English text is not available in this practice contest. </p> <!-- end en only --> <!-- begin ja only --> <p> ある貧乏な国のおてんばで勇敢なお姫様は,ある日部屋の壁を壊...
3 2 50 1 2 3 4 4 75 1 2 3 0 3 1 10 8 1 1 0 0 0
150 0 112
25,882
s091434205
p01145
u260980560
1588156818
Python
Python3
py
Accepted
40
5632
2,997
import sys readline = sys.stdin.readline write = sys.stdout.write def gen(e, k): r = [] if e[0]: r.append(e[0]) if e[1]: r.append(e[1]) if e[2]: if k: r.append("(" + e[2] + ")") else: r.append(e[2]) if e[3]: r.append(e[3]) return "...
p01145
<!-- begin en only --> <h3><U> Princess' Japanese </U></h3> <!-- end en only --> <!-- begin ja only --> <h3><U> お姫様の日本語 </U></h3> <!-- end ja only --> <!-- begin en only --> <p> English text is not available in this practice contest. </p> <!-- end en only --> <!-- begin ja only --> <p> ある貧乏な国のおてんばで勇敢なお姫様は,日本語の勉強を...
kusa haha hakata kippu sasakisan sosonokasu hottokouhii i #
k(u)sa h(a)ha h(a)kata k(i)ppu s(a)sak(i)san s(o)sonokas(u) hott(o)kouhii i
25,883
s062571945
p01149
u266872031
1422785158
Python
Python
py
Accepted
10
4284
1,021
N=int(raw_input()) for i in range(N): hand=raw_input().split() deck=raw_input().split() #defaulthand d=0 points=0 for i in range(len(hand)): if hand[i] in ['T','J','Q','K']: hand[i]=10 elif hand[i]=='A': hand[i]=11 else: hand[i]=int(hand...
p01149
<H1><font color="#000">Problem A:</font> Blackjack</H1> <p> Brian Jones is an undergraduate student at Advanced College of Metropolitan. Recently he was given an assignment in his class of Computer Science to write a program that plays a dealer of blackjack. </p> <p> Blackjack is a game played with one or more decks...
4 5 4 9 2 8 3 7 4 6 5 A J K Q J T 9 8 7 6 T 4 7 J A 6 Q T K 7 2 2 2 3 4 K 2 3 4 K
18 blackjack 21 bust
25,884
s195903974
p01171
u827448139
1419360425
Python
Python3
py
Accepted
70
6720
260
def f(n): a=set() i=2 while i*i<=n: while n%i==0: a.add(i) n//=i i+=1 if n>1: a.add(n) return a while 1: a,b=map(int,input().split()) if (a|b)==0: break a,b=f(a),f(b) print("a" if 2*max(a)-sum(a)>2*max(b)-sum(b) else "b")
p01171
<H1><font color="#000">Problem A:</font> Everlasting...?</H1> <p> Everlasting Sa-Ga, a new, hot and very popular role-playing game, is out on October 19, 2008. Fans have been looking forward to a new title of Everlasting Sa-Ga. </p> <p> Little Jimmy is in trouble. He is a seven-year-old boy, and he obtained the Everl...
10 15 30 20 0 0
a b
25,885
s579657958
p01171
u266872031
1422786976
Python
Python
py
Accepted
30
4432
914
import math primes=[2] top=2 nlist=[2*x-1 for x in range(2,500)] while top<math.sqrt(500): top=nlist[0] primes.append(top) newnlist=[] for i in nlist: if i%top!=0: newnlist.append(i) nlist=newnlist primes=primes+nlist def getpoints(a): primelist=[] while a>1: pr...
p01171
<H1><font color="#000">Problem A:</font> Everlasting...?</H1> <p> Everlasting Sa-Ga, a new, hot and very popular role-playing game, is out on October 19, 2008. Fans have been looking forward to a new title of Everlasting Sa-Ga. </p> <p> Little Jimmy is in trouble. He is a seven-year-old boy, and he obtained the Everl...
10 15 30 20 0 0
a b
25,886
s846327292
p01171
u240091169
1593753134
Python
Python3
py
Accepted
80
5668
795
import math def Soinsu(a, b) : global soin while True : if a % b == 0 : soin.append(b) if a/b == 1 : break else : Soinsu(a/b, b) break else : b += 1 if math.sqrt(a) < b : s...
p01171
<H1><font color="#000">Problem A:</font> Everlasting...?</H1> <p> Everlasting Sa-Ga, a new, hot and very popular role-playing game, is out on October 19, 2008. Fans have been looking forward to a new title of Everlasting Sa-Ga. </p> <p> Little Jimmy is in trouble. He is a seven-year-old boy, and he obtained the Everl...
10 15 30 20 0 0
a b
25,887
s245820343
p01202
u575065019
1345634332
Python
Python
py
Accepted
100
7480
303
ans = [] n = input() p = 0 while p != n: score = raw_input() length = len(score) flag = 0 for i in range(length-1): if score[i] == score[i+1]: flag = 1 if flag == 0: ans.append("Yes") else: ans.append("No") p += 1 for i in ans: print i
p01202
<H1><font color="#000">Problem A:</font> Dance Dance Revolution</H1> <p> <i>Dance Dance Revolution</i> is one of the most popular arcade games in Japan. The rule of this game is very simple. A series of four arrow symbols, <i>up</i>, <i>down</i>, <i>left</i> and <i>right</i>, flows downwards on the screen in time to ...
3 UU RDUL ULDURDULDURDULDURDULDURD
No Yes Yes
25,888
s197124880
p01202
u633068244
1396601177
Python
Python
py
Accepted
60
7448
149
for i in range(input()): step=raw_input() flag=0 for j in range(len(step)-1): if step[j]==step[j+1]: print "No" break else: print "Yes"
p01202
<H1><font color="#000">Problem A:</font> Dance Dance Revolution</H1> <p> <i>Dance Dance Revolution</i> is one of the most popular arcade games in Japan. The rule of this game is very simple. A series of four arrow symbols, <i>up</i>, <i>down</i>, <i>left</i> and <i>right</i>, flows downwards on the screen in time to ...
3 UU RDUL ULDURDULDURDULDURDULDURD
No Yes Yes
25,889
s921303246
p01202
u633068244
1396601394
Python
Python
py
Accepted
20
4380
152
for i in range(input()): step=raw_input().replace("LL","1").replace("UU","1").replace("DD","1").replace("RR","1") print "No" if "1" in step else "Yes"
p01202
<H1><font color="#000">Problem A:</font> Dance Dance Revolution</H1> <p> <i>Dance Dance Revolution</i> is one of the most popular arcade games in Japan. The rule of this game is very simple. A series of four arrow symbols, <i>up</i>, <i>down</i>, <i>left</i> and <i>right</i>, flows downwards on the screen in time to ...
3 UU RDUL ULDURDULDURDULDURDULDURD
No Yes Yes
25,890
s684814809
p01202
u633068244
1396601469
Python
Python
py
Accepted
20
4368
139
for i in range(input()):print "No" if "1" in raw_input().replace("LL","1").replace("UU","1").replace("DD","1").replace("RR","1") else "Yes"
p01202
<H1><font color="#000">Problem A:</font> Dance Dance Revolution</H1> <p> <i>Dance Dance Revolution</i> is one of the most popular arcade games in Japan. The rule of this game is very simple. A series of four arrow symbols, <i>up</i>, <i>down</i>, <i>left</i> and <i>right</i>, flows downwards on the screen in time to ...
3 UU RDUL ULDURDULDURDULDURDULDURD
No Yes Yes
25,891
s711813904
p01202
u633068244
1396602809
Python
Python
py
Accepted
20
4272
118
import re r=re.compile("UU|DD|RR|LL") for i in range(input()):print "Yes" if r.search(raw_input()) is None else "No"
p01202
<H1><font color="#000">Problem A:</font> Dance Dance Revolution</H1> <p> <i>Dance Dance Revolution</i> is one of the most popular arcade games in Japan. The rule of this game is very simple. A series of four arrow symbols, <i>up</i>, <i>down</i>, <i>left</i> and <i>right</i>, flows downwards on the screen in time to ...
3 UU RDUL ULDURDULDURDULDURDULDURD
No Yes Yes
25,892
s398241901
p01223
u352394527
1545352101
Python
Python3
py
Accepted
30
5608
219
t = int(input()) for _ in range(t): n = int(input()) lst = list(map(int, input().split())) M = m = 0 for i in range(n - 1): M = max(lst[i + 1] - lst[i], M) m = min(lst[i + 1] - lst[i], m) print(M, -m)
p01223
<h1><font color="#000">Problem A:</font>サイゾウ</h1> <p> ある国で「サイゾウ」というテレビ番組が流行している. この番組は参加者がフィールドアスレチックに挑戦し, 見事攻略すれば賞金をもらえるというものである. </p> <p> フィールドアスレチックは高さが異なるブロックを一列に並べて作られていて, 攻略のためにはいかにして段差を登り降りするかが重要になる (図1). この番組に参加することになったあなたの友人は, フィールドアスレチックの構造が与えられたときに, 登らなければならない最大...
5 5 10 70 30 50 90 2 20 100 2 100 30 3 50 50 50 7 123 45 678 901 234 567 890
60 40 80 0 0 70 0 0 633 667
25,893
s179451246
p01223
u408260374
1418335881
Python
Python3
py
Accepted
40
6724
304
d = int(input()) for i in range(d): n = int(input()) l = list(map(int, input().split())) dis = [l[i+1] - l[i] for i in range(n - 1)] M, m = max(dis), min(dis) if M > 0 and m > 0: print(M, 0) elif M < 0 and m < 0: print(0, abs(m)) else: print(M, abs(m))
p01223
<h1><font color="#000">Problem A:</font>サイゾウ</h1> <p> ある国で「サイゾウ」というテレビ番組が流行している. この番組は参加者がフィールドアスレチックに挑戦し, 見事攻略すれば賞金をもらえるというものである. </p> <p> フィールドアスレチックは高さが異なるブロックを一列に並べて作られていて, 攻略のためにはいかにして段差を登り降りするかが重要になる (図1). この番組に参加することになったあなたの友人は, フィールドアスレチックの構造が与えられたときに, 登らなければならない最大...
5 5 10 70 30 50 90 2 20 100 2 100 30 3 50 50 50 7 123 45 678 901 234 567 890
60 40 80 0 0 70 0 0 633 667
25,894
s992328455
p01223
u873482706
1434361734
Python
Python
py
Accepted
20
4232
598
all_count = int(raw_input()) for i in range(all_count): dansa_count = int(raw_input()) lis = raw_input().split(' ') dansa_lis = [int(num) for num in lis] up_lis = [] down_lis = [] for i in range(dansa_count-1): if dansa_lis[i] <= dansa_lis[i+1]: up = dansa_lis[i+1] - da...
p01223
<h1><font color="#000">Problem A:</font>サイゾウ</h1> <p> ある国で「サイゾウ」というテレビ番組が流行している. この番組は参加者がフィールドアスレチックに挑戦し, 見事攻略すれば賞金をもらえるというものである. </p> <p> フィールドアスレチックは高さが異なるブロックを一列に並べて作られていて, 攻略のためにはいかにして段差を登り降りするかが重要になる (図1). この番組に参加することになったあなたの友人は, フィールドアスレチックの構造が与えられたときに, 登らなければならない最大...
5 5 10 70 30 50 90 2 20 100 2 100 30 3 50 50 50 7 123 45 678 901 234 567 890
60 40 80 0 0 70 0 0 633 667
25,895
s988998970
p01223
u940190657
1436680061
Python
Python3
py
Accepted
40
6720
615
# solve def solve(n, block): max_up = 0 max_down = 0 for i in range(n-1): if block[i] < block[i+1]: max_up = max(max_up, block[i+1]-block[i]) elif block[i] > block[i+1]: max_down = max(max_down, block[i]-block[i+1]) return (max_up, max_down) # main function if _...
p01223
<h1><font color="#000">Problem A:</font>サイゾウ</h1> <p> ある国で「サイゾウ」というテレビ番組が流行している. この番組は参加者がフィールドアスレチックに挑戦し, 見事攻略すれば賞金をもらえるというものである. </p> <p> フィールドアスレチックは高さが異なるブロックを一列に並べて作られていて, 攻略のためにはいかにして段差を登り降りするかが重要になる (図1). この番組に参加することになったあなたの友人は, フィールドアスレチックの構造が与えられたときに, 登らなければならない最大...
5 5 10 70 30 50 90 2 20 100 2 100 30 3 50 50 50 7 123 45 678 901 234 567 890
60 40 80 0 0 70 0 0 633 667
25,896
s883958358
p01223
u489809100
1448255728
Python
Python
py
Accepted
30
6248
279
n = input() for _ in xrange(n): h = input() up = 0 down = 0 wall = map(int,raw_input().split()) now = wall[0] for var in wall[1:]: if var > now and var - now > up: up = var - now elif var < now and now - var > down: down = now - var now = var print up,down
p01223
<h1><font color="#000">Problem A:</font>サイゾウ</h1> <p> ある国で「サイゾウ」というテレビ番組が流行している. この番組は参加者がフィールドアスレチックに挑戦し, 見事攻略すれば賞金をもらえるというものである. </p> <p> フィールドアスレチックは高さが異なるブロックを一列に並べて作られていて, 攻略のためにはいかにして段差を登り降りするかが重要になる (図1). この番組に参加することになったあなたの友人は, フィールドアスレチックの構造が与えられたときに, 登らなければならない最大...
5 5 10 70 30 50 90 2 20 100 2 100 30 3 50 50 50 7 123 45 678 901 234 567 890
60 40 80 0 0 70 0 0 633 667
25,897
s513575560
p01223
u073685357
1477491161
Python
Python3
py
Accepted
30
7660
6,711
#coding:UTF-8 ...
p01223
<h1><font color="#000">Problem A:</font>サイゾウ</h1> <p> ある国で「サイゾウ」というテレビ番組が流行している. この番組は参加者がフィールドアスレチックに挑戦し, 見事攻略すれば賞金をもらえるというものである. </p> <p> フィールドアスレチックは高さが異なるブロックを一列に並べて作られていて, 攻略のためにはいかにして段差を登り降りするかが重要になる (図1). この番組に参加することになったあなたの友人は, フィールドアスレチックの構造が与えられたときに, 登らなければならない最大...
5 5 10 70 30 50 90 2 20 100 2 100 30 3 50 50 50 7 123 45 678 901 234 567 890
60 40 80 0 0 70 0 0 633 667
25,898
s459595215
p01223
u078042885
1483837557
Python
Python3
py
Accepted
30
7696
232
n=int(input()) while n: input() n-=1 a=list(map(int,input().split())) u,d=0,0 for i in range(1,len(a)): if a[i]-a[i-1]>0:u=max(a[i]-a[i-1],u) elif a[i]-a[i-1]<0:d=max(a[i-1]-a[i],d) print(u,d)
p01223
<h1><font color="#000">Problem A:</font>サイゾウ</h1> <p> ある国で「サイゾウ」というテレビ番組が流行している. この番組は参加者がフィールドアスレチックに挑戦し, 見事攻略すれば賞金をもらえるというものである. </p> <p> フィールドアスレチックは高さが異なるブロックを一列に並べて作られていて, 攻略のためにはいかにして段差を登り降りするかが重要になる (図1). この番組に参加することになったあなたの友人は, フィールドアスレチックの構造が与えられたときに, 登らなければならない最大...
5 5 10 70 30 50 90 2 20 100 2 100 30 3 50 50 50 7 123 45 678 901 234 567 890
60 40 80 0 0 70 0 0 633 667
25,899
s710522146
p01223
u546285759
1485863659
Python
Python3
py
Accepted
40
7544
222
for _ in range(int(input())): _= int(input()) upv=dov=0 h= list(map(int, input().split())) for i in range(len(h)-1): upv= max(upv, h[i+1]-h[i]) dov= max(dov, h[i]-h[i+1]) print(upv, dov)
p01223
<h1><font color="#000">Problem A:</font>サイゾウ</h1> <p> ある国で「サイゾウ」というテレビ番組が流行している. この番組は参加者がフィールドアスレチックに挑戦し, 見事攻略すれば賞金をもらえるというものである. </p> <p> フィールドアスレチックは高さが異なるブロックを一列に並べて作られていて, 攻略のためにはいかにして段差を登り降りするかが重要になる (図1). この番組に参加することになったあなたの友人は, フィールドアスレチックの構造が与えられたときに, 登らなければならない最大...
5 5 10 70 30 50 90 2 20 100 2 100 30 3 50 50 50 7 123 45 678 901 234 567 890
60 40 80 0 0 70 0 0 633 667
25,900
s168698502
p01223
u371539389
1492653712
Python
Python3
py
Accepted
30
7664
419
t=int(input()) for count in range(t): n=int(input()) h_list=[int(i) for i in input().split(" ")] delta_list=[] for i in range(n-1): delta_list.append(h_list[i+1]-h_list[i]) if max(delta_list)>0: max_up=max(delta_list) else: max_up=0 if min(delta_list)<0: max...
p01223
<h1><font color="#000">Problem A:</font>サイゾウ</h1> <p> ある国で「サイゾウ」というテレビ番組が流行している. この番組は参加者がフィールドアスレチックに挑戦し, 見事攻略すれば賞金をもらえるというものである. </p> <p> フィールドアスレチックは高さが異なるブロックを一列に並べて作られていて, 攻略のためにはいかにして段差を登り降りするかが重要になる (図1). この番組に参加することになったあなたの友人は, フィールドアスレチックの構造が与えられたときに, 登らなければならない最大...
5 5 10 70 30 50 90 2 20 100 2 100 30 3 50 50 50 7 123 45 678 901 234 567 890
60 40 80 0 0 70 0 0 633 667
25,901
s557598045
p01223
u546285759
1508274775
Python
Python3
py
Accepted
30
7572
244
t = int(input()) for _ in range(t): n = int(input()) h = list(map(int, input().split())) maxv = minv = 0 for i in range(len(h)-1): maxv = max(maxv, h[i+1]-h[i]) minv = max(minv, h[i]-h[i+1]) print(maxv, minv)
p01223
<h1><font color="#000">Problem A:</font>サイゾウ</h1> <p> ある国で「サイゾウ」というテレビ番組が流行している. この番組は参加者がフィールドアスレチックに挑戦し, 見事攻略すれば賞金をもらえるというものである. </p> <p> フィールドアスレチックは高さが異なるブロックを一列に並べて作られていて, 攻略のためにはいかにして段差を登り降りするかが重要になる (図1). この番組に参加することになったあなたの友人は, フィールドアスレチックの構造が与えられたときに, 登らなければならない最大...
5 5 10 70 30 50 90 2 20 100 2 100 30 3 50 50 50 7 123 45 678 901 234 567 890
60 40 80 0 0 70 0 0 633 667
25,902
s288846839
p01223
u546285759
1516533735
Python
Python3
py
Accepted
40
5604
269
t = int(input()) for _ in range(t): n = int(input()) blocks = list(map(int, input().split())) ans = [0, 0] for i in range(1, n): ans[0] = max(ans[0], blocks[i] - blocks[i-1]) ans[1] = max(ans[1], blocks[i-1] - blocks[i]) print(*ans)
p01223
<h1><font color="#000">Problem A:</font>サイゾウ</h1> <p> ある国で「サイゾウ」というテレビ番組が流行している. この番組は参加者がフィールドアスレチックに挑戦し, 見事攻略すれば賞金をもらえるというものである. </p> <p> フィールドアスレチックは高さが異なるブロックを一列に並べて作られていて, 攻略のためにはいかにして段差を登り降りするかが重要になる (図1). この番組に参加することになったあなたの友人は, フィールドアスレチックの構造が与えられたときに, 登らなければならない最大...
5 5 10 70 30 50 90 2 20 100 2 100 30 3 50 50 50 7 123 45 678 901 234 567 890
60 40 80 0 0 70 0 0 633 667
25,903
s084043698
p01223
u546285759
1516533804
Python
Python3
py
Accepted
30
5600
271
t = int(input()) for _ in range(t): n = int(input()) blocks = list(map(int, input().split())) maxv = minv = 0 for i in range(1, n): maxv = max(maxv, blocks[i] - blocks[i-1]) minv = max(minv, blocks[i-1] - blocks[i]) print(maxv, minv)
p01223
<h1><font color="#000">Problem A:</font>サイゾウ</h1> <p> ある国で「サイゾウ」というテレビ番組が流行している. この番組は参加者がフィールドアスレチックに挑戦し, 見事攻略すれば賞金をもらえるというものである. </p> <p> フィールドアスレチックは高さが異なるブロックを一列に並べて作られていて, 攻略のためにはいかにして段差を登り降りするかが重要になる (図1). この番組に参加することになったあなたの友人は, フィールドアスレチックの構造が与えられたときに, 登らなければならない最大...
5 5 10 70 30 50 90 2 20 100 2 100 30 3 50 50 50 7 123 45 678 901 234 567 890
60 40 80 0 0 70 0 0 633 667
25,904
s723975115
p01223
u724548524
1527600116
Python
Python3
py
Accepted
30
5616
202
for _ in range(int(input())): n, a = int(input()), list(map(int, input().split())) d = [0, 0] for i in range(1, n):d = [max(a[i] - a[i - 1], d[0]), max(a[i - 1] - a[i], d[1])] print(*d)
p01223
<h1><font color="#000">Problem A:</font>サイゾウ</h1> <p> ある国で「サイゾウ」というテレビ番組が流行している. この番組は参加者がフィールドアスレチックに挑戦し, 見事攻略すれば賞金をもらえるというものである. </p> <p> フィールドアスレチックは高さが異なるブロックを一列に並べて作られていて, 攻略のためにはいかにして段差を登り降りするかが重要になる (図1). この番組に参加することになったあなたの友人は, フィールドアスレチックの構造が与えられたときに, 登らなければならない最大...
5 5 10 70 30 50 90 2 20 100 2 100 30 3 50 50 50 7 123 45 678 901 234 567 890
60 40 80 0 0 70 0 0 633 667
25,905
s188942333
p01223
u575065019
1345632414
Python
Python
py
Accepted
20
5648
413
ans = [] t = input() s = 0 while s != t: n = input() step = map(int,raw_input().split()) upMax = 0 downMax = 0 for i in range(n-1): if step[i+1] - step[i] > upMax: upMax = step[i+1] - step[i] if step[i] - step[i+1] > downMax: downMax = step[i] - step[i+1] ...
p01223
<h1><font color="#000">Problem A:</font>サイゾウ</h1> <p> ある国で「サイゾウ」というテレビ番組が流行している. この番組は参加者がフィールドアスレチックに挑戦し, 見事攻略すれば賞金をもらえるというものである. </p> <p> フィールドアスレチックは高さが異なるブロックを一列に並べて作られていて, 攻略のためにはいかにして段差を登り降りするかが重要になる (図1). この番組に参加することになったあなたの友人は, フィールドアスレチックの構造が与えられたときに, 登らなければならない最大...
5 5 10 70 30 50 90 2 20 100 2 100 30 3 50 50 50 7 123 45 678 901 234 567 890
60 40 80 0 0 70 0 0 633 667
25,906
s023293869
p01223
u575065019
1345879223
Python
Python
py
Accepted
20
4252
413
ans = [] t = input() s = 0 while s != t: n = input() step = map(int,raw_input().split()) upMax = 0 downMax = 0 for i in range(n-1): if step[i+1] - step[i] > upMax: upMax = step[i+1] - step[i] if step[i] - step[i+1] > downMax: downMax = step[i] - step[i+1] ...
p01223
<h1><font color="#000">Problem A:</font>サイゾウ</h1> <p> ある国で「サイゾウ」というテレビ番組が流行している. この番組は参加者がフィールドアスレチックに挑戦し, 見事攻略すれば賞金をもらえるというものである. </p> <p> フィールドアスレチックは高さが異なるブロックを一列に並べて作られていて, 攻略のためにはいかにして段差を登り降りするかが重要になる (図1). この番組に参加することになったあなたの友人は, フィールドアスレチックの構造が与えられたときに, 登らなければならない最大...
5 5 10 70 30 50 90 2 20 100 2 100 30 3 50 50 50 7 123 45 678 901 234 567 890
60 40 80 0 0 70 0 0 633 667
25,907
s898901740
p01223
u104911888
1367467196
Python
Python
py
Accepted
10
4244
246
t=input() for j in range(t): n=input() L=map(int,raw_input().split()) mi,ma=0,0 for i in range(len(L)-1): if L[i]>L[i+1]: mi=min(mi,L[i+1]-L[i]) else: ma=max(ma,L[i+1]-L[i]) print ma,-mi
p01223
<h1><font color="#000">Problem A:</font>サイゾウ</h1> <p> ある国で「サイゾウ」というテレビ番組が流行している. この番組は参加者がフィールドアスレチックに挑戦し, 見事攻略すれば賞金をもらえるというものである. </p> <p> フィールドアスレチックは高さが異なるブロックを一列に並べて作られていて, 攻略のためにはいかにして段差を登り降りするかが重要になる (図1). この番組に参加することになったあなたの友人は, フィールドアスレチックの構造が与えられたときに, 登らなければならない最大...
5 5 10 70 30 50 90 2 20 100 2 100 30 3 50 50 50 7 123 45 678 901 234 567 890
60 40 80 0 0 70 0 0 633 667
25,908
s267825431
p01223
u865312527
1372255558
Python
Python
py
Accepted
20
4244
230
t=input() for i in range(t): up,dw=0,0 n=input() b=map(int,raw_input().split()) for j in range(n-1): if b[j]<b[j+1]: up=max(up,b[j+1]-b[j]) elif b[j]>b[j+1]: dw=max(dw,b[j]-b[j+1]) print up,dw
p01223
<h1><font color="#000">Problem A:</font>サイゾウ</h1> <p> ある国で「サイゾウ」というテレビ番組が流行している. この番組は参加者がフィールドアスレチックに挑戦し, 見事攻略すれば賞金をもらえるというものである. </p> <p> フィールドアスレチックは高さが異なるブロックを一列に並べて作られていて, 攻略のためにはいかにして段差を登り降りするかが重要になる (図1). この番組に参加することになったあなたの友人は, フィールドアスレチックの構造が与えられたときに, 登らなければならない最大...
5 5 10 70 30 50 90 2 20 100 2 100 30 3 50 50 50 7 123 45 678 901 234 567 890
60 40 80 0 0 70 0 0 633 667
25,909
s906546532
p01223
u454358619
1378100061
Python
Python
py
Accepted
20
4248
516
import sys def solve(): c = int(raw_input()) for i in range(c): n = int(raw_input()) data = map(int, raw_input().split()) u,d = 0,0 for i in range(len(data) - 1): if data[i + 1] - data[i] > 0 and data[i + 1] - data[i] > u: u = data[i + 1] ...
p01223
<h1><font color="#000">Problem A:</font>サイゾウ</h1> <p> ある国で「サイゾウ」というテレビ番組が流行している. この番組は参加者がフィールドアスレチックに挑戦し, 見事攻略すれば賞金をもらえるというものである. </p> <p> フィールドアスレチックは高さが異なるブロックを一列に並べて作られていて, 攻略のためにはいかにして段差を登り降りするかが重要になる (図1). この番組に参加することになったあなたの友人は, フィールドアスレチックの構造が与えられたときに, 登らなければならない最大...
5 5 10 70 30 50 90 2 20 100 2 100 30 3 50 50 50 7 123 45 678 901 234 567 890
60 40 80 0 0 70 0 0 633 667
25,910
s157653911
p01223
u633068244
1396603137
Python
Python
py
Accepted
20
4224
144
for i in range(input()): n=input() a=map(int,raw_input().split()) l=[a[i+1]-a[i] for i in range(n-1)] print max(0,max(l)),abs(min(0,min(l)))
p01223
<h1><font color="#000">Problem A:</font>サイゾウ</h1> <p> ある国で「サイゾウ」というテレビ番組が流行している. この番組は参加者がフィールドアスレチックに挑戦し, 見事攻略すれば賞金をもらえるというものである. </p> <p> フィールドアスレチックは高さが異なるブロックを一列に並べて作られていて, 攻略のためにはいかにして段差を登り降りするかが重要になる (図1). この番組に参加することになったあなたの友人は, フィールドアスレチックの構造が与えられたときに, 登らなければならない最大...
5 5 10 70 30 50 90 2 20 100 2 100 30 3 50 50 50 7 123 45 678 901 234 567 890
60 40 80 0 0 70 0 0 633 667
25,911
s370356924
p01223
u633068244
1396603290
Python
Python
py
Accepted
10
4228
138
for j in [1]*input(): n=input() a=map(int,raw_input().split()) l=[a[i+1]-a[i] for i in range(n-1)] print max(0,max(l)),-min(-0,min(l))
p01223
<h1><font color="#000">Problem A:</font>サイゾウ</h1> <p> ある国で「サイゾウ」というテレビ番組が流行している. この番組は参加者がフィールドアスレチックに挑戦し, 見事攻略すれば賞金をもらえるというものである. </p> <p> フィールドアスレチックは高さが異なるブロックを一列に並べて作られていて, 攻略のためにはいかにして段差を登り降りするかが重要になる (図1). この番組に参加することになったあなたの友人は, フィールドアスレチックの構造が与えられたときに, 登らなければならない最大...
5 5 10 70 30 50 90 2 20 100 2 100 30 3 50 50 50 7 123 45 678 901 234 567 890
60 40 80 0 0 70 0 0 633 667
25,912
s189661226
p01223
u260980560
1400931920
Python
Python
py
Accepted
20
4220
200
for t in xrange(input()): up = 0; down = 0; n = input() h = map(int, raw_input().split()) print max([0]+[h[i+1]-h[i] for i in xrange(n-1)]), max([0]+[h[i]-h[i+1] for i in xrange(n-1)])
p01223
<h1><font color="#000">Problem A:</font>サイゾウ</h1> <p> ある国で「サイゾウ」というテレビ番組が流行している. この番組は参加者がフィールドアスレチックに挑戦し, 見事攻略すれば賞金をもらえるというものである. </p> <p> フィールドアスレチックは高さが異なるブロックを一列に並べて作られていて, 攻略のためにはいかにして段差を登り降りするかが重要になる (図1). この番組に参加することになったあなたの友人は, フィールドアスレチックの構造が与えられたときに, 登らなければならない最大...
5 5 10 70 30 50 90 2 20 100 2 100 30 3 50 50 50 7 123 45 678 901 234 567 890
60 40 80 0 0 70 0 0 633 667
25,913
s318795629
p01223
u260980560
1400932105
Python
Python
py
Accepted
10
4224
182
for t in xrange(input()): n = input() h = map(int, raw_input().split()) print max(0, max(h[i+1]-h[i] for i in xrange(n-1))), max(0, max(h[i]-h[i+1] for i in xrange(n-1)))
p01223
<h1><font color="#000">Problem A:</font>サイゾウ</h1> <p> ある国で「サイゾウ」というテレビ番組が流行している. この番組は参加者がフィールドアスレチックに挑戦し, 見事攻略すれば賞金をもらえるというものである. </p> <p> フィールドアスレチックは高さが異なるブロックを一列に並べて作られていて, 攻略のためにはいかにして段差を登り降りするかが重要になる (図1). この番組に参加することになったあなたの友人は, フィールドアスレチックの構造が与えられたときに, 登らなければならない最大...
5 5 10 70 30 50 90 2 20 100 2 100 30 3 50 50 50 7 123 45 678 901 234 567 890
60 40 80 0 0 70 0 0 633 667
25,914
s667789600
p01223
u240091169
1591263531
Python
Python3
py
Accepted
30
5608
331
n = int(input()) for i in range(n) : max_up = 0 max_down = 0 m = int(input()) dansa = list(map(int, input().split())) for j in range(len(dansa)-1) : x = dansa[j+1] - dansa[j] if x > max_up : max_up = x if -x > max_down : max_down = -x print(max_up,...
p01223
<h1><font color="#000">Problem A:</font>サイゾウ</h1> <p> ある国で「サイゾウ」というテレビ番組が流行している. この番組は参加者がフィールドアスレチックに挑戦し, 見事攻略すれば賞金をもらえるというものである. </p> <p> フィールドアスレチックは高さが異なるブロックを一列に並べて作られていて, 攻略のためにはいかにして段差を登り降りするかが重要になる (図1). この番組に参加することになったあなたの友人は, フィールドアスレチックの構造が与えられたときに, 登らなければならない最大...
5 5 10 70 30 50 90 2 20 100 2 100 30 3 50 50 50 7 123 45 678 901 234 567 890
60 40 80 0 0 70 0 0 633 667
25,915
s776136728
p01223
u153447291
1574936990
Python
Python3
py
Accepted
30
5612
358
n = int(input()) for j in range(n): a = int(input()) b = list(map(int,input().split())) hop = [] for i in range(a-1): hop.append(b[i+1]-b[i]) hop.sort(reverse = True) if hop[0] <= 0: print(0,end = " ") else: print(hop[0],end = " ") if hop[-1] >= 0: print(0...
p01223
<h1><font color="#000">Problem A:</font>サイゾウ</h1> <p> ある国で「サイゾウ」というテレビ番組が流行している. この番組は参加者がフィールドアスレチックに挑戦し, 見事攻略すれば賞金をもらえるというものである. </p> <p> フィールドアスレチックは高さが異なるブロックを一列に並べて作られていて, 攻略のためにはいかにして段差を登り降りするかが重要になる (図1). この番組に参加することになったあなたの友人は, フィールドアスレチックの構造が与えられたときに, 登らなければならない最大...
5 5 10 70 30 50 90 2 20 100 2 100 30 3 50 50 50 7 123 45 678 901 234 567 890
60 40 80 0 0 70 0 0 633 667
25,916
s645638815
p01223
u771565914
1571120828
Python
Python3
py
Accepted
30
5608
235
n = int(input()) for _ in range(n): x = int(input()) lst = list(map(int, input().split())) y, z = 0, 0 for j in range(1, x): y = max(y, lst[j]-lst[j-1]) z = min(z, lst[j]-lst[j-1]) print(y, -z)
p01223
<h1><font color="#000">Problem A:</font>サイゾウ</h1> <p> ある国で「サイゾウ」というテレビ番組が流行している. この番組は参加者がフィールドアスレチックに挑戦し, 見事攻略すれば賞金をもらえるというものである. </p> <p> フィールドアスレチックは高さが異なるブロックを一列に並べて作られていて, 攻略のためにはいかにして段差を登り降りするかが重要になる (図1). この番組に参加することになったあなたの友人は, フィールドアスレチックの構造が与えられたときに, 登らなければならない最大...
5 5 10 70 30 50 90 2 20 100 2 100 30 3 50 50 50 7 123 45 678 901 234 567 890
60 40 80 0 0 70 0 0 633 667
25,917
s589538483
p01223
u003684951
1564925246
Python
Python3
py
Accepted
30
5600
219
t = int(input()) for _ in range(t): n = int(input()) lst = list(map(int, input().split())) M = m = 0 for i in range(n - 1): M = max(lst[i + 1] - lst[i], M) m = min(lst[i + 1] - lst[i], m) print(M, -m)
p01223
<h1><font color="#000">Problem A:</font>サイゾウ</h1> <p> ある国で「サイゾウ」というテレビ番組が流行している. この番組は参加者がフィールドアスレチックに挑戦し, 見事攻略すれば賞金をもらえるというものである. </p> <p> フィールドアスレチックは高さが異なるブロックを一列に並べて作られていて, 攻略のためにはいかにして段差を登り降りするかが重要になる (図1). この番組に参加することになったあなたの友人は, フィールドアスレチックの構造が与えられたときに, 登らなければならない最大...
5 5 10 70 30 50 90 2 20 100 2 100 30 3 50 50 50 7 123 45 678 901 234 567 890
60 40 80 0 0 70 0 0 633 667
25,918
s976305486
p01223
u813675766
1564627300
Python
Python3
py
Accepted
30
5612
227
t = int(input()) for i in range(t): n = int(input()) li = [int(x) for x in input().split()] a, b = 0, 0 for j in range(1, n): a = max(a, li[j]-li[j-1]) b = min(b, li[j]-li[j-1]) print(a, -b)
p01223
<h1><font color="#000">Problem A:</font>サイゾウ</h1> <p> ある国で「サイゾウ」というテレビ番組が流行している. この番組は参加者がフィールドアスレチックに挑戦し, 見事攻略すれば賞金をもらえるというものである. </p> <p> フィールドアスレチックは高さが異なるブロックを一列に並べて作られていて, 攻略のためにはいかにして段差を登り降りするかが重要になる (図1). この番組に参加することになったあなたの友人は, フィールドアスレチックの構造が与えられたときに, 登らなければならない最大...
5 5 10 70 30 50 90 2 20 100 2 100 30 3 50 50 50 7 123 45 678 901 234 567 890
60 40 80 0 0 70 0 0 633 667
25,919
s882025375
p01223
u548252256
1561548692
Python
Python3
py
Accepted
30
5608
342
def saizo(A:list): uplen = 0 downlen = 0 num = len(A) for j in range(num-1): tmp = A[j+1] - A[j] if A[j+1] >= A[j]: uplen = max(uplen,tmp) else: downlen = max(downlen,abs(tmp)) print(uplen,downlen) if __name__ == '__main__': n = int(input()) for i in range(n): input() saizo(list(map(int,...
p01223
<h1><font color="#000">Problem A:</font>サイゾウ</h1> <p> ある国で「サイゾウ」というテレビ番組が流行している. この番組は参加者がフィールドアスレチックに挑戦し, 見事攻略すれば賞金をもらえるというものである. </p> <p> フィールドアスレチックは高さが異なるブロックを一列に並べて作られていて, 攻略のためにはいかにして段差を登り降りするかが重要になる (図1). この番組に参加することになったあなたの友人は, フィールドアスレチックの構造が与えられたときに, 登らなければならない最大...
5 5 10 70 30 50 90 2 20 100 2 100 30 3 50 50 50 7 123 45 678 901 234 567 890
60 40 80 0 0 70 0 0 633 667
25,920
s146026146
p01223
u717526540
1545188339
Python
Python3
py
Accepted
30
5604
293
t = int(input()) for _ in range(t): n = int(input()) block = list(map(int, input().split())) diff = [] for i in range(len(block) - 1): d = block[i+1] - block[i] diff.append(d) up = max(0, max(diff)) down = abs(min(0, min(diff))) print(up, down)
p01223
<h1><font color="#000">Problem A:</font>サイゾウ</h1> <p> ある国で「サイゾウ」というテレビ番組が流行している. この番組は参加者がフィールドアスレチックに挑戦し, 見事攻略すれば賞金をもらえるというものである. </p> <p> フィールドアスレチックは高さが異なるブロックを一列に並べて作られていて, 攻略のためにはいかにして段差を登り降りするかが重要になる (図1). この番組に参加することになったあなたの友人は, フィールドアスレチックの構造が与えられたときに, 登らなければならない最大...
5 5 10 70 30 50 90 2 20 100 2 100 30 3 50 50 50 7 123 45 678 901 234 567 890
60 40 80 0 0 70 0 0 633 667
25,921
s851323413
p01224
u260980560
1430327318
Python
Python
py
Accepted
40
4228
490
P = "perfect number" D = "deficient number" A = "abundant number" while True: n = int(raw_input()) if n==0: break if n==1: print D continue su = 1 t = n i = 2 while i**2<=t: if t%i==0: cnt = 0 while t%i==0: t /= i ...
p01224
<h1><font color="#000">Problem B:</font> 完全数</h1> <p> ある整数 <var>N</var> に対し,その数自身を除く約数の和を <var>S</var> とする. <var>N</var> = <var>S</var> のとき <var>N</var> は完全数 (perfect number), <var>N</var> &gt; <var>S</var> のとき <var>N</var> は不足数 (deficient number), <var>N</var> &lt; <var>S</var> のとき ...
1 2 3 4 6 12 16 28 33550336 99999998 99999999 100000000 0
deficient number deficient number deficient number deficient number perfect number abundant number deficient number perfect number perfect number deficient number deficient number abundant number
25,922
s608389837
p01224
u633068244
1398506337
Python
Python
py
Accepted
50
4244
408
def div(n): ls = [] i = 2 while i*i <= n: c = 0 if n%i==0: while n%i==0: n /= i c += 1 if c > 0: ls.append([i,c]) i += 1 if n > 1: ls.append([n,1]) ans = 1 for b,p in ls: ans *= (b**(p+1)-1)/(b-1) return ans while 1: n = input() if n == 0: break d = div(n) - n if d == n: print "...
p01224
<h1><font color="#000">Problem B:</font> 完全数</h1> <p> ある整数 <var>N</var> に対し,その数自身を除く約数の和を <var>S</var> とする. <var>N</var> = <var>S</var> のとき <var>N</var> は完全数 (perfect number), <var>N</var> &gt; <var>S</var> のとき <var>N</var> は不足数 (deficient number), <var>N</var> &lt; <var>S</var> のとき ...
1 2 3 4 6 12 16 28 33550336 99999998 99999999 100000000 0
deficient number deficient number deficient number deficient number perfect number abundant number deficient number perfect number perfect number deficient number deficient number abundant number
25,923
s116268856
p01224
u633068244
1398506634
Python
Python
py
Accepted
40
4224
354
def SumOfDiv(n): i = 2 ans = 1 while i*i <= n: c = 0 while n%i==0: n /= i c += 1 if c > 0: ans *= (i**(c+1)-1)/(i-1) i += 1 if n > 1: ans *= (1+n) return ans while 1: n = input() if n == 0: break d = SumOfDiv(n) - n if d == n: print "perfect number" elif d < n: print "deficient number...
p01224
<h1><font color="#000">Problem B:</font> 完全数</h1> <p> ある整数 <var>N</var> に対し,その数自身を除く約数の和を <var>S</var> とする. <var>N</var> = <var>S</var> のとき <var>N</var> は完全数 (perfect number), <var>N</var> &gt; <var>S</var> のとき <var>N</var> は不足数 (deficient number), <var>N</var> &lt; <var>S</var> のとき ...
1 2 3 4 6 12 16 28 33550336 99999998 99999999 100000000 0
deficient number deficient number deficient number deficient number perfect number abundant number deficient number perfect number perfect number deficient number deficient number abundant number
25,924
s178419361
p01224
u548252256
1561549229
Python
Python3
py
Accepted
80
5652
445
def make_division(n:int): divisors = [] for i in range(1,int(n**0.5)+1): if n % i == 0: divisors.append(i) if i != n // i: divisors.append(n//i) divisors.sort() divisors.pop(-1) return sum(divisors) if __name__ == '__main__': while True: n = int(input()) if n == 0: break m = make_division(...
p01224
<h1><font color="#000">Problem B:</font> 完全数</h1> <p> ある整数 <var>N</var> に対し,その数自身を除く約数の和を <var>S</var> とする. <var>N</var> = <var>S</var> のとき <var>N</var> は完全数 (perfect number), <var>N</var> &gt; <var>S</var> のとき <var>N</var> は不足数 (deficient number), <var>N</var> &lt; <var>S</var> のとき ...
1 2 3 4 6 12 16 28 33550336 99999998 99999999 100000000 0
deficient number deficient number deficient number deficient number perfect number abundant number deficient number perfect number perfect number deficient number deficient number abundant number
25,925
s446910497
p01224
u539753516
1534142789
Python
Python3
py
Accepted
100
5584
380
while 1: m=n=int(input()) if n==0:break i=2 a=1 while i*i<=n: c=0 while n%i==0: n//=i c+=1 if c: a*=(i**(c+1)-1)//(i-1) i+=1 if n>1: a*=1+n if a==2*m: print("perfect number") elif a<2*m: print("de...
p01224
<h1><font color="#000">Problem B:</font> 完全数</h1> <p> ある整数 <var>N</var> に対し,その数自身を除く約数の和を <var>S</var> とする. <var>N</var> = <var>S</var> のとき <var>N</var> は完全数 (perfect number), <var>N</var> &gt; <var>S</var> のとき <var>N</var> は不足数 (deficient number), <var>N</var> &lt; <var>S</var> のとき ...
1 2 3 4 6 12 16 28 33550336 99999998 99999999 100000000 0
deficient number deficient number deficient number deficient number perfect number abundant number deficient number perfect number perfect number deficient number deficient number abundant number
25,926
s373329471
p01225
u352394527
1545353585
Python
Python3
py
Accepted
30
5604
644
def judge(nums): if nums == []: return True ret = False m = nums[0] if nums.count(m) == 3: ret = ret or judge(nums[3:]) if m in nums and m + 1 in nums and m + 2 in nums: new_nums = nums[:] new_nums.remove(m) new_nums.remove(m + 1) new_nums.remove(m + 2) ret = ret or judge(new_nums)...
p01225
<h1><font color="#000">Problem C:</font> ラミー</h1> <p> あなたの友達は最近 UT-Rummy というカードゲームを思いついた. </p> <p> このゲームで使うカードには赤・緑・青のいずれかの色と1から9までのいずれかの番号が つけられている. このゲームのプレイヤーはそれぞれ9枚の手札を持ち, 自分のターンに手札から1枚選んで捨てて, 代わりに山札から1枚引いてくるということを繰り返す. このように順番にターンを進めていき, 最初に手持ちのカードに3枚ずつ3つの「セット」を作ったプレイヤー...
5 1 2 3 3 4 5 7 7 7 R R R R R R G G G 1 2 2 3 4 4 4 4 5 R R R R R R R R R 1 2 3 4 4 4 5 5 5 R R B R R R R R R 1 1 1 3 4 5 6 6 6 R R B G G G R R R 2 2 2 3 3 3 1 1 1 R G B R G B R G B
1 0 0 0 1
25,927
s870449125
p01225
u104171359
1487559127
Python
Python3
py
Accepted
30
7804
2,057
#!usr/bin/env python3 import sys def main(): WINNING_HANDS = [ '111', '222', '333', '444', '555', '666', '777', '888', '999', '123', '234', '345', '456', '567', '678', '789' ] num_of_datasets = int(sys.stdin.readline().strip('\n')) datasets = [{'R': [], 'G': [...
p01225
<h1><font color="#000">Problem C:</font> ラミー</h1> <p> あなたの友達は最近 UT-Rummy というカードゲームを思いついた. </p> <p> このゲームで使うカードには赤・緑・青のいずれかの色と1から9までのいずれかの番号が つけられている. このゲームのプレイヤーはそれぞれ9枚の手札を持ち, 自分のターンに手札から1枚選んで捨てて, 代わりに山札から1枚引いてくるということを繰り返す. このように順番にターンを進めていき, 最初に手持ちのカードに3枚ずつ3つの「セット」を作ったプレイヤー...
5 1 2 3 3 4 5 7 7 7 R R R R R R G G G 1 2 2 3 4 4 4 4 5 R R R R R R R R R 1 2 3 4 4 4 5 5 5 R R B R R R R R R 1 1 1 3 4 5 6 6 6 R R B G G G R R R 2 2 2 3 3 3 1 1 1 R G B R G B R G B
1 0 0 0 1
25,928
s888981865
p01225
u104171359
1487559584
Python
Python3
py
Accepted
30
7740
2,070
#!usr/bin/env python3 import sys def main(): WINNING_HANDS = [ '111', '222', '333', '444', '555', '666', '777', '888', '999', '123', '234', '345', '456', '567', '678', '789' ] num_of_datasets = int(sys.stdin.readline().strip('\n')) datasets = [{'R': [], 'G...
p01225
<h1><font color="#000">Problem C:</font> ラミー</h1> <p> あなたの友達は最近 UT-Rummy というカードゲームを思いついた. </p> <p> このゲームで使うカードには赤・緑・青のいずれかの色と1から9までのいずれかの番号が つけられている. このゲームのプレイヤーはそれぞれ9枚の手札を持ち, 自分のターンに手札から1枚選んで捨てて, 代わりに山札から1枚引いてくるということを繰り返す. このように順番にターンを進めていき, 最初に手持ちのカードに3枚ずつ3つの「セット」を作ったプレイヤー...
5 1 2 3 3 4 5 7 7 7 R R R R R R G G G 1 2 2 3 4 4 4 4 5 R R R R R R R R R 1 2 3 4 4 4 5 5 5 R R B R R R R R R 1 1 1 3 4 5 6 6 6 R R B G G G R R R 2 2 2 3 3 3 1 1 1 R G B R G B R G B
1 0 0 0 1
25,929
s023985785
p01225
u104171359
1487559702
Python
Python3
py
Accepted
30
7784
2,054
#!usr/bin/env python3 import sys def main(): WINNING_HANDS = [ '111', '222', '333', '444', '555', '666', '777', '888', '999', '123', '234', '345', '456', '567', '678', '789' ] num_of_datasets = int(sys.stdin.readline().strip('\n')) datasets = [{'R': [], 'G': [...
p01225
<h1><font color="#000">Problem C:</font> ラミー</h1> <p> あなたの友達は最近 UT-Rummy というカードゲームを思いついた. </p> <p> このゲームで使うカードには赤・緑・青のいずれかの色と1から9までのいずれかの番号が つけられている. このゲームのプレイヤーはそれぞれ9枚の手札を持ち, 自分のターンに手札から1枚選んで捨てて, 代わりに山札から1枚引いてくるということを繰り返す. このように順番にターンを進めていき, 最初に手持ちのカードに3枚ずつ3つの「セット」を作ったプレイヤー...
5 1 2 3 3 4 5 7 7 7 R R R R R R G G G 1 2 2 3 4 4 4 4 5 R R R R R R R R R 1 2 3 4 4 4 5 5 5 R R B R R R R R R 1 1 1 3 4 5 6 6 6 R R B G G G R R R 2 2 2 3 3 3 1 1 1 R G B R G B R G B
1 0 0 0 1
25,930
s149145846
p01225
u104171359
1487560371
Python
Python3
py
Accepted
30
7688
2,153
#!usr/bin/env python3 import sys def main(): WINNING_HANDS = [ '111', '222', '333', '444', '555', '666', '777', '888', '999', '123', '234', '345', '456', '567', '678', '789' ] num_of_datasets = int(sys.stdin.readline().strip('\n')) datasets = [{'R': [], 'G': [...
p01225
<h1><font color="#000">Problem C:</font> ラミー</h1> <p> あなたの友達は最近 UT-Rummy というカードゲームを思いついた. </p> <p> このゲームで使うカードには赤・緑・青のいずれかの色と1から9までのいずれかの番号が つけられている. このゲームのプレイヤーはそれぞれ9枚の手札を持ち, 自分のターンに手札から1枚選んで捨てて, 代わりに山札から1枚引いてくるということを繰り返す. このように順番にターンを進めていき, 最初に手持ちのカードに3枚ずつ3つの「セット」を作ったプレイヤー...
5 1 2 3 3 4 5 7 7 7 R R R R R R G G G 1 2 2 3 4 4 4 4 5 R R R R R R R R R 1 2 3 4 4 4 5 5 5 R R B R R R R R R 1 1 1 3 4 5 6 6 6 R R B G G G R R R 2 2 2 3 3 3 1 1 1 R G B R G B R G B
1 0 0 0 1
25,931
s674013433
p01225
u104171359
1487561775
Python
Python3
py
Accepted
30
7764
2,141
#!usr/bin/env python3 import sys def main(): WINNING_HANDS = [ '111', '222', '333', '444', '555', '666', '777', '888', '999', '123', '234', '345', '456', '567', '678', '789' ] num_of_datasets = int(sys.stdin.readline().strip('\n')) datasets = [{'R': [], 'G': [...
p01225
<h1><font color="#000">Problem C:</font> ラミー</h1> <p> あなたの友達は最近 UT-Rummy というカードゲームを思いついた. </p> <p> このゲームで使うカードには赤・緑・青のいずれかの色と1から9までのいずれかの番号が つけられている. このゲームのプレイヤーはそれぞれ9枚の手札を持ち, 自分のターンに手札から1枚選んで捨てて, 代わりに山札から1枚引いてくるということを繰り返す. このように順番にターンを進めていき, 最初に手持ちのカードに3枚ずつ3つの「セット」を作ったプレイヤー...
5 1 2 3 3 4 5 7 7 7 R R R R R R G G G 1 2 2 3 4 4 4 4 5 R R R R R R R R R 1 2 3 4 4 4 5 5 5 R R B R R R R R R 1 1 1 3 4 5 6 6 6 R R B G G G R R R 2 2 2 3 3 3 1 1 1 R G B R G B R G B
1 0 0 0 1
25,932
s977774545
p01225
u371539389
1492849055
Python
Python3
py
Accepted
30
7772
890
def check(card_set): for i in card_set: if len(i)%3!=0: return 0 i.sort() for j in range(int(len(i)/3)): if i.count(i[0])>=3: a=i[0] i.remove(a) i.remove(a) i.remove(a) else: a...
p01225
<h1><font color="#000">Problem C:</font> ラミー</h1> <p> あなたの友達は最近 UT-Rummy というカードゲームを思いついた. </p> <p> このゲームで使うカードには赤・緑・青のいずれかの色と1から9までのいずれかの番号が つけられている. このゲームのプレイヤーはそれぞれ9枚の手札を持ち, 自分のターンに手札から1枚選んで捨てて, 代わりに山札から1枚引いてくるということを繰り返す. このように順番にターンを進めていき, 最初に手持ちのカードに3枚ずつ3つの「セット」を作ったプレイヤー...
5 1 2 3 3 4 5 7 7 7 R R R R R R G G G 1 2 2 3 4 4 4 4 5 R R R R R R R R R 1 2 3 4 4 4 5 5 5 R R B R R R R R R 1 1 1 3 4 5 6 6 6 R R B G G G R R R 2 2 2 3 3 3 1 1 1 R G B R G B R G B
1 0 0 0 1
25,933
s590858781
p01225
u659034691
1503635089
Python
Python3
py
Accepted
30
7744
1,758
# your code goes here #rummy T=int(input()) for i in range(T): n=[int(i) for i in input().split()] c=[i for i in input().split()] R=[[],[],[]] for i in range(9): if c[i]=="R": R[0].append(n[i]) elif c[i]=="G": R[1].append(n[i]) else: R...
p01225
<h1><font color="#000">Problem C:</font> ラミー</h1> <p> あなたの友達は最近 UT-Rummy というカードゲームを思いついた. </p> <p> このゲームで使うカードには赤・緑・青のいずれかの色と1から9までのいずれかの番号が つけられている. このゲームのプレイヤーはそれぞれ9枚の手札を持ち, 自分のターンに手札から1枚選んで捨てて, 代わりに山札から1枚引いてくるということを繰り返す. このように順番にターンを進めていき, 最初に手持ちのカードに3枚ずつ3つの「セット」を作ったプレイヤー...
5 1 2 3 3 4 5 7 7 7 R R R R R R G G G 1 2 2 3 4 4 4 4 5 R R R R R R R R R 1 2 3 4 4 4 5 5 5 R R B R R R R R R 1 1 1 3 4 5 6 6 6 R R B G G G R R R 2 2 2 3 3 3 1 1 1 R G B R G B R G B
1 0 0 0 1
25,934
s624416341
p01225
u886729200
1523281836
Python
Python3
py
Accepted
20
5624
1,729
T=int(input()) for i in range(T): n=[int(i) for i in input().split()] c=[i for i in input().split()] R=[[],[],[]] for i in range(9): if c[i]=="R": R[0].append(n[i]) elif c[i]=="G": R[1].append(n[i]) else: R[2].append(n[i]) y=1 i...
p01225
<h1><font color="#000">Problem C:</font> ラミー</h1> <p> あなたの友達は最近 UT-Rummy というカードゲームを思いついた. </p> <p> このゲームで使うカードには赤・緑・青のいずれかの色と1から9までのいずれかの番号が つけられている. このゲームのプレイヤーはそれぞれ9枚の手札を持ち, 自分のターンに手札から1枚選んで捨てて, 代わりに山札から1枚引いてくるということを繰り返す. このように順番にターンを進めていき, 最初に手持ちのカードに3枚ずつ3つの「セット」を作ったプレイヤー...
5 1 2 3 3 4 5 7 7 7 R R R R R R G G G 1 2 2 3 4 4 4 4 5 R R R R R R R R R 1 2 3 4 4 4 5 5 5 R R B R R R R R R 1 1 1 3 4 5 6 6 6 R R B G G G R R R 2 2 2 3 3 3 1 1 1 R G B R G B R G B
1 0 0 0 1
25,935
s405435366
p01225
u886729200
1523322239
Python
Python3
py
Accepted
20
5632
2,513
T = int(input()) for i in range(T): n = [int(i) for i in input().split()] c = [i for i in input().split()] value = [[],[],[]] for j in range(9): if c[j] == "R": value[0].append(n[j]) elif c[j] == "G": value[1].append(n[j]) else: value[2].append...
p01225
<h1><font color="#000">Problem C:</font> ラミー</h1> <p> あなたの友達は最近 UT-Rummy というカードゲームを思いついた. </p> <p> このゲームで使うカードには赤・緑・青のいずれかの色と1から9までのいずれかの番号が つけられている. このゲームのプレイヤーはそれぞれ9枚の手札を持ち, 自分のターンに手札から1枚選んで捨てて, 代わりに山札から1枚引いてくるということを繰り返す. このように順番にターンを進めていき, 最初に手持ちのカードに3枚ずつ3つの「セット」を作ったプレイヤー...
5 1 2 3 3 4 5 7 7 7 R R R R R R G G G 1 2 2 3 4 4 4 4 5 R R R R R R R R R 1 2 3 4 4 4 5 5 5 R R B R R R R R R 1 1 1 3 4 5 6 6 6 R R B G G G R R R 2 2 2 3 3 3 1 1 1 R G B R G B R G B
1 0 0 0 1
25,936
s616347191
p01225
u584093205
1526737054
Python
Python3
py
Accepted
30
5600
883
T = int(input()) for i in range(T): num = list(map(int, input().split())) coler = input().split() groups = [[], [], []] for i, c in enumerate(coler): if c == "R": groups[0].append(num[i]) elif c == "G": groups[1].append(num[i]) else: groups[2]....
p01225
<h1><font color="#000">Problem C:</font> ラミー</h1> <p> あなたの友達は最近 UT-Rummy というカードゲームを思いついた. </p> <p> このゲームで使うカードには赤・緑・青のいずれかの色と1から9までのいずれかの番号が つけられている. このゲームのプレイヤーはそれぞれ9枚の手札を持ち, 自分のターンに手札から1枚選んで捨てて, 代わりに山札から1枚引いてくるということを繰り返す. このように順番にターンを進めていき, 最初に手持ちのカードに3枚ずつ3つの「セット」を作ったプレイヤー...
5 1 2 3 3 4 5 7 7 7 R R R R R R G G G 1 2 2 3 4 4 4 4 5 R R R R R R R R R 1 2 3 4 4 4 5 5 5 R R B R R R R R R 1 1 1 3 4 5 6 6 6 R R B G G G R R R 2 2 2 3 3 3 1 1 1 R G B R G B R G B
1 0 0 0 1
25,937
s160354480
p01225
u724548524
1527726124
Python
Python3
py
Accepted
20
5612
485
for _ in range(int(input())): n, c = map(int, input().split()), input().split() c = list(zip(c, n)) c.sort(key = lambda x:x[1]) c.sort(key = lambda x:x[0]) while c != []: if c[-1] == c[-2] == c[-3]: c = c[:-3] elif (c[-1][0], c[-1][1] -1) in c and (c[-1][0], c[-1][1] -2) ...
p01225
<h1><font color="#000">Problem C:</font> ラミー</h1> <p> あなたの友達は最近 UT-Rummy というカードゲームを思いついた. </p> <p> このゲームで使うカードには赤・緑・青のいずれかの色と1から9までのいずれかの番号が つけられている. このゲームのプレイヤーはそれぞれ9枚の手札を持ち, 自分のターンに手札から1枚選んで捨てて, 代わりに山札から1枚引いてくるということを繰り返す. このように順番にターンを進めていき, 最初に手持ちのカードに3枚ずつ3つの「セット」を作ったプレイヤー...
5 1 2 3 3 4 5 7 7 7 R R R R R R G G G 1 2 2 3 4 4 4 4 5 R R R R R R R R R 1 2 3 4 4 4 5 5 5 R R B R R R R R R 1 1 1 3 4 5 6 6 6 R R B G G G R R R 2 2 2 3 3 3 1 1 1 R G B R G B R G B
1 0 0 0 1
25,938
s332321375
p01225
u316584871
1529858047
Python
Python3
py
Accepted
20
5604
1,246
n = int(input()) def check(nl): fl = list(nl) for w in range(len(nl)): if (fl[w] in nl): i = fl[w] if ((i+1 in nl) and (i+2 in nl)): for k in range(i,i+3): nl.remove(k) elif(nl.count(i)%3 == 0): for k in range(nl.cou...
p01225
<h1><font color="#000">Problem C:</font> ラミー</h1> <p> あなたの友達は最近 UT-Rummy というカードゲームを思いついた. </p> <p> このゲームで使うカードには赤・緑・青のいずれかの色と1から9までのいずれかの番号が つけられている. このゲームのプレイヤーはそれぞれ9枚の手札を持ち, 自分のターンに手札から1枚選んで捨てて, 代わりに山札から1枚引いてくるということを繰り返す. このように順番にターンを進めていき, 最初に手持ちのカードに3枚ずつ3つの「セット」を作ったプレイヤー...
5 1 2 3 3 4 5 7 7 7 R R R R R R G G G 1 2 2 3 4 4 4 4 5 R R R R R R R R R 1 2 3 4 4 4 5 5 5 R R B R R R R R R 1 1 1 3 4 5 6 6 6 R R B G G G R R R 2 2 2 3 3 3 1 1 1 R G B R G B R G B
1 0 0 0 1
25,939
s787475387
p01225
u633068244
1399713103
Python
Python
py
Accepted
20
4280
709
def rm_123(A): if len(A) == 0: return 1 for a in set(A): if set([a,a+1,a+2]) <= set(A): if len(A) == 3: return 1 A1 = A[:] for i in range(3): A1.remove(a+i) return judge(A1) def rm_111(A): if len(A) == 0: return 1 for a in set(A): if A.count(a) >= 3: if len(A) == 3: return 1 A1 = A[:] for ...
p01225
<h1><font color="#000">Problem C:</font> ラミー</h1> <p> あなたの友達は最近 UT-Rummy というカードゲームを思いついた. </p> <p> このゲームで使うカードには赤・緑・青のいずれかの色と1から9までのいずれかの番号が つけられている. このゲームのプレイヤーはそれぞれ9枚の手札を持ち, 自分のターンに手札から1枚選んで捨てて, 代わりに山札から1枚引いてくるということを繰り返す. このように順番にターンを進めていき, 最初に手持ちのカードに3枚ずつ3つの「セット」を作ったプレイヤー...
5 1 2 3 3 4 5 7 7 7 R R R R R R G G G 1 2 2 3 4 4 4 4 5 R R R R R R R R R 1 2 3 4 4 4 5 5 5 R R B R R R R R R 1 1 1 3 4 5 6 6 6 R R B G G G R R R 2 2 2 3 3 3 1 1 1 R G B R G B R G B
1 0 0 0 1
25,940
s286757113
p01225
u633068244
1399713280
Python
Python
py
Accepted
10
4276
653
def rm_123(A): if len(A) == 0: return 1 for a in set(A): if set([a,a+1,a+2]) <= set(A): A1 = A[:] for i in range(3): A1.remove(a+i) return judge(A1) def rm_111(A): if len(A) == 0: return 1 for a in set(A): if A.count(a) >= 3: A1 = A[:] for i in range(3): A1.remove(a) return judge(A1) def jud...
p01225
<h1><font color="#000">Problem C:</font> ラミー</h1> <p> あなたの友達は最近 UT-Rummy というカードゲームを思いついた. </p> <p> このゲームで使うカードには赤・緑・青のいずれかの色と1から9までのいずれかの番号が つけられている. このゲームのプレイヤーはそれぞれ9枚の手札を持ち, 自分のターンに手札から1枚選んで捨てて, 代わりに山札から1枚引いてくるということを繰り返す. このように順番にターンを進めていき, 最初に手持ちのカードに3枚ずつ3つの「セット」を作ったプレイヤー...
5 1 2 3 3 4 5 7 7 7 R R R R R R G G G 1 2 2 3 4 4 4 4 5 R R R R R R R R R 1 2 3 4 4 4 5 5 5 R R B R R R R R R 1 1 1 3 4 5 6 6 6 R R B G G G R R R 2 2 2 3 3 3 1 1 1 R G B R G B R G B
1 0 0 0 1
25,941
s976855607
p01225
u633068244
1399713413
Python
Python
py
Accepted
20
4268
615
def rm_123(A): for a in set(A): if set([a,a+1,a+2]) <= set(A): A1 = A[:] for i in range(3): A1.remove(a+i) return judge(A1) def rm_111(A): for a in set(A): if A.count(a) >= 3: A1 = A[:] for i in range(3): A1.remove(a) return judge(A1) def judge(A): return len(A) == 0 or rm_123(A) or rm_111(A)...
p01225
<h1><font color="#000">Problem C:</font> ラミー</h1> <p> あなたの友達は最近 UT-Rummy というカードゲームを思いついた. </p> <p> このゲームで使うカードには赤・緑・青のいずれかの色と1から9までのいずれかの番号が つけられている. このゲームのプレイヤーはそれぞれ9枚の手札を持ち, 自分のターンに手札から1枚選んで捨てて, 代わりに山札から1枚引いてくるということを繰り返す. このように順番にターンを進めていき, 最初に手持ちのカードに3枚ずつ3つの「セット」を作ったプレイヤー...
5 1 2 3 3 4 5 7 7 7 R R R R R R G G G 1 2 2 3 4 4 4 4 5 R R R R R R R R R 1 2 3 4 4 4 5 5 5 R R B R R R R R R 1 1 1 3 4 5 6 6 6 R R B G G G R R R 2 2 2 3 3 3 1 1 1 R G B R G B R G B
1 0 0 0 1
25,942
s062235125
p01225
u240091169
1591324689
Python
Python3
py
Accepted
20
5616
1,271
def Check(A) : Set = 0 if len(A) < 3 : return False else : a = 0 while True : if a >= len(A)-2 : break if A[a] == A[a+1] and A[a] == A[a+2] : Set += 1 youso = A[a] A.remove(youso) ...
p01225
<h1><font color="#000">Problem C:</font> ラミー</h1> <p> あなたの友達は最近 UT-Rummy というカードゲームを思いついた. </p> <p> このゲームで使うカードには赤・緑・青のいずれかの色と1から9までのいずれかの番号が つけられている. このゲームのプレイヤーはそれぞれ9枚の手札を持ち, 自分のターンに手札から1枚選んで捨てて, 代わりに山札から1枚引いてくるということを繰り返す. このように順番にターンを進めていき, 最初に手持ちのカードに3枚ずつ3つの「セット」を作ったプレイヤー...
5 1 2 3 3 4 5 7 7 7 R R R R R R G G G 1 2 2 3 4 4 4 4 5 R R R R R R R R R 1 2 3 4 4 4 5 5 5 R R B R R R R R R 1 1 1 3 4 5 6 6 6 R R B G G G R R R 2 2 2 3 3 3 1 1 1 R G B R G B R G B
1 0 0 0 1
25,943