結果
問題 | No.1493 隣接xor |
ユーザー |
👑 |
提出日時 | 2025-02-16 22:01:41 |
言語 | PyPy3 (7.3.15) |
結果 |
AC
|
実行時間 | 156 ms / 2,000 ms |
コード長 | 259 bytes |
コンパイル時間 | 251 ms |
コンパイル使用メモリ | 82,584 KB |
実行使用メモリ | 144,124 KB |
最終ジャッジ日時 | 2025-02-16 22:01:46 |
合計ジャッジ時間 | 4,961 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 27 |
ソースコード
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)