Submission #29030561


Source Code Expand

import numpy as np

A = np.array(open(0).read().split(), np.int64)[1:]
N = len(A)

K = 30

X = np.append(A, 0)   
sums = np.zeros(len(X), np.int64)

for k in range(K):
    one = X >> k & 1
    x1 = np.sum(one)
    x0 = N - x1
    sums += (x1 - (x1 - x0) * one) << k

ANS = sums.max()
print(ANS)

Submission Info

Submission Time
Task C - XOR to All
User maspy
Language Python (3.8.2)
Score 500
Code Size 311 Byte
Status AC
Exec Time 233 ms
Memory 64936 KiB

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 500 / 500
Status
AC × 3
AC × 47
Set Name Test Cases
Sample 01_sample_01.txt, 01_sample_02.txt, 01_sample_03.txt
All 01_sample_01.txt, 01_sample_02.txt, 01_sample_03.txt, 02_small_01.txt, 02_small_02.txt, 02_small_03.txt, 02_small_04.txt, 02_small_05.txt, 02_small_06.txt, 02_small_07.txt, 02_small_08.txt, 02_small_09.txt, 02_small_10.txt, 03_rand_01.txt, 03_rand_02.txt, 03_rand_03.txt, 03_rand_04.txt, 03_rand_05.txt, 03_rand_06.txt, 03_rand_07.txt, 03_rand_08.txt, 03_rand_09.txt, 03_rand_10.txt, 04_rand_biased_01.txt, 04_rand_biased_02.txt, 04_rand_biased_03.txt, 04_rand_biased_04.txt, 04_rand_biased_05.txt, 04_rand_biased_06.txt, 04_rand_biased_07.txt, 04_rand_biased_08.txt, 04_rand_biased_09.txt, 04_rand_biased_10.txt, 05_anti_greedy_01.txt, 05_anti_greedy_02.txt, 05_anti_greedy_03.txt, 05_anti_greedy_04.txt, 05_anti_greedy_05.txt, 05_anti_greedy_06.txt, 05_anti_greedy_07.txt, 05_anti_greedy_08.txt, 05_anti_greedy_09.txt, 05_anti_greedy_10.txt, 06_handmade_01.txt, 06_handmade_02.txt, 06_handmade_03.txt, 06_handmade_04.txt
Case Name Status Exec Time Memory
01_sample_01.txt AC 108 ms 27052 KiB
01_sample_02.txt AC 105 ms 27004 KiB
01_sample_03.txt AC 106 ms 27124 KiB
02_small_01.txt AC 104 ms 27020 KiB
02_small_02.txt AC 110 ms 26968 KiB
02_small_03.txt AC 108 ms 26816 KiB
02_small_04.txt AC 106 ms 27128 KiB
02_small_05.txt AC 103 ms 27036 KiB
02_small_06.txt AC 103 ms 27220 KiB
02_small_07.txt AC 107 ms 27040 KiB
02_small_08.txt AC 106 ms 26724 KiB
02_small_09.txt AC 107 ms 26728 KiB
02_small_10.txt AC 104 ms 27080 KiB
03_rand_01.txt AC 229 ms 64612 KiB
03_rand_02.txt AC 229 ms 64900 KiB
03_rand_03.txt AC 226 ms 64740 KiB
03_rand_04.txt AC 227 ms 64896 KiB
03_rand_05.txt AC 229 ms 64652 KiB
03_rand_06.txt AC 229 ms 64896 KiB
03_rand_07.txt AC 229 ms 64524 KiB
03_rand_08.txt AC 229 ms 64764 KiB
03_rand_09.txt AC 230 ms 64704 KiB
03_rand_10.txt AC 227 ms 64916 KiB
04_rand_biased_01.txt AC 227 ms 64892 KiB
04_rand_biased_02.txt AC 227 ms 64624 KiB
04_rand_biased_03.txt AC 226 ms 64920 KiB
04_rand_biased_04.txt AC 226 ms 64844 KiB
04_rand_biased_05.txt AC 227 ms 64896 KiB
04_rand_biased_06.txt AC 226 ms 64892 KiB
04_rand_biased_07.txt AC 233 ms 64568 KiB
04_rand_biased_08.txt AC 227 ms 64736 KiB
04_rand_biased_09.txt AC 226 ms 64760 KiB
04_rand_biased_10.txt AC 227 ms 64660 KiB
05_anti_greedy_01.txt AC 227 ms 64900 KiB
05_anti_greedy_02.txt AC 227 ms 64528 KiB
05_anti_greedy_03.txt AC 223 ms 64900 KiB
05_anti_greedy_04.txt AC 224 ms 64612 KiB
05_anti_greedy_05.txt AC 224 ms 64932 KiB
05_anti_greedy_06.txt AC 229 ms 64676 KiB
05_anti_greedy_07.txt AC 233 ms 64756 KiB
05_anti_greedy_08.txt AC 228 ms 64808 KiB
05_anti_greedy_09.txt AC 231 ms 64936 KiB
05_anti_greedy_10.txt AC 225 ms 64728 KiB
06_handmade_01.txt AC 105 ms 27080 KiB
06_handmade_02.txt AC 110 ms 27060 KiB
06_handmade_03.txt AC 185 ms 41412 KiB
06_handmade_04.txt AC 227 ms 64740 KiB