結果
| 問題 | 
                            No.638 Sum of "not power of 2"
                             | 
                    
| コンテスト | |
| ユーザー | 
                             | 
                    
| 提出日時 | 2018-01-27 00:14:43 | 
| 言語 | Python3  (3.13.1 + numpy 2.2.1 + scipy 1.14.1)  | 
                    
| 結果 | 
                             
                                WA
                                 
                             
                            
                         | 
                    
| 実行時間 | - | 
| コード長 | 403 bytes | 
| コンパイル時間 | 283 ms | 
| コンパイル使用メモリ | 12,544 KB | 
| 実行使用メモリ | 10,752 KB | 
| 最終ジャッジ日時 | 2024-12-30 02:40:25 | 
| 合計ジャッジ時間 | 1,436 ms | 
| 
                            ジャッジサーバーID (参考情報)  | 
                        judge2 / judge1 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 2 | 
| other | AC * 10 WA * 2 | 
ソースコード
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")