結果

問題 No.3088 XOR = SUM
ユーザー sasa8uyauya
提出日時 2025-04-04 22:23:36
言語 PyPy3
(7.3.15)
結果
RE  
実行時間 -
コード長 290 bytes
コンパイル時間 780 ms
コンパイル使用メモリ 82,180 KB
実行使用メモリ 77,876 KB
最終ジャッジ日時 2025-04-04 22:24:45
合計ジャッジ時間 30,163 ms
ジャッジサーバーID
(参考情報)
judge5 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1
other AC * 21 RE * 1
権限があれば一括ダウンロードができます

ソースコード

diff #

T=int(input())
for _ in range(T):
  n=int(input())
  if n==0:
    print(0,0)
    continue
  for i in reversed(range(61)):
    if (n>>i)&1:
      p1,p2=(1<<i),n-(1<<i)
      break
  l=len(bin(n)[2:])-1
  p3,p4=1<<(l-1),(1<<(l-1))-1
  if p1*p2>p3*p4:
    print(p1,p2)
  else:
    print(p3,p4)
0