Task: | Increasing Array |
Sender: | Roskis |
Submission time: | 2020-09-26 14:01:05 +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 <bits/stdc++.h> using namespace std; int main() { int n; cin >> n; int current; int min = 0; int max = 0; for (int i = 0; i < n; i++) { cin >> current; if (i == 0) { min = current; continue; } min += 1; if (current > min) min = current; int dif = min - current; //cout << "d" << dif << "m" << min << " "; if (dif <= 0) continue; else if (dif > max) max = dif; } cout << max << endl; }
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 |