제출 #1006884

#제출 시각아이디문제언어결과실행 시간메모리
1006884GTA콤보 (IOI18_combo)C++17
컴파일 에러
0 ms0 KiB
#include <bits/stdc++.h> #include "combo.h" using namespace std; #define fr(m,n,k) for(int m=n;m<=k;m++) #define sz size() int n; string guess_sequence(int N) { n = N; string v = "ABXY"; string p; int a; fr(j, 0, 3) { p = v[j]; int x = press(p); if (x == 1) { a = j; break; } if (j == 2) { a = 3; break; } } p = v[a]; vector<int> sisa = {0, 1, 2, 3}; sisa.erase(find(all(sisa), a)); fr(i, 2, n) { fr(x, 0, 2) { p += v[sisa[x]]; int x = press(p); if (x == i) break; else p.erase(--p.end()); if (x == 1) { p += v[sisa[2]]; break; } } } return p; }

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

combo.cpp: In function 'std::string guess_sequence(int)':
combo.cpp:27:52: error: 'all' was not declared in this scope; did you mean 'std::filesystem::perms::all'?
   27 |   vector<int> sisa = {0, 1, 2, 3}; sisa.erase(find(all(sisa), a));
      |                                                    ^~~
      |                                                    std::filesystem::perms::all
In file included from /usr/include/c++/10/filesystem:44,
                 from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:129,
                 from combo.cpp:1:
/usr/include/c++/10/bits/fs_fwd.h:148:7: note: 'std::filesystem::perms::all' declared here
  148 |       all  =  0777,
      |       ^~~
combo.cpp:31:11: error: redeclaration of 'int x'
   31 |       int x = press(p);
      |           ^
combo.cpp:29:8: note: 'int x' previously declared here
   29 |     fr(x, 0, 2) {
      |        ^
combo.cpp:4:27: note: in definition of macro 'fr'
    4 | #define fr(m,n,k) for(int m=n;m<=k;m++)
      |                           ^