結果
問題 |
No.550 夏休みの思い出(1)
|
ユーザー |
![]() |
提出日時 | 2017-07-29 00:33:34 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 1,657 ms / 2,000 ms |
コード長 | 707 bytes |
コンパイル時間 | 1,469 ms |
コンパイル使用メモリ | 169,676 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-10-10 11:11:15 |
合計ジャッジ時間 | 45,134 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 55 |
コンパイルメッセージ
main.cpp: In function 'int main()': main.cpp:44:10: warning: use of an operand of type 'bool' in 'operator++' is deprecated [-Wdeprecated] 44 | if(flag++) cout << " "; | ^~~~
ソースコード
#include <bits/stdc++.h> using namespace std; typedef long long int64; int main() { int64 A, B, C; cin >> A >> B >> C; bool flag = false; auto f = [&](int64 x) { return (((x + A) * x + B) * x + C); }; auto g = [&](__int128 x) { return (((x + A) * x + B) * x + C); }; vector< int64 > vs; for(int64 X = -10000000; X < 10000000; X++) { if(g(X) == 0) { vs.push_back(X); } } if(vs.size() == 3) { for(int i = 0; i < vs.size(); i++) { if(i) cout << " "; cout << vs[i]; } return (0); } vs.clear(); for(int64 X = -1000000000; X < 1000000000; X++) { if(f(X) == 0) { if(flag++) cout << " "; cout << X; } } }