結果

問題 No.1090 ソーシャルディスタンス / Social Distance
ユーザー face4
提出日時 2020-07-05 13:22:01
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 38 ms / 2,000 ms
コード長 338 bytes
コンパイル時間 637 ms
コンパイル使用メモリ 63,572 KB
実行使用メモリ 6,948 KB
最終ジャッジ日時 2024-09-22 09:31:18
合計ジャッジ時間 3,083 ms
ジャッジサーバーID
(参考情報)
judge1 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 23
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<iostream>
using namespace std;

int main(){
    int n, d;
    cin >> n >> d;
    int a[n];
    a[0] = 0;
    for(int i = 1; i < n; i++)  cin >> a[i], a[i] += a[i-1];
    cout << a[0];
    for(int i = 1; i < n; i++){
        if(a[i]-a[i-1] < d) a[i] = a[i-1]+d;
        cout << " " << a[i];
    }
    cout << endl;
    return 0;
}
0