結果

問題 No.1090 ソーシャルディスタンス / Social Distance
ユーザー CELICA
提出日時 2020-06-24 11:44:00
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 444 bytes
コンパイル時間 1,483 ms
コンパイル使用メモリ 168,200 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-07-03 20:05:34
合計ジャッジ時間 2,869 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1 WA * 1
other AC * 13 WA * 10
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>

using ll = long long;

using namespace std;

int main()
{
    ios::sync_with_stdio(false);
    cin.tie(nullptr);

    int n,d;
    cin >> n >> d;

    int pa[n]{0};
    int* p = &pa[0];
    string s{ "0 " };
    for (int i = 1; i < n; ++i)
    {
        cin >> *++p;
        if (*p - pa[i - 1] < d)
            *p = pa[i - 1] + d;

        s += to_string(*p) + " ";
    }

    printf("%s", s.c_str());

    return 0;
}
0