結果
| 問題 | No.1090 ソーシャルディスタンス / Social Distance |
| ユーザー |
onsen_manjuuu
|
| 提出日時 | 2020-06-24 02:10:19 |
| 言語 | C++14 (gcc 15.2.0 + boost 1.89.0) |
| 結果 |
AC
|
| 実行時間 | 22 ms / 2,000 ms |
| コード長 | 511 bytes |
| 記録 | |
| コンパイル時間 | 1,160 ms |
| コンパイル使用メモリ | 182,380 KB |
| 実行使用メモリ | 6,144 KB |
| 最終ジャッジ日時 | 2026-03-25 03:23:42 |
| 合計ジャッジ時間 | 2,216 ms |
|
ジャッジサーバーID (参考情報) |
judge3_0 / judge2_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 23 |
ソースコード
#include<bits/stdc++.h>
using namespace std;
using ll = long long;
template<class T> ostream& operator<<(ostream& os, const vector<T> arr){ for(int i = 0; i < (int)arr.size(); i++)cout << arr[i] << (i == (int)arr.size() -1 ? "" : " "); return os;}
int main()
{
int n, d; cin >> n >> d;
vector<int> a(n);
for(int i = 1; i < n; i++) {
int x; cin >> x; a[i] = a[i - 1] + x;
}
for(int i = 1; i < n; i++) {
a[i] += max(0, d - (a[i] - a[i - 1]));
}
cout << a << endl;
}
onsen_manjuuu