結果
| 問題 | No.1132 凸凹 |
| ユーザー |
|
| 提出日時 | 2020-07-28 22:51:47 |
| 言語 | C++11 (gcc 15.2.0 + boost 1.89.0) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 2,000 ms |
| コード長 | 1,202 bytes |
| 記録 | |
| コンパイル時間 | 870 ms |
| コンパイル使用メモリ | 180,324 KB |
| 実行使用メモリ | 7,720 KB |
| 最終ジャッジ日時 | 2026-03-18 00:34:08 |
| 合計ジャッジ時間 | 2,085 ms |
|
ジャッジサーバーID (参考情報) |
judge1_0 / judge2_1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 26 |
コンパイルメッセージ
In file included from /home/linuxbrew/.linuxbrew/Cellar/gcc/15.2.0_1/include/c++/15/ostream:42,
from /home/linuxbrew/.linuxbrew/Cellar/gcc/15.2.0_1/include/c++/15/istream:43,
from /home/linuxbrew/.linuxbrew/Cellar/gcc/15.2.0_1/include/c++/15/sstream:42,
from /home/linuxbrew/.linuxbrew/Cellar/gcc/15.2.0_1/include/c++/15/complex:50,
from /home/linuxbrew/.linuxbrew/Cellar/gcc/15.2.0_1/include/c++/15/ccomplex:43,
from /home/linuxbrew/.linuxbrew/Cellar/gcc/15.2.0_1/include/c++/15/x86_64-pc-linux-gnu/bits/stdc++.h:133,
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 'void pr(const A&, const B& ...) [with A = long long int; B = {}]' at main.cpp:19:65,
inlined from 'void pr(const A&, const B& ...) [with A = long long int; B = {long long int}]' at main.cpp:19:94,
inlined from 'void pr(const A&, const B& ...) [with A = long long int; B = {long long int, long long int}]' at main.cpp:19:94,
inlined from 'void pr(const A&, const B& ...) [with A = long long int; B = {long long int, long long int, long long int}]' at main.cpp:19:94,
inlined from 'void Main()' at main.cpp:39:5:
/home/linuxbrew/.linuxbrew/Cellar/gcc/15.2.0_1/include/c++/15/bits/ostream.h:212:25: warning: 'x' may be used uninitialized [-Wmaybe-uninitialized]
212 | { return _M_insert(__n); }
| ~~~~~~~~~^~~~~
main.cpp: In function 'void Main()':
main.cpp:27:23: note: 'x' was declared here
27 | ll Mi=MAXL,Ma=-MAXL,x,y;
| ^
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 'void pr(const A&, const B& ...) [with
ソースコード
#include <bits/stdc++.h>
using namespace std;
#define F first
#define S second
#define R cin>>
#define ll long long
#define ln cout<<'\n'
#define in(a) insert(a)
#define pb(a) push_back(a)
#define pd(a) printf("%.10f\n",a)
#define mem(a) memset(a,0,sizeof(a))
#define all(c) (c).begin(),(c).end()
#define iter(c) __typeof((c).begin())
#define rrep(i,n) for(ll i=(ll)(n)-1;i>=0;i--)
#define REP(i,m,n) for(ll i=(ll)(m);i<(ll)(n);i++)
#define rep(i,n) REP(i,0,n)
#define tr(it,c) for(iter(c) it=(c).begin();it!=(c).end();it++)
ll check(ll n,ll m,ll x,ll y){return x>=0&&x<n&&y>=0&&y<m;}void pr(){ln;}
template<class A,class...B>void pr(const A &a,const B&...b){cout<<a<<(sizeof...(b)?" ":"");pr(b...);}
template<class A>void PR(A a,ll n){rep(i,n)cout<<(i?" ":"")<<a[i];ln;}
const ll MAX=1e9+7,MAXL=1LL<<61,dx[8]={-1,0,1,0,-1,-1,1,1},dy[8]={0,1,0,-1,-1,1,1,-1};
typedef pair<ll,ll> P;
void Main() {
ll a,b,c,d,p,q;
cin >> a >> b >> c >> d >> p >> q;
ll Mi=MAXL,Ma=-MAXL,x,y;
REP(i,p,q+1) {
ll z=a*i*i*i+b*i*i+c*i+d;
if(z<Mi) {
Mi=z;
x=i;
}
if(Ma<z) {
Ma=z;
y=i;
}
}
pr(Ma,y,Mi,x);
}
int main(){ios::sync_with_stdio(0);cin.tie(0);Main();return 0;}