Submission #1184945

#TimeUsernameProblemLanguageResultExecution timeMemory
1184945InvMODBaloni (COCI15_baloni)C++17
Compilation error
0 ms0 KiB
#include<bits/stdc++.h>

using namespace std;

const int N = 1e6 + 5;

int mp[N];

int main(){
  int n; cin >> n;
  
  vector<int> a(n, 0);
  for(int i = 0; i < n; i++){
    cin >> a[i];
  }
  
  int cnt = 0;
  for(int i = 0; i < n; i++){
    if(!mp[h[i]]){
      mp[h[i]]++;
      cnt++;
    }
    else{
      mp[h[i]]--;
      mp[h[i] - 1]++;
    }
  }
  
  cout << cnt << "\n";
  return 0;
}

Compilation message (stderr)

baloni.cpp: In function 'int main()':
baloni.cpp:19:12: error: 'h' was not declared in this scope
   19 |     if(!mp[h[i]]){
      |            ^