結果
問題 |
No.1090 ソーシャルディスタンス / Social Distance
|
ユーザー |
![]() |
提出日時 | 2025-02-09 15:37:53 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 356 bytes |
コンパイル時間 | 789 ms |
コンパイル使用メモリ | 71,824 KB |
実行使用メモリ | 6,824 KB |
最終ジャッジ日時 | 2025-02-09 15:38:02 |
合計ジャッジ時間 | 2,731 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 1 WA * 1 |
other | AC * 13 WA * 10 |
ソースコード
#include<iostream> #include<vector> using namespace std; int main() { int n,d;cin>>n>>d; vector<int> a(n); a[0]=0; for(int i=1;i<n;i++) cin>>a[i]; if(n==1) {cout<<a[0]<<endl;return 0;} if(n==2) {cout<<a[0]<<' '<<max(a[0]+d,a[1])<<endl;return 0;} cout<<a[0]; for(int i=1;i<n;i++) { a[i] = max(a[i-1]+d,a[i]); cout<<' '<<a[i]; } cout<<endl; }