Submission #104306

# Submission time Handle Problem Language Result Execution time Memory
104306 2019-04-05T02:51:56 Z LittleFlowers__ Baloni (COCI15_baloni) C++14
100 / 100
236 ms 504 KB
#include <iostream>
using namespace std;
int n,i,a,x;
int c[1000005];
main(){
  cin>>n;
  for(i=1;i<=n;++i){
    cin>>a;
    if(!c[a]) x++; else c[a]--;
    c[a-1]++;
  }
  cout<<x;
}

Compilation message

baloni.cpp:5:6: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
 main(){
      ^
# Verdict Execution time Memory Grader output
1 Correct 2 ms 384 KB Output is correct
2 Correct 3 ms 384 KB Output is correct
3 Correct 3 ms 384 KB Output is correct
4 Correct 3 ms 384 KB Output is correct
5 Correct 198 ms 504 KB Output is correct
6 Correct 236 ms 384 KB Output is correct
7 Correct 205 ms 376 KB Output is correct
8 Correct 184 ms 504 KB Output is correct
9 Correct 173 ms 256 KB Output is correct
10 Correct 226 ms 368 KB Output is correct