結果
| 問題 | No.1090 ソーシャルディスタンス / Social Distance |
| ユーザー |
forest3
|
| 提出日時 | 2020-06-25 16:35:37 |
| 言語 | C++14 (gcc 15.2.0 + boost 1.89.0) |
| 結果 |
AC
|
| 実行時間 | 22 ms / 2,000 ms |
| コード長 | 456 bytes |
| 記録 | |
| コンパイル時間 | 1,088 ms |
| コンパイル使用メモリ | 182,596 KB |
| 実行使用メモリ | 6,272 KB |
| 最終ジャッジ日時 | 2026-03-25 04:43:34 |
| 合計ジャッジ時間 | 3,312 ms |
|
ジャッジサーバーID (参考情報) |
judge3_0 / judge2_1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| 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