結果
問題 | No.638 Sum of "not power of 2" |
ユーザー |
|
提出日時 | 2018-02-02 17:03:45 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
AC
|
実行時間 | 32 ms / 1,000 ms |
コード長 | 314 bytes |
コンパイル時間 | 407 ms |
コンパイル使用メモリ | 12,672 KB |
実行使用メモリ | 10,880 KB |
最終ジャッジ日時 | 2024-12-31 00:52:36 |
合計ジャッジ時間 | 1,546 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 12 |
ソースコード
def is_power_of_two(n): binary = bin(n)[3:] for b in binary: if b == "1": return False return True def main(): N = int(input()) a = 3 while True: b = N - a if b <= 2: print(-1) return if not is_power_of_two(b): print(a, b) return a += 2 main()