結果

問題 No.2071 Shift and OR
ユーザー flygonflygon
提出日時 2022-09-16 21:34:02
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 607 bytes
コンパイル時間 351 ms
コンパイル使用メモリ 87,124 KB
実行使用メモリ 107,108 KB
最終ジャッジ日時 2023-08-23 14:31:13
合計ジャッジ時間 5,195 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 71 ms
71,384 KB
testcase_01 AC 73 ms
71,540 KB
testcase_02 AC 76 ms
71,312 KB
testcase_03 AC 72 ms
71,276 KB
testcase_04 AC 70 ms
71,572 KB
testcase_05 AC 72 ms
71,644 KB
testcase_06 AC 71 ms
71,304 KB
testcase_07 WA -
testcase_08 AC 72 ms
71,380 KB
testcase_09 AC 72 ms
71,380 KB
testcase_10 AC 72 ms
71,284 KB
testcase_11 AC 73 ms
71,572 KB
testcase_12 AC 71 ms
71,396 KB
testcase_13 AC 73 ms
71,276 KB
testcase_14 AC 73 ms
71,380 KB
testcase_15 AC 73 ms
71,288 KB
testcase_16 AC 72 ms
71,464 KB
testcase_17 AC 74 ms
71,360 KB
testcase_18 WA -
testcase_19 AC 73 ms
71,468 KB
testcase_20 AC 74 ms
71,520 KB
testcase_21 AC 73 ms
71,392 KB
testcase_22 AC 72 ms
71,484 KB
testcase_23 AC 113 ms
103,568 KB
testcase_24 AC 81 ms
77,104 KB
testcase_25 AC 92 ms
88,588 KB
testcase_26 AC 98 ms
90,416 KB
testcase_27 AC 82 ms
76,524 KB
testcase_28 AC 120 ms
106,876 KB
testcase_29 AC 120 ms
107,108 KB
testcase_30 AC 73 ms
71,304 KB
testcase_31 AC 73 ms
71,644 KB
testcase_32 AC 71 ms
71,468 KB
testcase_33 AC 73 ms
71,496 KB
testcase_34 AC 72 ms
71,140 KB
testcase_35 AC 71 ms
71,448 KB
testcase_36 AC 73 ms
71,488 KB
testcase_37 AC 72 ms
71,376 KB
testcase_38 AC 72 ms
71,296 KB
testcase_39 AC 74 ms
71,396 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n = int(input())
a = list(map(int,input().split()))
cnt = 0
#n <= 1<<60 以下くらい
def popcnt(n):
  c = (n & 0x5555555555555555) + ((n>>1) & 0x5555555555555555)
  c = (c & 0x3333333333333333) + ((c>>2) & 0x3333333333333333)
  c = (c & 0x0f0f0f0f0f0f0f0f) + ((c>>4) & 0x0f0f0f0f0f0f0f0f)
  c = (c & 0x00ff00ff00ff00ff) + ((c>>8) & 0x00ff00ff00ff00ff)
  c = (c & 0x0000ffff0000ffff) + ((c>>16) & 0x0000ffff0000ffff)
  c = (c & 0x00000000ffffffff) + ((c>>32) & 0x00000000ffffffff)
  return c
for i in range(n):
  cnt += popcnt(a[i])
ans = 0
for i in range(min(cnt, 16)):
  ans += pow(2, 15-i)

print(ans)
0