結果
問題 | No.769 UNOシミュレータ |
ユーザー | iad_2889 |
提出日時 | 2019-05-09 19:15:20 |
言語 | Python3 (3.12.2 + numpy 1.26.4 + scipy 1.12.0) |
結果 |
AC
|
実行時間 | 941 ms / 2,000 ms |
コード長 | 1,198 bytes |
コンパイル時間 | 427 ms |
コンパイル使用メモリ | 12,800 KB |
実行使用メモリ | 36,864 KB |
最終ジャッジ日時 | 2024-11-22 09:19:24 |
合計ジャッジ時間 | 8,500 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge3 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 31 ms
10,752 KB |
testcase_01 | AC | 31 ms
10,752 KB |
testcase_02 | AC | 32 ms
10,752 KB |
testcase_03 | AC | 33 ms
10,752 KB |
testcase_04 | AC | 35 ms
10,752 KB |
testcase_05 | AC | 34 ms
10,624 KB |
testcase_06 | AC | 35 ms
10,752 KB |
testcase_07 | AC | 34 ms
10,624 KB |
testcase_08 | AC | 34 ms
10,752 KB |
testcase_09 | AC | 69 ms
11,392 KB |
testcase_10 | AC | 62 ms
11,392 KB |
testcase_11 | AC | 60 ms
11,264 KB |
testcase_12 | AC | 311 ms
17,280 KB |
testcase_13 | AC | 310 ms
17,280 KB |
testcase_14 | AC | 313 ms
17,152 KB |
testcase_15 | AC | 616 ms
26,624 KB |
testcase_16 | AC | 609 ms
26,624 KB |
testcase_17 | AC | 605 ms
26,496 KB |
testcase_18 | AC | 903 ms
36,864 KB |
testcase_19 | AC | 941 ms
36,608 KB |
testcase_20 | AC | 938 ms
36,736 KB |
testcase_21 | AC | 915 ms
36,864 KB |
testcase_22 | AC | 31 ms
10,496 KB |
ソースコード
def get_next(N): def _(current,reverse): if current == None: return 0 if reverse: next = current - 1 if next < 0: next-=N else: next = current + 1 return next % N return _ N,M = map(int,input().split()) log = [input() for x in range(M)] players = [[0,0] for x in range(N)] g_next = get_next(N) current = None reverse = False d_two = 0 d_four = 0 skipper = -1 for card in log: current = g_next(current,reverse) if d_two: if card != "drawtwo": players[current][1]+=d_two*2 current = g_next(current,reverse) d_two = 0 elif d_four: if card != "drawfour": players[current][1]+=d_four*4 current = g_next(current,reverse) d_four = 0 players[current][0]+=1 if card == "drawtwo": d_two += 1 elif card == "drawfour": d_four += 1 elif card == "skip": skipper = current current = g_next(current,reverse) elif card == "reverse": reverse^=True if card == "skip": current = skipper print(current + 1,players[current][0] - players[current][1])