結果

問題 No.638 Sum of "not power of 2"
ユーザー coro65536coro65536
提出日時 2018-01-26 22:32:56
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 16 ms / 1,000 ms
コード長 236 bytes
コンパイル時間 115 ms
コンパイル使用メモリ 10,656 KB
実行使用メモリ 8,196 KB
最終ジャッジ日時 2023-08-28 18:09:56
合計ジャッジ時間 973 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 16 ms
8,044 KB
testcase_01 AC 16 ms
8,192 KB
testcase_02 AC 15 ms
8,120 KB
testcase_03 AC 15 ms
8,148 KB
testcase_04 AC 15 ms
8,172 KB
testcase_05 AC 15 ms
8,152 KB
testcase_06 AC 15 ms
8,060 KB
testcase_07 AC 14 ms
7,828 KB
testcase_08 AC 15 ms
8,072 KB
testcase_09 AC 14 ms
7,888 KB
testcase_10 AC 15 ms
7,796 KB
testcase_11 AC 15 ms
7,936 KB
testcase_12 AC 15 ms
8,196 KB
testcase_13 AC 15 ms
7,752 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

# B

N = int(input())

if N <= 5:
    print(-1)
    quit()
if N == 6:
    print(3, 3)
    quit()
if N == 7:
    print(-1)
    quit()

if N % 2 == 0:
    print(3, N-3)
    quit()

if N-3 & (N-4):
    print(3, N-3)
else:
    print(5, N-5)
0