結果

問題 No.638 Sum of "not power of 2"
ユーザー c_r_5c_r_5
提出日時 2018-10-27 13:13:37
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 16 ms / 1,000 ms
コード長 321 bytes
コンパイル時間 108 ms
コンパイル使用メモリ 10,696 KB
実行使用メモリ 7,968 KB
最終ジャッジ日時 2023-08-12 07:43:46
合計ジャッジ時間 1,269 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 16 ms
7,832 KB
testcase_01 AC 16 ms
7,876 KB
testcase_02 AC 15 ms
7,932 KB
testcase_03 AC 15 ms
7,868 KB
testcase_04 AC 16 ms
7,864 KB
testcase_05 AC 16 ms
7,808 KB
testcase_06 AC 15 ms
7,864 KB
testcase_07 AC 15 ms
7,868 KB
testcase_08 AC 16 ms
7,968 KB
testcase_09 AC 16 ms
7,784 KB
testcase_10 AC 15 ms
7,936 KB
testcase_11 AC 16 ms
7,892 KB
testcase_12 AC 15 ms
7,808 KB
testcase_13 AC 16 ms
7,808 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n=int(input())
l=[1]
t=2
while t<=n:
    l.append(t)
    t*=2
for a in range(1,n+1):
    for t in l:
        if a==t:
            break
    else:
        b=n-a
        if b<1:continue
        for t in l:
            if b==t:
                break
        else:
            print(a,b)
            break
else:
    print(-1)
0