結果
問題 | No.1452 XOR×OR |
ユーザー |
|
提出日時 | 2021-03-31 13:50:42 |
言語 | PyPy3 (7.3.15) |
結果 |
AC
|
実行時間 | 46 ms / 2,000 ms |
コード長 | 414 bytes |
コンパイル時間 | 215 ms |
コンパイル使用メモリ | 82,048 KB |
実行使用メモリ | 58,240 KB |
最終ジャッジ日時 | 2024-07-02 15:38:43 |
合計ジャッジ時間 | 2,967 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 36 |
ソースコード
n = int(input())if n > 10 ** 9 or 1 > n:raise ValueErrorx = 1ans = 0while x*x <= n:if n % x != 0:x += 1continueo = n // xcnt = 1for i in range(60):x_bit = (x >> i) & 1o_vit = (o >> i) & 1if x_bit == 1 and o_vit == 1:cnt *= 2if x_bit == 1 and o_vit == 0:cnt = 0ans += cntx += 1print(ans // 2)