結果

問題 No.183 たのしい排他的論理和(EASY)
ユーザー vwxyzvwxyz
提出日時 2021-09-12 15:22:41
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 1,826 ms / 5,000 ms
コード長 937 bytes
コンパイル時間 539 ms
コンパイル使用メモリ 86,940 KB
実行使用メモリ 105,812 KB
最終ジャッジ日時 2023-09-06 10:41:50
合計ジャッジ時間 17,349 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 256 ms
92,536 KB
testcase_01 AC 264 ms
94,804 KB
testcase_02 AC 270 ms
94,584 KB
testcase_03 AC 262 ms
94,424 KB
testcase_04 AC 258 ms
92,508 KB
testcase_05 AC 273 ms
94,716 KB
testcase_06 AC 275 ms
94,440 KB
testcase_07 AC 1,227 ms
104,448 KB
testcase_08 AC 1,657 ms
104,308 KB
testcase_09 AC 1,194 ms
101,716 KB
testcase_10 AC 1,407 ms
102,900 KB
testcase_11 AC 1,761 ms
105,656 KB
testcase_12 AC 270 ms
94,448 KB
testcase_13 AC 257 ms
92,516 KB
testcase_14 AC 1,238 ms
105,584 KB
testcase_15 AC 1,826 ms
105,812 KB
testcase_16 AC 262 ms
94,320 KB
testcase_17 AC 600 ms
97,368 KB
testcase_18 AC 1,356 ms
104,012 KB
testcase_19 AC 430 ms
96,044 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import bisect
import copy
import decimal
import fractions
import heapq
import itertools
import math
import random
import sys
from collections import Counter,deque,defaultdict
from functools import lru_cache,reduce
from heapq import heappush,heappop,heapify,heappushpop,_heappop_max,_heapify_max
def _heappush_max(heap,item):
    heap.append(item)
    heapq._siftdown_max(heap, 0, len(heap)-1)
def _heappushpop_max(heap, item):
    if heap and item < heap[0]:
        item, heap[0] = heap[0], item
        heapq._siftup_max(heap, 0)
    return item
from math import gcd as GCD
read=sys.stdin.read
readline=sys.stdin.readline
readlines=sys.stdin.readlines

N=int(readline())
A=list(map(int,readline().split()))
dp=[False]*(1<<15)
dp[0]=True
ans=1
for a in A:
    if a==1<<14:
        ans=2
        continue
    prev=dp
    dp=[False]*(1<<14)
    for bit in range(1<<14):
        dp[bit]=prev[bit]|prev[bit^a]
ans*=dp.count(True)
print(ans)
0