CSES - Leirikisa 2 - Results
Submission details
Task:Järjestys
Sender:ollpu
Submission time:2016-07-28 15:13:43 +0300
Language:C++
Status:READY
Result:0
Feedback
groupverdictscore
#10
Test results
testverdicttime
#1ACCEPTED0.05 sdetails
#2ACCEPTED0.06 sdetails
#3ACCEPTED0.05 sdetails
#40.05 sdetails
#50.05 sdetails
#6ACCEPTED0.07 sdetails
#7ACCEPTED0.06 sdetails
#80.05 sdetails
#90.06 sdetails
#100.06 sdetails

Code

#include <iostream>

using namespace std;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  int n, last = 0, ans = 0;
  cin >> n;
  for (int i = 0; i < n; ++i) {
    int v;
    cin >> v;
    if (v < last) ans++;
    last = v;
  }
  cout << ans;
}

Test details

Test 1

Verdict: ACCEPTED

input
20
1 2 3 4 5 6 7 8 9 10 11 12 13 ...

correct output
0

user output
0

Test 2

Verdict: ACCEPTED

input
20
20 19 18 17 16 15 14 13 12 11 ...

correct output
19

user output
19

Test 3

Verdict: ACCEPTED

input
20
12 2 14 4 5 6 7 8 9 10 11 1 13...

correct output
4

user output
4

Test 4

Verdict:

input
20
17 19 9 20 16 15 14 13 12 11 1...

correct output
17

user output
16

Test 5

Verdict:

input
20
14 17 6 2 1 18 3 10 15 5 7 8 4...

correct output
11

user output
9

Test 6

Verdict: ACCEPTED

input
100000
1 2 3 4 5 6 7 8 9 10 11 12 13 ...

correct output
0

user output
0

Test 7

Verdict: ACCEPTED

input
100000
100000 99999 99998 99997 99996...

correct output
99999

user output
99999

Test 8

Verdict:

input
100000
1 31396 3 4 5 6 7 8 9 10 11 12...

correct output
18136

user output
16503

Test 9

Verdict:

input
100000
100000 99999 99998 99997 99996...

correct output
99739

user output
83581

Test 10

Verdict:

input
100000
64356 85816 57765 61431 4519 7...

correct output
99377

user output
49965