제출 #1272698

#제출 시각아이디문제언어결과실행 시간메모리
1272698tdiv운세 보기 2 (JOI14_fortune_telling2)C++20
컴파일 에러
0 ms0 KiB
BIT myBIT(m); FOD(i, nQuery, 1) { myBIT.update(query[i], 1); for (auto [i, y] : bucket[i]) { int binh = myBIT.get(y, m); if (flip[i]) ans += (binh & 1 ? min(p[i].first, p[i].second) : max(p[i].first, p[i].second)); else ans += (binh & 1 ? p[i].second : p[i].first); } } cout << ans << "\n"; return; } int main() { ios_base::sync_with_stdio(false); cin.tie(nullptr); if (fopen(TASK".INP", "r")) { freopen(TASK".INP", "r", stdin); freopen(TASK".OUT", "w", stdout); } int tt = 1; waguri(); return 0; }

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

fortune_telling2.cpp:2:5: error: 'BIT' does not name a type
    2 |     BIT myBIT(m);
      |     ^~~
fortune_telling2.cpp:3:8: error: expected constructor, destructor, or type conversion before '(' token
    3 |     FOD(i, nQuery, 1) {
      |        ^
fortune_telling2.cpp:13:5: error: 'cout' does not name a type
   13 |     cout << ans << "\n";
      |     ^~~~
fortune_telling2.cpp:15:5: error: expected unqualified-id before 'return'
   15 |     return;
      |     ^~~~~~
fortune_telling2.cpp:16:1: error: expected declaration before '}' token
   16 | }
      | ^
fortune_telling2.cpp: In function 'int main()':
fortune_telling2.cpp:19:5: error: 'ios_base' has not been declared
   19 |     ios_base::sync_with_stdio(false);
      |     ^~~~~~~~
fortune_telling2.cpp:20:5: error: 'cin' was not declared in this scope
   20 |     cin.tie(nullptr);
      |     ^~~
fortune_telling2.cpp:22:15: error: 'TASK' was not declared in this scope
   22 |     if (fopen(TASK".INP", "r")) {
      |               ^~~~
fortune_telling2.cpp:22:9: error: 'fopen' was not declared in this scope
   22 |     if (fopen(TASK".INP", "r")) {
      |         ^~~~~
fortune_telling2.cpp:1:1: note: 'fopen' is defined in header '<cstdio>'; did you forget to '#include <cstdio>'?
  +++ |+#include <cstdio>
    1 | 
fortune_telling2.cpp:23:21: error: expected ')' before string constant
   23 |         freopen(TASK".INP", "r", stdin);
      |                ~    ^~~~~~
      |                     )
fortune_telling2.cpp:23:34: error: 'stdin' was not declared in this scope
   23 |         freopen(TASK".INP", "r", stdin);
      |                                  ^~~~~
fortune_telling2.cpp:23:34: note: 'stdin' is defined in header '<cstdio>'; did you forget to '#include <cstdio>'?
fortune_telling2.cpp:23:9: error: 'freopen' was not declared in this scope
   23 |         freopen(TASK".INP", "r", stdin);
      |         ^~~~~~~
fortune_telling2.cpp:24:21: error: expected ')' before string constant
   24 |         freopen(TASK".OUT", "w", stdout);
      |                ~    ^~~~~~
      |                     )
fortune_telling2.cpp:24:34: error: 'stdout' was not declared in this scope
   24 |         freopen(TASK".OUT", "w", stdout);
      |                                  ^~~~~~
fortune_telling2.cpp:24:34: note: 'stdout' is defined in header '<cstdio>'; did you forget to '#include <cstdio>'?
fortune_telling2.cpp:28:5: error: 'waguri' was not declared in this scope
   28 |     waguri();
      |     ^~~~~~