Submission #54567409


Source Code Expand

Copy
#include <bits/stdc++.h>
using namespace std;
#define _ ios_base::sync_with_stdio(0);cin.tie(0);
#define endl '\n'
typedef long long ll;
const int INF = 0x3f3f3f3f;
const ll LINF = 0x3f3f3f3f3f3f3f3fll;
int main() {_
int n, a; cin >> n >> a;
vector<int> t(n);
for (auto &i : t) cin >> i;
vector<ll> ans(n, -1);
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
#include <bits/stdc++.h>

using namespace std;

#define _ ios_base::sync_with_stdio(0);cin.tie(0);
#define endl '\n'

typedef long long ll;

const int INF = 0x3f3f3f3f;
const ll LINF = 0x3f3f3f3f3f3f3f3fll;

int main() {_

  int n, a; cin >> n >> a;

  vector<int> t(n);
  for (auto &i : t) cin >> i;

  vector<ll> ans(n, -1);

  for (int i = 0; i < n; i++) {
    if (i == 0) {
      ans[i] = t[i] + a;
      continue;
    }

    if (t[i] <= ans[i-1]) {
      ans[i] = ans[i-1] + a;
    } else {
      ans[i] = t[i] + a;
    }
  }

  for (auto i : ans) cout << i << endl;

  return 0;
}

Submission Info

Submission Time
Task B - Ticket Counter
User luishgh
Language C++ 20 (gcc 12.2)
Score 200
Code Size 627 Byte
Status AC
Exec Time 2 ms
Memory 3628 KB

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 200 / 200
Status
AC × 3
AC × 24
Set Name Test Cases
Sample 00_sample_00.txt, 00_sample_01.txt, 00_sample_02.txt
All 00_sample_00.txt, 00_sample_01.txt, 00_sample_02.txt, 01_random_00.txt, 01_random_01.txt, 01_random_02.txt, 01_random_03.txt, 01_random_04.txt, 01_random_05.txt, 01_random_06.txt, 01_random_07.txt, 01_random_08.txt, 01_random_09.txt, 01_random_10.txt, 01_random_11.txt, 01_random_12.txt, 01_random_13.txt, 01_random_14.txt, 01_random_15.txt, 02_handmade_00.txt, 02_handmade_01.txt, 02_handmade_02.txt, 02_handmade_03.txt, 02_handmade_04.txt
Case Name Status Exec Time Memory
00_sample_00.txt AC 1 ms 3552 KB
00_sample_01.txt AC 1 ms 3392 KB
00_sample_02.txt AC 1 ms 3416 KB
01_random_00.txt AC 1 ms 3428 KB
01_random_01.txt AC 1 ms 3444 KB
01_random_02.txt AC 1 ms 3388 KB
01_random_03.txt AC 1 ms 3364 KB
01_random_04.txt AC 1 ms 3448 KB
01_random_05.txt AC 1 ms 3496 KB
01_random_06.txt AC 1 ms 3496 KB
01_random_07.txt AC 1 ms 3484 KB
01_random_08.txt AC 1 ms 3564 KB
01_random_09.txt AC 1 ms 3504 KB
01_random_10.txt AC 1 ms 3500 KB
01_random_11.txt AC 1 ms 3504 KB
01_random_12.txt AC 1 ms 3560 KB
01_random_13.txt AC 1 ms 3508 KB
01_random_14.txt AC 1 ms 3508 KB
01_random_15.txt AC 1 ms 3432 KB
02_handmade_00.txt AC 2 ms 3412 KB
02_handmade_01.txt AC 1 ms 3544 KB
02_handmade_02.txt AC 1 ms 3504 KB
02_handmade_03.txt AC 1 ms 3628 KB
02_handmade_04.txt AC 1 ms 3492 KB


2025-02-18 (Tue)
18:22:36 +00:00