結果
| 問題 | 
                            No.3102 floor sqrt xor
                             | 
                    
| コンテスト | |
| ユーザー | 
                             detteiuu
                         | 
                    
| 提出日時 | 2025-10-26 21:12:07 | 
| 言語 | PyPy3  (7.3.15)  | 
                    
| 結果 | 
                             
                                AC
                                 
                             
                            
                         | 
                    
| 実行時間 | 86 ms / 2,000 ms | 
| コード長 | 258 bytes | 
| コンパイル時間 | 368 ms | 
| コンパイル使用メモリ | 82,772 KB | 
| 実行使用メモリ | 76,520 KB | 
| 最終ジャッジ日時 | 2025-10-26 21:12:12 | 
| 合計ジャッジ時間 | 4,374 ms | 
| 
                            ジャッジサーバーID (参考情報)  | 
                        judge4 / judge5 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 1 | 
| other | AC * 30 | 
ソースコード
from math import isqrt
for _ in range(int(input())):
    N = int(input())
    sq = isqrt(N)
    for n in reversed(range(max(sq-1000, 0), sq+1001)):
        k = N^n
        if isqrt(k) == n:
            print(k)
            break
    else:
        print(-1)
            
            
            
        
            
detteiuu