結果
問題 | No.183 たのしい排他的論理和(EASY) |
ユーザー |
|
提出日時 | 2017-08-13 01:36:35 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
RE
|
実行時間 | - |
コード長 | 399 bytes |
コンパイル時間 | 101 ms |
コンパイル使用メモリ | 12,288 KB |
実行使用メモリ | 19,200 KB |
最終ジャッジ日時 | 2024-10-13 06:05:10 |
合計ジャッジ時間 | 2,354 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 9 RE * 9 |
ソースコード
# -*- coding: utf-8 -*- N = int(input()) A = list(map(int, input().split())) dp = [False] * 1000000 def solution(i, m): if not dp[m]: if i<N-1: solution(i+1, m) dp[m] = True if not dp[m^A[i]]: if i<N-1: solution(i+1, m^A[i]) dp[m^A[i]] = True solution(0, 0) pattern = 0 for b in dp: if b: pattern += 1 print(pattern)