結果
問題 |
No.3102 floor sqrt xor
|
ユーザー |
![]() |
提出日時 | 2025-04-11 00:30:39 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
AC
|
実行時間 | 546 ms / 2,000 ms |
コード長 | 292 bytes |
コンパイル時間 | 614 ms |
コンパイル使用メモリ | 12,032 KB |
実行使用メモリ | 10,368 KB |
最終ジャッジ日時 | 2025-04-11 00:30:45 |
合計ジャッジ時間 | 4,532 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 1 |
other | AC * 30 |
ソースコード
import math def solve(): n = int(input()) lb = max(0, math.isqrt(((n >> 30) + 0) << 30) - 1) ub = math.isqrt(((n >> 30) + 1) << 30) + 1 for i in range(lb, ub + 1): if i * i <= (n ^ i) < (i+1) * (i+1): print(n ^ i) return print(-1) t = int(input()) for _ in range(t): solve()