Submission #62094847
Source Code Expand
Copy
n=int(input())a=list(map(int,input().split()))dp=[set() for _ in range(1<<n)]dp[0].add(0)for i in range(1<<n):for j in range((1<<n)-i):tp=0if i&j:continuefor k in range(n):if (j>>k)&1:tp+=a[k]for num in dp[i]:dp[j+i].add(num^tp)print(len(dp[-1]))
n=int(input())
a=list(map(int,input().split()))
dp=[set() for _ in range(1<<n)]
dp[0].add(0)
for i in range(1<<n):
for j in range((1<<n)-i):
tp=0
if i&j:
continue
for k in range(n):
if (j>>k)&1:
tp+=a[k]
for num in dp[i]:
dp[j+i].add(num^tp)
print(len(dp[-1]))
Submission Info
| Submission Time | |
|---|---|
| Task | D - Stone XOR |
| User | juten |
| Language | Python (PyPy 3.10-v7.3.12) |
| Score | 0 |
| Code Size | 364 Byte |
| Status | TLE |
| Exec Time | 3357 ms |
| Memory | 857924 KB |
Judge Result
| Set Name | Sample | All | ||||||
|---|---|---|---|---|---|---|---|---|
| Score / Max Score | 0 / 0 | 0 / 400 | ||||||
| Status |
|
|
| Set Name | Test Cases |
|---|---|
| Sample | example_00.txt, example_01.txt, example_02.txt |
| All | example_00.txt, example_01.txt, example_02.txt, hand_00.txt, hand_01.txt, hand_02.txt, hand_03.txt, hand_04.txt, hand_05.txt, random_00.txt, random_01.txt, random_02.txt, random_03.txt, random_04.txt, random_05.txt, random_06.txt, random_07.txt, random_08.txt, random_09.txt, random_10.txt, random_11.txt, random_12.txt, random_13.txt, random_14.txt, random_15.txt, random_16.txt, random_17.txt, random_18.txt, random_19.txt, random_20.txt, random_21.txt, random_22.txt, random_23.txt, random_24.txt, random_25.txt, random_26.txt, random_27.txt, random_28.txt, random_29.txt |
| Case Name | Status | Exec Time | Memory |
|---|---|---|---|
| example_00.txt | AC | 58 ms | 76448 KB |
| example_01.txt | AC | 58 ms | 76376 KB |
| example_02.txt | AC | 65 ms | 81616 KB |
| hand_00.txt | AC | 177 ms | 84316 KB |
| hand_01.txt | AC | 459 ms | 93120 KB |
| hand_02.txt | AC | 128 ms | 84064 KB |
| hand_03.txt | TLE | 3332 ms | 422088 KB |
| hand_04.txt | AC | 58 ms | 76480 KB |
| hand_05.txt | AC | 330 ms | 87684 KB |
| random_00.txt | AC | 245 ms | 129692 KB |
| random_01.txt | AC | 60 ms | 81260 KB |
| random_02.txt | AC | 61 ms | 81144 KB |
| random_03.txt | AC | 74 ms | 82020 KB |
| random_04.txt | TLE | 3351 ms | 774676 KB |
| random_05.txt | AC | 181 ms | 84580 KB |
| random_06.txt | AC | 82 ms | 81748 KB |
| random_07.txt | AC | 59 ms | 76356 KB |
| random_08.txt | AC | 210 ms | 85208 KB |
| random_09.txt | AC | 85 ms | 82240 KB |
| random_10.txt | AC | 515 ms | 107564 KB |
| random_11.txt | AC | 90 ms | 82012 KB |
| random_12.txt | AC | 109 ms | 85088 KB |
| random_13.txt | TLE | 3330 ms | 386220 KB |
| random_14.txt | AC | 275 ms | 101056 KB |
| random_15.txt | TLE | 3355 ms | 857924 KB |
| random_16.txt | TLE | 3357 ms | 827968 KB |
| random_17.txt | AC | 245 ms | 129380 KB |
| random_18.txt | AC | 250 ms | 129604 KB |
| random_19.txt | AC | 62 ms | 81180 KB |
| random_20.txt | AC | 66 ms | 81816 KB |
| random_21.txt | TLE | 3329 ms | 358820 KB |
| random_22.txt | AC | 156 ms | 88072 KB |
| random_23.txt | AC | 58 ms | 76616 KB |
| random_24.txt | AC | 592 ms | 135556 KB |
| random_25.txt | AC | 80 ms | 82000 KB |
| random_26.txt | AC | 66 ms | 81980 KB |
| random_27.txt | AC | 109 ms | 83708 KB |
| random_28.txt | AC | 81 ms | 82020 KB |
| random_29.txt | AC | 168 ms | 84240 KB |