-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path11764.cpp
54 lines (51 loc) · 782 Bytes
/
11764.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
/*
11764 - Jumping Mario
*/
#include<bits/stdc++.h>
using namespace std;
int main()
{
int test;
cin>>test;
for(int i=1; i<=test; i++)
{
int n;
cin>>n;
int ar[n];
int l2h=0, h2l=0;
for(int j=0; j<n; j++)
{
cin>>ar[j];
}
int start = ar[0];
for(int j=1; j<n; j++)
{
if(start<ar[j])
{
l2h++;
start = ar[j];
}
else if(start>ar[j])
{
h2l++;
start = ar[j];
}
}
printf("Case %d: %d %d\n",i,l2h,h2l);
}
return 0;
}
/*
Sample Input
3
8
1 4 2 2 3 5 3 4
1
9
5
1 2 3 4 5
Sample Output
Case 1: 4 2
Case 2: 0 0
Case 3: 4 0
*/