結果

問題 No.2535 多重同値
ユーザー hato336hato336
提出日時 2023-11-10 21:36:36
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 195 ms / 2,000 ms
コード長 534 bytes
コンパイル時間 164 ms
コンパイル使用メモリ 81,700 KB
実行使用メモリ 92,344 KB
最終ジャッジ日時 2023-11-10 21:36:41
合計ジャッジ時間 4,437 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 141 ms
85,176 KB
testcase_01 AC 142 ms
85,176 KB
testcase_02 AC 142 ms
85,176 KB
testcase_03 AC 139 ms
85,176 KB
testcase_04 AC 141 ms
85,176 KB
testcase_05 AC 138 ms
85,176 KB
testcase_06 AC 145 ms
85,176 KB
testcase_07 AC 140 ms
85,176 KB
testcase_08 AC 140 ms
85,176 KB
testcase_09 AC 139 ms
85,176 KB
testcase_10 AC 141 ms
85,176 KB
testcase_11 AC 139 ms
85,176 KB
testcase_12 AC 139 ms
85,176 KB
testcase_13 AC 138 ms
85,176 KB
testcase_14 AC 141 ms
85,176 KB
testcase_15 AC 155 ms
88,376 KB
testcase_16 AC 169 ms
89,400 KB
testcase_17 AC 195 ms
92,344 KB
testcase_18 AC 195 ms
92,344 KB
testcase_19 AC 194 ms
92,344 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import collections,sys,math,functools,operator,itertools,bisect,heapq,decimal,string,time,random
#sys.setrecursionlimit(10**9)
#sys.set_int_max_str_digits(0)
input = sys.stdin.readline
n = int(input())
alist = []
for i in range(n):
    s = input()
    if s[0] == 'Y':
        alist.append(0)
    else:
        alist.append(1)

@functools.lru_cache(maxsize=1000000)
def calc(l,r):
    if l == r:
        return alist[r]
    return alist[l] ^ calc(l+1,r)


t = 0
for i in range(n):
    t ^= alist[i]
    print('Yes' if t == 0 else 'No')
0