結果
| 問題 |
No.1493 隣接xor
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2021-05-01 00:34:56 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
RE
|
| 実行時間 | - |
| コード長 | 444 bytes |
| コンパイル時間 | 219 ms |
| コンパイル使用メモリ | 82,432 KB |
| 実行使用メモリ | 119,552 KB |
| 最終ジャッジ日時 | 2024-07-19 04:36:18 |
| 合計ジャッジ時間 | 4,708 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | RE * 3 |
| other | RE * 27 |
ソースコード
import sys
input = lambda : sys.stdin.readline().rstrip()
sys.setrecursionlimit(2*10**5+10)
write = lambda x: sys.stdout.write(x+"\n")
debug = lambda x: sys.stderr.write(x+"\n")
n = int(input())
a = list(map(int, input().split()))
from collections import defaultdict
d = defaultdict(int)
c = [0]
for v in a:
c.append(c[-1]^v)
d[-1] = 1
s = 1
ans = 1
for v in c[1:-1]:
val = s
s += (val - d[v])
s %= M
d[v] = val
print(s%M)