結果
問題 | No.769 UNOシミュレータ |
ユーザー |
![]() |
提出日時 | 2023-01-25 12:44:00 |
言語 | PyPy3 (7.3.15) |
結果 |
AC
|
実行時間 | 226 ms / 2,000 ms |
コード長 | 1,124 bytes |
コンパイル時間 | 1,895 ms |
コンパイル使用メモリ | 82,176 KB |
実行使用メモリ | 77,508 KB |
最終ジャッジ日時 | 2024-06-26 17:44:49 |
合計ジャッジ時間 | 4,992 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 23 |
ソースコード
N, M = map(int, input().split())now = 0dr = 1L = [0] * Ncnt2, cnt4 = 0, 0for i in range(M):c = input()if cnt2:if c == "drawtwo":L[now] += 1cnt2 += 2if i == M - 1:now += 1else:now += drnow %= Ncontinueelse:L[now] -= cnt2cnt2 = 0now += drnow %= Nif cnt4:if c == "drawfour":L[now] += 1cnt4 += 4if i == M - 1:now += 1else:now += drnow %= Ncontinueelse:L[now] -= cnt4cnt4 = 0now += drnow %= NL[now] += 1if c == "number":passelif c == "drawtwo":cnt2 += 2elif c == "drawfour":cnt4 += 4elif c == "skip" and i != M - 1:now += drnow %= Nelse:dr *= -1if i == M - 1:now += 1else:now += drnow %= Nprint(now, L[now - 1])