Submission #739990

# Submission time Handle Problem Language Result Execution time Memory
739990 2023-05-11T19:39:36 Z unexpectedbro Baloni (COCI15_baloni) C++14
0 / 100
56 ms 3760 KB
#include <bits/stdc++.h>
using namespace std;
#define fast ios::sync_with_stdio(false);cin.tie(nullptr);
#define ll long long
#define pb push_back
#define all(a) a.begin(),a.end()
void solve()
{
	int n;cin>>n;
	int a[n];
	for(int i=0;i<n;i++){
		cin>>a[i];
	}
	int cnt=0;
	for(int i=0;i<n-1;i++){
		if(a[i]-a[i+1]==1){
			continue;
		}
		else{
			cnt++;
		}
	}
	cout<<cnt+1<<endl;
}
int main()
{
	fast
	int tc=1;
	//cin>>tc;

	while(tc--){
		solve();
	}
	return 0;
}
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 212 KB Output isn't correct
2 Incorrect 0 ms 212 KB Output isn't correct
3 Incorrect 1 ms 212 KB Output isn't correct
4 Incorrect 1 ms 212 KB Output isn't correct
5 Incorrect 56 ms 3412 KB Output isn't correct
6 Incorrect 51 ms 3760 KB Output isn't correct
7 Incorrect 41 ms 3156 KB Output isn't correct
8 Incorrect 42 ms 3116 KB Output isn't correct
9 Incorrect 46 ms 3284 KB Output isn't correct
10 Incorrect 44 ms 3412 KB Output isn't correct