結果
問題 | No.638 Sum of "not power of 2" |
ユーザー |
👑 |
提出日時 | 2020-02-19 01:09:38 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 2 ms / 1,000 ms |
コード長 | 488 bytes |
コンパイル時間 | 636 ms |
コンパイル使用メモリ | 72,852 KB |
実行使用メモリ | 6,820 KB |
最終ジャッジ日時 | 2024-10-06 15:59:01 |
合計ジャッジ時間 | 1,220 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 12 |
ソースコード
#include <iostream> #include <set> using namespace std; int main(){ unsigned long long n;cin>>n; set<unsigned long long> nya; unsigned long long nw = 1; nya.insert(nw); while(n > nw){ nw *= 2; nya.insert(nw); } for(long long i = 3; n > i; i++){ if(nya.find(i) != nya.end())continue; if(nya.find(n-i) != nya.end())continue; cout << i << " " << n-i << endl; return 0; } cout << -1 << endl; }