#include <bits/stdc++.h>
using namespace std;
signed main(){
int n, res = 0;
bool b = false;
cin >> n;
vector<int> vec(n);
for (int i = 0; i< n; i++) cin >> vec[i];
for (int i = 1; i< n;i++){
if (vec[i-1] < vec[i]){
b = true;
}else{
if (b){
res++;
b = false;
}
}
}
if (b) res++;
cout << res;
return 0;
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
348 KB |
Output is correct |
2 |
Incorrect |
0 ms |
436 KB |
Output isn't correct |
3 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
348 KB |
Output is correct |
2 |
Incorrect |
0 ms |
436 KB |
Output isn't correct |
3 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
348 KB |
Output is correct |
2 |
Incorrect |
0 ms |
436 KB |
Output isn't correct |
3 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
348 KB |
Output is correct |
2 |
Incorrect |
0 ms |
436 KB |
Output isn't correct |
3 |
Halted |
0 ms |
0 KB |
- |