結果

問題 No.3088 XOR = SUM
ユーザー yu23578
提出日時 2025-04-04 23:12:31
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 397 bytes
コンパイル時間 676 ms
コンパイル使用メモリ 82,432 KB
実行使用メモリ 77,960 KB
最終ジャッジ日時 2025-04-04 23:12:58
合計ジャッジ時間 26,774 ms
ジャッジサーバーID
(参考情報)
judge4 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1
other AC * 1 WA * 21
権限があれば一括ダウンロードができます

ソースコード

diff #

T = int(input())
for i in range(T):
  N = int(input())
  cnt = 1
  for j in range(N):
    cnt *= 2
    if(cnt *2 >= N):
      break
  S = N
  if(cnt * 2 == N):
    S = N-1
  x0 = cnt
  y0 = S-cnt
  a0 = x0*y0
  x1 = cnt/2
  y1 = cnt/2-1
  a1 = x1*y1
  if N == 0:
    print(0,0)
  elif N == 1:
    print(1,0)
  elif N == 2:
    print(2,0)
  elif a0 >= a1:
    print(x0,y0)
  else:
    print(x1,y1)
0