結果

問題 No.1090 ソーシャルディスタンス / Social Distance
ユーザー ninoinuininoinui
提出日時 2020-06-27 09:19:03
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 176 ms / 2,000 ms
コード長 231 bytes
コンパイル時間 4,391 ms
コンパイル使用メモリ 197,688 KB
実行使用メモリ 4,380 KB
最終ジャッジ日時 2023-09-18 19:05:39
合計ジャッジ時間 8,211 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,376 KB
testcase_01 AC 2 ms
4,376 KB
testcase_02 AC 106 ms
4,380 KB
testcase_03 AC 17 ms
4,380 KB
testcase_04 AC 122 ms
4,380 KB
testcase_05 AC 11 ms
4,376 KB
testcase_06 AC 148 ms
4,376 KB
testcase_07 AC 72 ms
4,380 KB
testcase_08 AC 153 ms
4,380 KB
testcase_09 AC 79 ms
4,376 KB
testcase_10 AC 104 ms
4,380 KB
testcase_11 AC 159 ms
4,376 KB
testcase_12 AC 83 ms
4,380 KB
testcase_13 AC 83 ms
4,380 KB
testcase_14 AC 142 ms
4,376 KB
testcase_15 AC 114 ms
4,380 KB
testcase_16 AC 50 ms
4,376 KB
testcase_17 AC 5 ms
4,376 KB
testcase_18 AC 52 ms
4,380 KB
testcase_19 AC 74 ms
4,380 KB
testcase_20 AC 68 ms
4,376 KB
testcase_21 AC 87 ms
4,376 KB
testcase_22 AC 2 ms
4,380 KB
testcase_23 AC 2 ms
4,380 KB
testcase_24 AC 176 ms
4,380 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;

int main() {
  int N, D, a, now = 0, sum = 0;
  cin >> N >> D;
  cout << now;
  while (cin >> a && (sum += a)) cout << " " << (sum >= now + D ? now = sum : now += D);
  cout << "\n";
}
0