結果
問題 | No.638 Sum of "not power of 2" |
ユーザー |
|
提出日時 | 2024-12-01 14:16:48 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 34 ms / 1,000 ms |
コード長 | 320 bytes |
コンパイル時間 | 2,083 ms |
コンパイル使用メモリ | 198,828 KB |
最終ジャッジ日時 | 2025-02-26 09:58:34 |
ジャッジサーバーID (参考情報) |
judge4 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 12 |
ソースコード
#include <bits/stdc++.h> using namespace std; int main(){ long long N; cin >> N; set<long long> st; for (int i = 0; i < 62; i++){ st.insert(1LL << i); } for (int i = 3; i < N; i++){ if (st.count(i) == 0 and st.count(N - i) == 0){ cout << i << ' ' << N - i << endl; return 0; } } cout << -1 << endl; }