結果

問題 No.638 Sum of "not power of 2"
ユーザー brthyyjpbrthyyjp
提出日時 2020-06-29 08:00:51
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 251 bytes
コンパイル時間 787 ms
コンパイル使用メモリ 87,092 KB
実行使用メモリ 71,692 KB
最終ジャッジ日時 2023-09-25 04:11:18
合計ジャッジ時間 2,244 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 AC 69 ms
71,408 KB
testcase_03 WA -
testcase_04 AC 71 ms
71,452 KB
testcase_05 AC 74 ms
71,504 KB
testcase_06 WA -
testcase_07 AC 71 ms
71,316 KB
testcase_08 AC 71 ms
71,228 KB
testcase_09 AC 70 ms
71,424 KB
testcase_10 AC 70 ms
71,568 KB
testcase_11 AC 69 ms
71,504 KB
testcase_12 AC 72 ms
71,320 KB
testcase_13 AC 73 ms
71,512 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n = int(input())
i = 0
S = []
while 2**i <= n:
    S.append(2**i)
    i += 1

T = set(S)
for a in S:
    b = n-a
    T.add(b)

if len(T) == n-1:
    print(-1)
    exit()

for i in range(1, n+1):
    if i not in T:
        print(i, n-i)
        exit()
0