結果
| 問題 |
No.2535 多重同値
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2023-11-10 21:36:36 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
AC
|
| 実行時間 | 179 ms / 2,000 ms |
| コード長 | 534 bytes |
| コンパイル時間 | 338 ms |
| コンパイル使用メモリ | 82,048 KB |
| 実行使用メモリ | 92,928 KB |
| 最終ジャッジ日時 | 2024-09-26 01:15:14 |
| 合計ジャッジ時間 | 4,000 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 20 |
ソースコード
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')