Submission #1112547

# Submission time Handle Problem Language Result Execution time Memory
1112547 2024-11-14T09:54:37 Z vjudge1 Baloni (COCI15_baloni) C++17
100 / 100
240 ms 592 KB
#include <bits/stdc++.h>
#define int long long

using namespace std;

int32_t main(){
	int n;
	cin>>n;
	int ans=n;
	map<int,int> cikti;
	for(int i=0; i<n; i++){
		int x;
		cin>>x;
		if(cikti[x]){
			ans--;
			cikti[x]--;
			cikti[x-1]++;
		}else{
			cikti[x-1]++;
		}
	}
	cout<<ans<<"\n";
}
# Verdict Execution time Memory Grader output
1 Correct 1 ms 336 KB Output is correct
2 Correct 1 ms 336 KB Output is correct
3 Correct 2 ms 336 KB Output is correct
4 Correct 2 ms 336 KB Output is correct
5 Correct 240 ms 592 KB Output is correct
6 Correct 191 ms 500 KB Output is correct
7 Correct 146 ms 480 KB Output is correct
8 Correct 144 ms 336 KB Output is correct
9 Correct 192 ms 336 KB Output is correct
10 Correct 166 ms 500 KB Output is correct