結果
| 問題 | No.2150 Site Supporter |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2022-12-09 21:10:54 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.89.0) |
| 結果 |
AC
|
| 実行時間 | 70 ms / 2,000 ms |
| コード長 | 235 bytes |
| 記録 | |
| コンパイル時間 | 533 ms |
| コンパイル使用メモリ | 65,192 KB |
| 実行使用メモリ | 5,248 KB |
| 最終ジャッジ日時 | 2024-10-14 18:52:42 |
| 合計ジャッジ時間 | 2,098 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 26 |
コンパイルメッセージ
main.cpp:4:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
4 | main()
| ^~~~
ソースコード
#include<iostream>
using namespace std;
int N,K,X;
main()
{
cin>>N>>K>>X;
long d0=0,d1=1e18;
for(int i=0;i<N;i++)
{
int A;cin>>A;
long nd0=min(d0,d1)+A;
long nd1=min(d0+X,d1)+K;
d0=nd0,d1=nd1;
}
cout<<min(d0,d1)<<endl;
}