結果
| 問題 |
No.1090 ソーシャルディスタンス / Social Distance
|
| ユーザー |
forest3
|
| 提出日時 | 2020-06-25 16:35:37 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 38 ms / 2,000 ms |
| コード長 | 456 bytes |
| コンパイル時間 | 1,634 ms |
| コンパイル使用メモリ | 171,296 KB |
| 実行使用メモリ | 6,944 KB |
| 最終ジャッジ日時 | 2024-07-03 21:35:37 |
| 合計ジャッジ時間 | 3,866 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 23 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
int main()
{
int N, D;
cin >> N >> D;
vector<int> a( N - 1 );
for( int i = 0; i < N - 1; i++ ) {
cin >> a[i];
}
vector<long long> ans( N );
for( int i = 1; i < N; i++ ) {
ans[i] = ans[i - 1] + a[i - 1];
}
for( int i = 1; i < N; i++ ) {
int d = ans[i] - ans[i - 1];
if( d < D ) ans[i] += D - d;
}
for( int i = 0; i < N; i++ ) {
if( i ) cout << " ";
cout << ans[i];
}
cout << endl;
}
forest3