結果

問題 No.638 Sum of "not power of 2"
ユーザー _shiro_k_shiro_k
提出日時 2018-01-27 00:00:46
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 345 bytes
コンパイル時間 103 ms
コンパイル使用メモリ 10,692 KB
実行使用メモリ 8,080 KB
最終ジャッジ日時 2023-08-28 18:15:48
合計ジャッジ時間 1,008 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 16 ms
7,976 KB
testcase_01 AC 15 ms
7,904 KB
testcase_02 AC 15 ms
7,904 KB
testcase_03 AC 15 ms
7,872 KB
testcase_04 AC 15 ms
7,860 KB
testcase_05 AC 14 ms
7,876 KB
testcase_06 AC 16 ms
7,872 KB
testcase_07 AC 15 ms
7,976 KB
testcase_08 AC 15 ms
7,936 KB
testcase_09 WA -
testcase_10 AC 16 ms
7,904 KB
testcase_11 AC 16 ms
7,876 KB
testcase_12 AC 16 ms
8,080 KB
testcase_13 AC 16 ms
7,864 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import math

N = int(input())
findNum = False
top = 0
bottom = 0

for i in range(1, int(N/2) + 1):
    top = i
    bottom = N - i
    res1, _ = math.modf(math.log2(top))
    res2, _ = math.modf(math.log2(bottom))
    if res1 != 0 and res2 != 0:
        findNum = True
        break

if findNum:
    print(top, " ", bottom)
else:
    print("-1")
0