結果

問題 No.3088 XOR = SUM
ユーザー 遭難者
提出日時 2025-04-21 14:31:20
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 764 ms / 2,000 ms
コード長 292 bytes
コンパイル時間 558 ms
コンパイル使用メモリ 82,592 KB
実行使用メモリ 76,776 KB
最終ジャッジ日時 2025-04-21 14:31:50
合計ジャッジ時間 27,554 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1
other AC * 22
権限があれば一括ダウンロードができます

ソースコード

diff #

for _ in range(int(input())):
    n = int(input())
    if n <= 1:
        print(0, 0)
        continue
    k = 1
    while k <= n:
        k <<= 1
    k >>= 1
    x1, y1 = k, n - k
    x2, y2 = k // 2, k // 2 - 1
    if x1 * y1 > x2 * y2:
        print(x1, y1)
    else:
        print(x2, y2)
0