結果
| 問題 |
No.769 UNOシミュレータ
|
| コンテスト | |
| ユーザー |
URechaRecha
|
| 提出日時 | 2019-09-09 13:16:04 |
| 言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 1,318 bytes |
| コンパイル時間 | 203 ms |
| コンパイル使用メモリ | 12,800 KB |
| 実行使用メモリ | 29,824 KB |
| 最終ジャッジ日時 | 2024-11-22 09:26:56 |
| 合計ジャッジ時間 | 7,426 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 2 WA * 21 |
ソースコード
def main():
n,m = map(int,input().split())
players =[0]*n
log =[]
d2,d4=0,0
for i in range(m):
c = input()
if d2:
if c !='drawtwo':
d2 =0
log += ['pass2']
log += [c]
continue
if d4:
if c !='drawfour':
d4 =0
log += ['pass4']
log += [c]
continue
if c == 'drawtwo':
d2 =1
elif c=='drawfour':
d4=1
log += [c]
#print(log)
t = -1
r,d2,d4=0,0,0
def next_t(t,n,r):
if r:
t-=1
if t<0:
t = n+t
else:
t +=1
t%=n
return t
for i in range(len(log)):
t = next_t(t,n,r)
c = log[i]
#print('players:{} t:{} r:{} cmd:{}'.format(players,t,r,c))
players[t] +=1
if c =='drawfour':
d4 +=1
elif c =='drawtwo':
d2 +=1
elif c =='skip':
t = next_t(t,n,r)
elif c == 'reverse':
r+=1
r%=2
elif c =='pass2':
players[t] -=d2*2
d2 =0
elif c == 'pass4':
players[t] -=d4*4
d4 =0
print('{} {}'.format(t+1,players[t]))
main()
URechaRecha