結果
| 問題 |
No.769 UNOシミュレータ
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2022-01-19 20:28:08 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
AC
|
| 実行時間 | 214 ms / 2,000 ms |
| コード長 | 567 bytes |
| コンパイル時間 | 257 ms |
| コンパイル使用メモリ | 82,560 KB |
| 実行使用メモリ | 77,320 KB |
| 最終ジャッジ日時 | 2024-11-23 14:02:48 |
| 合計ジャッジ時間 | 3,739 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 23 |
ソースコード
n, m = map(int, input().split())
i = 0
t = 1
bef = "_"
have = [0] * n
cnt = 0
for j in range(m):
l = input()
if l != bef and bef[0] == "d":
if bef[4] == "t":
have[i] -= 2 * cnt
else:
have[i] -= 4 * cnt
cnt = 0
i += t
i %= n
have[i] += 1
if j == m - 1:
break
if l[0] == "s":
i += 2 * t
elif l[0] == "r":
t *= -1
i += t
elif l[0] == "d":
i += t
cnt += 1
else:
i += t
i %= n
bef = l
print(i + 1, have[i])