제출 #869095

#제출 시각아이디문제언어결과실행 시간메모리
869095AtabayRajabli동굴 (IOI13_cave)C++17
컴파일 에러
0 ms0 KiB
#include "cave.h" void exploreCave(int n) { int q = 0; int a[n], ans[n], d[n]; for(int i = 0; i<n; i++) { a[i] = 0; } map<int, int> mp; for(int i = 0; i<n; i++)mp[i]++ for(int i = 0; i<n; i++) { int l = 0, r = n-1, q = tryCombination(a); while(l <= r) { int mid = (l + r) / 2; a[mid] ^= 1; int k = tryCombination(a); if(k == q) { r = mid - 1; a[mid] ^= 1; } else if(k < q) { l = mid + 1; a[mid] ^= 1; } else if(k == q + 1) { break; } } } answer(a, d); }

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

cave.cpp: In function 'void exploreCave(int)':
cave.cpp:10:5: error: 'map' was not declared in this scope
   10 |     map<int, int> mp;
      |     ^~~
cave.cpp:10:9: error: expected primary-expression before 'int'
   10 |     map<int, int> mp;
      |         ^~~
cave.cpp:11:29: error: 'mp' was not declared in this scope
   11 |     for(int i = 0; i<n; i++)mp[i]++
      |                             ^~
cave.cpp:13:20: error: 'i' was not declared in this scope
   13 |     for(int i = 0; i<n; i++)
      |                    ^
cave.cpp:4:9: warning: unused variable 'q' [-Wunused-variable]
    4 |     int q = 0;
      |         ^
cave.cpp:5:15: warning: unused variable 'ans' [-Wunused-variable]
    5 |     int a[n], ans[n], d[n];
      |               ^~~