結果
問題 |
No.638 Sum of "not power of 2"
|
ユーザー |
|
提出日時 | 2018-05-08 01:34:44 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 363 bytes |
コンパイル時間 | 1,306 ms |
コンパイル使用メモリ | 158,864 KB |
実行使用メモリ | 6,944 KB |
最終ジャッジ日時 | 2024-06-28 02:25:37 |
合計ジャッジ時間 | 2,178 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
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; }