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