結果
問題 | No.769 UNOシミュレータ |
ユーザー | terasa |
提出日時 | 2022-06-09 21:45:13 |
言語 | PyPy3 (7.3.15) |
結果 |
AC
|
実行時間 | 164 ms / 2,000 ms |
コード長 | 1,546 bytes |
コンパイル時間 | 156 ms |
コンパイル使用メモリ | 81,796 KB |
実行使用メモリ | 78,280 KB |
最終ジャッジ日時 | 2023-10-21 04:33:24 |
合計ジャッジ時間 | 4,400 ms |
ジャッジサーバーID (参考情報) |
judge13 / judge12 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 44 ms
56,200 KB |
testcase_01 | AC | 44 ms
56,200 KB |
testcase_02 | AC | 41 ms
56,200 KB |
testcase_03 | AC | 42 ms
56,200 KB |
testcase_04 | AC | 42 ms
58,248 KB |
testcase_05 | AC | 50 ms
58,248 KB |
testcase_06 | AC | 44 ms
58,248 KB |
testcase_07 | AC | 45 ms
58,248 KB |
testcase_08 | AC | 45 ms
58,248 KB |
testcase_09 | AC | 86 ms
77,268 KB |
testcase_10 | AC | 84 ms
77,268 KB |
testcase_11 | AC | 84 ms
77,132 KB |
testcase_12 | AC | 118 ms
77,512 KB |
testcase_13 | AC | 115 ms
77,520 KB |
testcase_14 | AC | 117 ms
77,564 KB |
testcase_15 | AC | 147 ms
77,772 KB |
testcase_16 | AC | 138 ms
77,920 KB |
testcase_17 | AC | 137 ms
77,756 KB |
testcase_18 | AC | 164 ms
78,176 KB |
testcase_19 | AC | 164 ms
78,280 KB |
testcase_20 | AC | 156 ms
78,096 KB |
testcase_21 | AC | 163 ms
78,144 KB |
testcase_22 | AC | 43 ms
56,200 KB |
ソースコード
import sys import pypyjit import itertools import heapq import math from collections import deque, defaultdict import bisect import random input = sys.stdin.readline sys.setrecursionlimit(10 ** 6) pypyjit.set_param('max_unroll_recursion=-1') def index_lt(a, x): 'return largest index s.t. A[i] < x or -1 if it does not exist' return bisect.bisect_left(a, x) - 1 def index_le(a, x): 'return largest index s.t. A[i] <= x or -1 if it does not exist' return bisect.bisect_right(a, x) - 1 def index_gt(a, x): 'return smallest index s.t. A[i] > x or len(a) if it does not exist' return bisect.bisect_right(a, x) def index_ge(a, x): 'return smallest index s.t. A[i] >= x or len(a) if it does not exist' return bisect.bisect_left(a, x) def generate(k): return random.sample(range(26), k) N, M = map(int, input().split()) def next(): global id if reverse is True: id = (id - 1) % N else: id = (id + 1) % N id = 0 reverse = False cnt = [0] * N acc2 = 0 acc4 = 0 for i in range(M): l = input()[:-1] if acc2 > 0 and l != 'drawtwo': cnt[id] += 2 * acc2 acc2 = 0 next() if acc4 > 0 and l != 'drawfour': cnt[id] += 4 * acc4 acc4 = 0 next() cnt[id] -= 1 if i == M - 1: print(id + 1, -cnt[id]) if l == 'number': pass elif l == 'drawtwo': acc2 += 1 elif l == 'drawfour': acc4 += 1 elif l == 'skip': next() else: reverse = not reverse next()