結果
問題 |
No.638 Sum of "not power of 2"
|
ユーザー |
![]() |
提出日時 | 2018-05-27 23:53:42 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 2 ms / 1,000 ms |
コード長 | 376 bytes |
コンパイル時間 | 1,492 ms |
コンパイル使用メモリ | 166,144 KB |
実行使用メモリ | 6,944 KB |
最終ジャッジ日時 | 2024-06-30 07:27:46 |
合計ジャッジ時間 | 2,198 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 12 |
コンパイルメッセージ
main.cpp:6:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type] 6 | main(){ | ^~~~
ソースコード
#include<bits/stdc++.h> typedef long long ll; using namespace std; int INF = 1LL << 30; int MOD = 1e9+7; main(){ ll N; cin >> N; if(N <= 5 || N == 7){ cout << -1 << endl; return 0; } int cnt = __builtin_popcountll(N-3); if(cnt == 1){ cout << 5 << " " << N-5 << endl; }else{ cout << 3 << " " << N-3 << endl; } }