CSES - HIIT Open 2019 - Results
Submission details
Task:Alien Invasion II
Sender:bits pls
Submission time:2019-05-25 14:21:46 +0300
Language:C++
Status:READY
Result:
Test results
testverdicttime
#10.02 sdetails
#20.03 sdetails
#30.02 sdetails

Code

#include <iostream>

using namespace std;

int main()
{
    long arr[100][100];
    long n, m;
    cin >> n;
    cin >> m;
    for (long i = 0; i < m; i++) {
        long a, b, x;
        cin >> a;
        cin >> b;
        cin >> x;
        for (long k = 0; k <= b - a; k += 1) {
            arr[a + k - 1][i] = x + k;
        }
    }
    for (long i = 0; i < n; i++) {
        long mx = 0;
        for (long j = 0; j <= m; j++) {
            if (arr[i][j] > mx) mx = arr[i][j];
        }
        cout << mx;
        if (i != n - 1) cout << " ";
    }
    cout << endl;
    return 0;
}

Test details

Test 1

Verdict:

input
2368469234876449

correct output
22368469234876449
3 7456156411625483

user output
(empty)

Test 2

Verdict:

input
292929292929292929292929292931

correct output
129292929292929292929292929293...

user output
(empty)

Test 3

Verdict:

input
292929292929292929292929292979

correct output
129292929292929292929292929297...

user output
(empty)