제출 #407167

#제출 시각아이디문제언어결과실행 시간메모리
407167VictorTriangles (CEOI18_tri)C++17
컴파일 에러
0 ms0 KiB

int main() {
    cin.tie(0)->sync_with_stdio(0);
    cin.exceptions(cin.failbit);

    bitset<501> taken;
    int city;
    int n = get_n();

    rep(i, 1, n + 1) {
        int nxt = i == 1 ? 2 : 1;
        rep(j, 1, n + 1) {
            if (i == j || j == nxt) continue;
            if (is_clockwise(i, nxt, j)) nxt = j;
        }

        bool onborder = true;
        rep(j, 1, n + 1) {
            if (i == j || j == nxt) continue;
            if (is_clockwise(i, nxt, j)) onborder = false;
        }

        if (onborder) {
            city = nxt;
            taken[i] = 1;
        }
    }

    while (!taken[city]) {
        taken[city] = 1;
        int nxt = city == 1 ? 2 : 1;

        rep(j, 1, n + 1) {
            if (city == j || j == nxt) continue;
            if (is_clockwise(city, nxt, j)) nxt = j;
        }

        city=nxt;
    }

    cout << taken.count() << endl;
    return 0;
}

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

tri.cpp: In function 'int main()':
tri.cpp:3:5: error: 'cin' was not declared in this scope
    3 |     cin.tie(0)->sync_with_stdio(0);
      |     ^~~
tri.cpp:6:5: error: 'bitset' was not declared in this scope
    6 |     bitset<501> taken;
      |     ^~~~~~
tri.cpp:6:17: error: 'taken' was not declared in this scope
    6 |     bitset<501> taken;
      |                 ^~~~~
tri.cpp:8:13: error: 'get_n' was not declared in this scope
    8 |     int n = get_n();
      |             ^~~~~
tri.cpp:10:9: error: 'i' was not declared in this scope
   10 |     rep(i, 1, n + 1) {
      |         ^
tri.cpp:10:5: error: 'rep' was not declared in this scope
   10 |     rep(i, 1, n + 1) {
      |     ^~~
tri.cpp:33:13: error: 'j' was not declared in this scope
   33 |         rep(j, 1, n + 1) {
      |             ^
tri.cpp:41:5: error: 'cout' was not declared in this scope
   41 |     cout << taken.count() << endl;
      |     ^~~~
tri.cpp:41:30: error: 'endl' was not declared in this scope
   41 |     cout << taken.count() << endl;
      |                              ^~~~