結果
| 問題 | No.1493 隣接xor |
| コンテスト | |
| ユーザー |
👑 |
| 提出日時 | 2025-02-16 22:01:41 |
| 言語 | PyPy3 (8.0.0 + ACL) |
| 結果 |
AC
不安定
|
| 実行時間 | 96 ms / 2,000 ms |
| + 938µs | |
| コード長 | 259 bytes |
| 記録 | |
| コンパイル時間 | 83 ms |
| コンパイル使用メモリ | 64,796 KB |
| 実行使用メモリ | 97,896 KB |
| 最終ジャッジ日時 | 2026-10-16 23:48:05 |
| 合計ジャッジ時間 | 6,099 ms |
|
ジャッジサーバーID (参考情報) |
judge5_0 / judge3_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 28 |
ソースコード
MOD = 10**9 + 7
n = int(input())
A = list(map(int, input().split()))
B = []
x = 0
for a in A:
x ^= a
B.append(x)
B.pop()
tot = 1
cnt = {-1: 1}
for b in B:
nex = tot
tot = nex + tot - cnt.get(b, 0)
tot %= MOD
cnt[b] = nex
print(tot)