125322
81059 7985 11500 75735 38507 69698 84632 64901 51093 99222 73009 27548 94205 53354 99955 8335
<738114 bytes omitted>
编号 | 题目 | 状态 | 分数 | 总时间 | 内存 | 代码 / 答案文件 | 提交者 | 提交时间 |
---|---|---|---|---|---|---|---|---|
#3729 | #1001. 或(hard version) | Time Limit Exceeded | 0 | 16189 ms | 125284 K | Python 3 / 506 B | new_user_3 | 2023-09-23 22:27:03 |
import sys
def main():
n = int(sys.stdin.readline())
v = list(map(int, sys.stdin.readline().split()))
M = 10**5 + 10
cnt = [0] * M
ans = [0] * M
for i in range(n):
cnt[v[i]] += 1
for i in range(M):
ans[i] += cnt[0]
j = i
while j:
j = (j - 1) & i
ans[i] += cnt[j]
output = [str(ans[v[i]] - 1) for i in range(n)]
sys.stdout.write('\n'.join(output))
if __name__ == '__main__':
main()
125322
81059 7985 11500 75735 38507 69698 84632 64901 51093 99222 73009 27548 94205 53354 99955 8335
<738114 bytes omitted>
100001
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
<199910 bytes omitted>
100001
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
<199910 bytes omitted>
1000000
41468 26655 78990 34829 56141 25413 15635 77183 69398 36145 80898 1911 32336 59353 17752 517
<5888559 bytes omitted>
64478
43613 84533 4270 63362 90658 45146 50600 2002 47916 4640 90640 33234 56745 83055 51424 52439 1
<379428 bytes omitted>
1000000
69058 24037 86917 59528 53087 6780 57879 45701 71162 82123 331 64857 23652 3809 22883 90279
<5888813 bytes omitted>
100001
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 3
<588805 bytes omitted>