結果
| 問題 | No.638 Sum of "not power of 2" |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2018-05-08 01:36:02 |
| 言語 | C++11 (gcc 15.2.0 + boost 1.89.0) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 1,000 ms |
| コード長 | 407 bytes |
| 記録 | |
| コンパイル時間 | 1,153 ms |
| コンパイル使用メモリ | 176,904 KB |
| 実行使用メモリ | 7,844 KB |
| 最終ジャッジ日時 | 2026-03-16 12:04:24 |
| 合計ジャッジ時間 | 1,581 ms |
|
ジャッジサーバーID (参考情報) |
judge1_0 / judge3_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 12 |
ソースコード
#include "bits/stdc++.h"
using namespace std;
int main() {
unsigned long N;
int ans;
cin >> N;
if(N < 6 || N == 7) ans = -1;
else {
N -= 3;
if((N & N-1)==0) {
N -= 2;
if((N & N-1)==0) ans = -1;
else ans = 5;
} else ans = 3;
}
if(ans == -1) cout << ans << '\n';
else cout << ans << " " << N << '\n';
return 0;
}