제출 #1315488

#제출 시각아이디문제언어결과실행 시간메모리
1315488kawhiet게임 (IOI13_game)C++20
컴파일 에러
0 ms0 KiB
a#include <bits/stdc++.h> #include "game.h" using namespace std; int n, m; vector<array<long long, 3>> pos; void init(int R, int C) { n = R; m = C; } void update(int i, int j, long long k) { for (auto &[x, y, s] : pos) { if (x == i && y == j) { s = k; return; } } pos.push_back({i, j, k}); } long long calculate(int p, int q, int u, int v) { long long ans = 0; for (auto [i, j, x] : pos) { if (p <= i && i <= u && q <= j && j <= v) { ans = gcd(ans, x); } } return ans; }

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

game.cpp:1:2: error: stray '#' in program
    1 | a#include <bits/stdc++.h>
      |  ^
game.cpp:1:1: error: 'a' does not name a type
    1 | a#include <bits/stdc++.h>
      | ^
game.cpp:6:8: error: 'array' was not declared in this scope
    6 | vector<array<long long, 3>> pos;
      |        ^~~~~
game.cpp:3:1: note: 'std::array' is defined in header '<array>'; did you forget to '#include <array>'?
    2 | #include "game.h"
  +++ |+#include <array>
    3 | using namespace std;
game.cpp:6:8: error: 'array' was not declared in this scope
    6 | vector<array<long long, 3>> pos;
      |        ^~~~~
game.cpp:6:8: note: 'std::array' is defined in header '<array>'; did you forget to '#include <array>'?
game.cpp:6:8: error: 'array' was not declared in this scope
game.cpp:6:8: note: 'std::array' is defined in header '<array>'; did you forget to '#include <array>'?
game.cpp:6:8: error: 'array' was not declared in this scope
game.cpp:6:8: note: 'std::array' is defined in header '<array>'; did you forget to '#include <array>'?
game.cpp:6:8: error: 'array' was not declared in this scope
game.cpp:6:8: note: 'std::array' is defined in header '<array>'; did you forget to '#include <array>'?
game.cpp:6:8: error: 'array' was not declared in this scope
game.cpp:6:8: note: 'std::array' is defined in header '<array>'; did you forget to '#include <array>'?
game.cpp:6:8: error: 'array' was not declared in this scope
game.cpp:6:8: note: 'std::array' is defined in header '<array>'; did you forget to '#include <array>'?
game.cpp:6:8: error: 'array' was not declared in this scope
game.cpp:6:8: note: 'std::array' is defined in header '<array>'; did you forget to '#include <array>'?
game.cpp:6:8: error: 'array' was not declared in this scope
game.cpp:6:8: note: 'std::array' is defined in header '<array>'; did you forget to '#include <array>'?
game.cpp:6:1: error: 'vector' does not name a type
    6 | vector<array<long long, 3>> pos;
      | ^~~~~~
game.cpp: In function 'void update(int, int, long long int)':
game.cpp:14:28: error: 'pos' was not declared in this scope
   14 |     for (auto &[x, y, s] : pos) {
      |                            ^~~
game.cpp:20:5: error: 'pos' was not declared in this scope
   20 |     pos.push_back({i, j, k});
      |     ^~~
game.cpp: In function 'long long int calculate(int, int, int, int)':
game.cpp:25:27: error: 'pos' was not declared in this scope
   25 |     for (auto [i, j, x] : pos) {
      |                           ^~~
game.cpp:27:19: error: 'gcd' was not declared in this scope
   27 |             ans = gcd(ans, x);
      |                   ^~~