結果
| 問題 |
No.638 Sum of "not power of 2"
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2018-01-27 00:06:31 |
| 言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
| 結果 |
RE
|
| 実行時間 | - |
| コード長 | 388 bytes |
| コンパイル時間 | 280 ms |
| コンパイル使用メモリ | 12,544 KB |
| 実行使用メモリ | 11,008 KB |
| 最終ジャッジ日時 | 2024-12-30 02:39:19 |
| 合計ジャッジ時間 | 1,804 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 6 WA * 1 RE * 5 |
ソースコード
import math
N = int(input())
r = 0
if N%2 == 0:
r = N/2
else:
r = 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")