結果

問題 No.638 Sum of "not power of 2"
ユーザー work-furukawa
提出日時 2025-04-29 19:06:04
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 37 ms / 1,000 ms
コード長 207 bytes
コンパイル時間 3,507 ms
コンパイル使用メモリ 81,840 KB
実行使用メモリ 53,584 KB
最終ジャッジ日時 2025-04-29 19:06:09
合計ジャッジ時間 2,320 ms
ジャッジサーバーID
(参考情報)
judge3 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 12
権限があれば一括ダウンロードができます

ソースコード

diff #

N = int(input())
power_of_2 = set()
i = 1
while i <= N:
  power_of_2.add(i)
  i *= 2

for a in range(1, N//2+1):
  if a not in power_of_2 and (N-a) not in power_of_2:
    print(a, N-a)
    exit()

print(-1)
0