結果
問題 | No.769 UNOシミュレータ |
ユーザー | sobasssy |
提出日時 | 2018-12-27 20:28:45 |
言語 | Python3 (3.12.2 + numpy 1.26.4 + scipy 1.12.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 2,371 bytes |
コンパイル時間 | 173 ms |
コンパイル使用メモリ | 12,800 KB |
実行使用メモリ | 12,032 KB |
最終ジャッジ日時 | 2024-11-22 08:59:04 |
合計ジャッジ時間 | 7,222 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge3 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | WA | - |
testcase_01 | WA | - |
testcase_02 | AC | 37 ms
10,624 KB |
testcase_03 | WA | - |
testcase_04 | WA | - |
testcase_05 | AC | 32 ms
10,880 KB |
testcase_06 | AC | 33 ms
10,624 KB |
testcase_07 | WA | - |
testcase_08 | AC | 32 ms
10,752 KB |
testcase_09 | WA | - |
testcase_10 | AC | 54 ms
10,752 KB |
testcase_11 | WA | - |
testcase_12 | WA | - |
testcase_13 | WA | - |
testcase_14 | WA | - |
testcase_15 | WA | - |
testcase_16 | AC | 493 ms
11,264 KB |
testcase_17 | WA | - |
testcase_18 | WA | - |
testcase_19 | WA | - |
testcase_20 | WA | - |
testcase_21 | AC | 727 ms
11,776 KB |
testcase_22 | WA | - |
ソースコード
class Uno: def __init__(self): ipt = input().split(" ") self.peoples = int(ipt[0]) self.logs = int(ipt[1]) self.position = 0 self.cards = [] self.draw2 = False self.draw2_count = 0 self.draw4 = False self.draw4_count = 0 self.reverse = False for x in range(self.peoples): self.cards.append(0) def update_pos(self): if not self.reverse: self.position += 1 if self.position == self.peoples: self.position = 0 else: self.position -= 1 if self.position == -1: self.position = self.peoples - 1 def func_number(self): self.cards[self.position] -= 1 self.update_pos() def func_reverse(self): self.cards[self.position] -= 1 if self.reverse: self.reverse = False else: self.reverse = True self.update_pos() def func_skip(self): self.cards[self.position] -= 1 self.update_pos() self.update_pos() def func_draw2(self): self.draw2 = True self.draw2_count += 2 self.cards[self.position] -= 1 self.update_pos() def func_draw4(self): self.draw4 = True self.draw4_count += 4 self.cards[self.position] -= 1 self.update_pos() def main(self): for x in range(self.logs): char = input() if (char != "drawtwo") and self.draw2: self.cards[self.position] += self.draw2_count self.update_pos() self.draw2 = False if (char != "drawfour") and self.draw4: self.cards[self.position] += self.draw4_count self.update_pos() self.draw4 = False if char == "number": self.func_number() if char == "drawtwo": self.func_draw2() if char == "drawfour": self.func_draw4() if char == "skip": self.func_skip() if char == "reverse": self.func_reverse() # print(x, self.position, self.cards) print("{} {}".format(self.position, abs(self.cards[self.position - 1]))) if __name__ == "__main__": Uno().main()