#pragma GCC optimize("Ofast")
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace std ;
using namespace __gnu_pbds;
#define int long long int
#define ordered_set tree<pair<int,int>,null_type,less<pair<int,int>>,rb_tree_tag,tree_order_statistics_node_update>
#define CEIL(p1, p2) (p1+p2-1)/p2
#define all(a) a.begin() , a.end()
#define alr(a) a.rbegin() , a.rend()
#define FreI(pr1) freopen(pr1, "r", stdin);
#define FreO(pr1) freopen(pr1, "w", stdout);
int32_t main(){
ios_base::sync_with_stdio(0), cin.tie(0),cout.tie(0);
int n ;
cin >> n;
vector < int > a(n);
for( auto &i : a ) cin >> i;
int ans = 0 ;
a.push_back(0);
for( int i = 0 ; i < n ; i++ ){
while ( i < n && a[i] >= a[i+1]) i++;
ans++;
}
cout << ans;
return 0 ;
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
0 ms |
320 KB |
Output isn't correct |
2 |
Incorrect |
1 ms |
324 KB |
Output isn't correct |
3 |
Incorrect |
1 ms |
340 KB |
Output isn't correct |
4 |
Incorrect |
1 ms |
328 KB |
Output isn't correct |
5 |
Incorrect |
77 ms |
16212 KB |
Output isn't correct |
6 |
Incorrect |
66 ms |
17724 KB |
Output isn't correct |
7 |
Incorrect |
53 ms |
14484 KB |
Output isn't correct |
8 |
Incorrect |
51 ms |
14316 KB |
Output isn't correct |
9 |
Incorrect |
64 ms |
15436 KB |
Output isn't correct |
10 |
Incorrect |
60 ms |
15804 KB |
Output isn't correct |