結果
| 問題 |
No.1132 凸凹
|
| ユーザー |
👑 |
| 提出日時 | 2021-12-21 10:24:59 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 550 bytes |
| コンパイル時間 | 799 ms |
| コンパイル使用メモリ | 65,764 KB |
| 実行使用メモリ | 6,940 KB |
| 最終ジャッジ日時 | 2024-09-15 15:33:29 |
| 合計ジャッジ時間 | 1,716 ms |
|
ジャッジサーバーID (参考情報) |
judge6 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 25 WA * 1 |
コンパイルメッセージ
In file included from /home/linuxbrew/.linuxbrew/Cellar/gcc@12/12.3.0/include/c++/12/iostream:39,
from main.cpp:1:
In member function 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(long long int) [with _CharT = char; _Traits = std::char_traits<char>]',
inlined from 'int main()' at main.cpp:22:11:
/home/linuxbrew/.linuxbrew/Cellar/gcc@12/12.3.0/include/c++/12/ostream:202:25: warning: 'mx' may be used uninitialized [-Wmaybe-uninitialized]
202 | { return _M_insert(__n); }
| ~~~~~~~~~^~~~~
main.cpp: In function 'int main()':
main.cpp:5:23: note: 'mx' was declared here
5 | long long mn,mnp=-1,mx,mxp=-1;
| ^~
In member function 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(long long int) [with _CharT = char; _Traits = std::char_traits<char>]',
inlined from 'int main()' at main.cpp:22:38:
/home/linuxbrew/.linuxbrew/Cellar/gcc@12/12.3.0/include/c++/12/ostream:202:25: warning: 'mn' may be used uninitialized [-Wmaybe-uninitialized]
202 | { return _M_insert(__n); }
| ~~~~~~~~~^~~~~
main.cpp: In function 'int main()':
main.cpp:5:13: note: 'mn' was declared here
5 | long long mn,mnp=-1,mx,mxp=-1;
| ^~
ソースコード
#include <iostream>
using namespace std;
int main(){
long long a,b,c,d,p,q;cin>>a>>b>>c>>d>>p>>q;
long long mn,mnp=-1,mx,mxp=-1;
for(int i = p; q >= i; i++){
if(mnp == -1){
mnp = i;
mn = a*i*i*i+b*i*i+c*i+d;
}else if(mn > a*i*i*i+b*i*i+c*i+d){
mnp = i;
mn = a*i*i*i+b*i*i+c*i+d;
}
if(mxp == -1){
mxp = i;
mx = a*i*i*i+b*i*i+c*i+d;
}else if(mx < a*i*i*i+b*i*i+c*i+d){
mxp = i;
mx = a*i*i*i+b*i*i+c*i+d;
}
}
cout << mx << " " << mxp << " " << mn << " " << mnp << endl;
}