제출 #1184945

#제출 시각아이디문제언어결과실행 시간메모리
1184945InvMODBaloni (COCI15_baloni)C++17
컴파일 에러
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; }

컴파일 시 표준 에러 (stderr) 메시지

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