結果
問題 |
No.638 Sum of "not power of 2"
|
ユーザー |
![]() |
提出日時 | 2018-07-27 21:40:37 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
TLE
|
実行時間 | - |
コード長 | 412 bytes |
コンパイル時間 | 1,494 ms |
コンパイル使用メモリ | 166,024 KB |
実行使用メモリ | 13,952 KB |
最終ジャッジ日時 | 2024-07-04 21:19:14 |
合計ジャッジ時間 | 5,896 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | -- * 2 |
other | TLE * 1 -- * 11 |
ソースコード
#include <bits/stdc++.h> using namespace std; int main() { int64_t n; cin >> n; auto bit_count = [](int64_t x) { int64_t r = 0; for (; x; x >>= 1) { r += (x & 1); } return r; }; for (int64_t a = 1; a < 10000000; a++) { int64_t b = n - a; if ((bit_count(a) == 1) || (bit_count(b) == 1)) { continue; } cout << a << ' ' << b << endl; return 0; } cout << -1 << endl; return 0; }