Submission #95295

# Submission time Handle Problem Language Result Execution time Memory
95295 2019-01-29T18:59:08 Z karlopuh Baloni (COCI15_baloni) C++14
100 / 100
280 ms 3832 KB
#include <bits/stdc++.h>
using namespace std;

int n, x, ans, cnt[10000001];
 
int main(){
	cin >> n;
	for(int i = 1; i <= n; i++){
		cin >> x;
		if(cnt[x] == 0){
			ans++;
			cnt[x - 1]++;
		}else{
			cnt[x]--;
			cnt[x - 1]++;
		}
	}cout << ans;
	return 0;
}
# Verdict Execution time Memory Grader output
1 Correct 2 ms 256 KB Output is correct
2 Correct 2 ms 256 KB Output is correct
3 Correct 3 ms 376 KB Output is correct
4 Correct 3 ms 256 KB Output is correct
5 Correct 280 ms 3828 KB Output is correct
6 Correct 191 ms 3832 KB Output is correct
7 Correct 172 ms 3180 KB Output is correct
8 Correct 153 ms 3036 KB Output is correct
9 Correct 173 ms 3420 KB Output is correct
10 Correct 173 ms 3420 KB Output is correct