Submission #231902

# Submission time Handle Problem Language Result Execution time Memory
231902 2020-05-15T09:22:28 Z jzh Baloni (COCI15_baloni) C++14
100 / 100
301 ms 4088 KB
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int main(){
	ios_base::sync_with_stdio(0);
	cin.tie(0);
	multiset<ll>s;
	ll n,i,x,y;
	cin>>n;
	for (i=0;i<n;i++){
		cin>>x;
		auto it = s.find(x);
		if (it != s.end()){
			s.erase(it);
		}
		s.insert(x-1);
	}
	cout<<s.size()<<'\n';
}

Compilation message

baloni.cpp: In function 'int main()':
baloni.cpp:8:11: warning: unused variable 'y' [-Wunused-variable]
  ll n,i,x,y;
           ^
# Verdict Execution time Memory Grader output
1 Correct 5 ms 384 KB Output is correct
2 Correct 5 ms 396 KB Output is correct
3 Correct 6 ms 384 KB Output is correct
4 Correct 6 ms 384 KB Output is correct
5 Correct 255 ms 4088 KB Output is correct
6 Correct 301 ms 3960 KB Output is correct
7 Correct 253 ms 3448 KB Output is correct
8 Correct 252 ms 3320 KB Output is correct
9 Correct 253 ms 3576 KB Output is correct
10 Correct 272 ms 3704 KB Output is correct