Task: | Final Array |
Sender: | bits pls |
Submission time: | 2019-05-25 14:52:55 +0300 |
Language: | C++ |
Status: | READY |
Result: | RUNTIME ERROR |
test | verdict | time | |
---|---|---|---|
#1 | RUNTIME ERROR | 0.09 s | details |
#2 | RUNTIME ERROR | 0.09 s | details |
#3 | RUNTIME ERROR | 0.11 s | details |
Code
#include <iostream> using namespace std; int main() { long** arr = new long*[100002]; for (long i = 0; i < 100002; i++) arr[i] = new long[100002]; long n, m; cin >> n; cin >> m; for (long i = 0; i < m; i++) { long a, b; long 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 << " "; } return 0; }
Test details
Test 1
Verdict: RUNTIME ERROR
input |
---|
100000 100000 29706 39977 913671103 20575 89990 878449866 1691 70785 229168045 81099 81323 611730238 ... |
correct output |
---|
227121122 450258482 450258483 ... |
user output |
---|
(empty) |
Test 2
Verdict: RUNTIME ERROR
input |
---|
100000 100000 1 100000 1 1 100000 2 1 100000 3 1 100000 4 ... |
correct output |
---|
100000 100001 100002 100003 10... |
user output |
---|
(empty) |
Test 3
Verdict: RUNTIME ERROR
input |
---|
8 2 1 4 1 1 8 1 |
correct output |
---|
1 2 3 4 5 6 7 8 |
user output |
---|
(empty) |