Task: | Increasing Array |
Sender: | kkivimaki |
Submission time: | 2020-09-26 13:09:53 +0300 |
Language: | C++ (C++11) |
Status: | READY |
Result: | WRONG ANSWER |
test | verdict | time | |
---|---|---|---|
#1 | WRONG ANSWER | 0.01 s | details |
#2 | WRONG ANSWER | 0.01 s | details |
#3 | WRONG ANSWER | 0.01 s | details |
#4 | WRONG ANSWER | 0.04 s | details |
#5 | WRONG ANSWER | 0.04 s | details |
#6 | WRONG ANSWER | 0.09 s | details |
#7 | ACCEPTED | 0.01 s | details |
Code
#include <iostream> using namespace std; int main() { int n; cin >> n; int *d = new int[n]; for (int i = 0; i < n; i++) { cin >> d[i]; } int m = d[0] + 1; int t = 0; for (int i = 1; i < n; i++) { if (d[i] < m) { int t0 = m - d[i]; if (t0 > t) t = t0; m += 1; } else if(d[i] >= m) { m = d[i] + 1; } } cout << t << endl; delete[] d; return 0; }
Test details
Test 1
Verdict: WRONG ANSWER
input |
---|
10 1 1 1 1 1 1 1 1 1 1 |
correct output |
---|
0 |
user output |
---|
9 |
Test 2
Verdict: WRONG ANSWER
input |
---|
10 1000000000 1 1 1 1 1 1 1 1 1 |
correct output |
---|
8999999991 |
user output |
---|
1000000008 |
Test 3
Verdict: WRONG ANSWER
input |
---|
10 6 10 4 10 2 8 9 2 7 7 |
correct output |
---|
31 |
user output |
---|
14 |
Test 4
Verdict: WRONG ANSWER
input |
---|
200000 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 ... |
correct output |
---|
0 |
user output |
---|
199999 |
Test 5
Verdict: WRONG ANSWER
input |
---|
200000 1000000000 1 1 1 1 1 1 1 1 1 1... |
correct output |
---|
199998999800001 |
user output |
---|
1000199998 |
Test 6
Verdict: WRONG ANSWER
input |
---|
200000 763977854 530688450 486447012 ... |
correct output |
---|
100126194120455 |
user output |
---|
1000127681 |
Test 7
Verdict: ACCEPTED
input |
---|
1 329873232 |
correct output |
---|
0 |
user output |
---|
0 |