Submission #497323

# Submission time Handle Problem Language Result Execution time Memory
497323 2021-12-23T03:05:15 Z Aktan Money (IZhO17_money) C++14
0 / 100
0 ms 300 KB
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
#define ordered_set tree<int, null_type,less<int>, rb_tree_tag,tree_order_statistics_node_update>
#define int long long
#define ft first
#define sc second
using namespace std;
const int mod=1e9+7,INF=1e17;

int a[1000000];
main(){
    int n,ans=0;
    cin >> n;
    for(int i=0;i<n;i++){
    	cin >> a[i];
    	if(i==0){
    		continue;
		}
		if(a[i-1]>a[i]){
			ans++;
		}
	}
	if(ans!=0){
		ans++;
	}
	cout << ans;
}

Compilation message

money.cpp:13:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
   13 | main(){
      | ^~~~
# Verdict Execution time Memory Grader output
1 Correct 0 ms 300 KB Output is correct
2 Incorrect 0 ms 300 KB Output isn't correct
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 300 KB Output is correct
2 Incorrect 0 ms 300 KB Output isn't correct
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 300 KB Output is correct
2 Incorrect 0 ms 300 KB Output isn't correct
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 300 KB Output is correct
2 Incorrect 0 ms 300 KB Output isn't correct
3 Halted 0 ms 0 KB -