結果
問題 | No.1452 XOR×OR |
ユーザー |
|
提出日時 | 2021-03-16 21:45:36 |
言語 | PyPy3 (7.3.15) |
結果 |
WA
(最新)
AC
(最初)
|
実行時間 | - |
コード長 | 343 bytes |
コンパイル時間 | 303 ms |
コンパイル使用メモリ | 81,760 KB |
実行使用メモリ | 64,144 KB |
最終ジャッジ日時 | 2024-12-14 17:18:36 |
合計ジャッジ時間 | 3,931 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 1 WA * 2 |
other | AC * 2 WA * 34 |
ソースコード
n = int(input())x = 1ans = 0while x*x <= n:o = n // xcnt = 1for i in range(60):x_bit = (x >> i) & 1o_vit = (o >> i) & 1if x_bit == 1 and o_vit == 1:cnt *= 2cnt %= 10**9+7if x_bit == 1 and o_vit == 0:cnt = 0ans += cntx += 1print(ans // 2)