結果

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

テストケース

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

ソースコード

diff #

import math

N = int(input())
r = 0
if N % 2 == 0:
    r = int(N / 2)
else:
    r = int(N // 2) + 1
findNum = False
top = 0
bottom = 0
for i in range(1, r):
    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