제출 #1150523

#제출 시각아이디문제언어결과실행 시간메모리
1150523marvinthang질문 (CEOI14_question_grader)C++20
컴파일 에러
0 ms0 KiB
#include <bits/stdc++.h> using namespace std; const int K = 12; vector <vector <bool>> a; int decode(int n, int x, int y) { if (a.empty()) { a.emplace_back(); vector <bool> b(K); iota(b.begin() + K / 2, b.end(), true); do a.push_back(b); while (next_permutation(b.begin(), b.end())); } for (int i = 0; i < K; ++i) if (a[x][i] && !a[y][i]) return i + 1; }
#include <bits/stdc++.h> using namespace std; const int K = 12; vector <vector <bool>> a; int decode(int n, int x, int y) { if (a.empty()) { a.emplace_back(); vector <bool> b(K); iota(b.begin() + K / 2, b.end(), true); do a.push_back(b); while (next_permutation(b.begin(), b.end())); } for (int i = 0; i < K; ++i) if (a[x][i] && !a[y][i]) return i + 1; }

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

# 1번째 컴파일 단계

In file included from /usr/include/c++/11/numeric:62,
                 from /usr/include/x86_64-linux-gnu/c++/11/bits/stdc++.h:84,
                 from encoder.cpp:1:
/usr/include/c++/11/bits/stl_numeric.h: In instantiation of 'constexpr void std::iota(_ForwardIterator, _ForwardIterator, _Tp) [with _ForwardIterator = std::_Bit_iterator; _Tp = bool]':
encoder.cpp:12:7:   required from here
/usr/include/c++/11/bits/stl_numeric.h:100:13: error: use of an operand of type 'bool' in 'operator++' is forbidden in C++17
  100 |           ++__value;
      |             ^~~~~~~
encoder.cpp: In function 'int decode(int, int, int)':
encoder.cpp:16:1: warning: control reaches end of non-void function [-Wreturn-type]
   16 | }
      | ^