Submission #231902

#TimeUsernameProblemLanguageResultExecution timeMemory
231902jzhBaloni (COCI15_baloni)C++14
100 / 100
301 ms4088 KiB
#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 (stderr)

baloni.cpp: In function 'int main()':
baloni.cpp:8:11: warning: unused variable 'y' [-Wunused-variable]
  ll n,i,x,y;
           ^
#Verdict Execution timeMemoryGrader output
Fetching results...