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