結果
| 問題 | No.638 Sum of "not power of 2" |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2018-05-08 01:34:44 |
| 言語 | C++11 (gcc 15.2.0 + boost 1.89.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 363 bytes |
| 記録 | |
| コンパイル時間 | 928 ms |
| コンパイル使用メモリ | 175,508 KB |
| 実行使用メモリ | 7,716 KB |
| 最終ジャッジ日時 | 2026-03-16 12:03:46 |
| 合計ジャッジ時間 | 1,599 ms |
|
ジャッジサーバーID (参考情報) |
judge3_0 / judge1_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 WA * 1 |
| other | AC * 7 WA * 5 |
ソースコード
#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;
}
cout << ans << " " << N << '\n';
return 0;
}