結果
| 問題 | No.2535 多重同値 |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2023-11-10 21:36:36 |
| 言語 | PyPy3 (7.3.23 + ACL) |
| 結果 |
AC
不安定
|
| 実行時間 | 236 ms / 2,000 ms |
| + 668µs | |
| コード長 | 534 bytes |
| 記録 | |
| コンパイル時間 | 253 ms |
| コンパイル使用メモリ | 96,068 KB |
| 実行使用メモリ | 98,276 KB |
| 最終ジャッジ日時 | 2026-09-04 11:37:15 |
| 合計ジャッジ時間 | 6,661 ms |
|
ジャッジサーバーID (参考情報) |
judge3_0 / judge2_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| 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')