답안 #609044

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
609044 2022-07-27T11:56:39 Z DeMen100ns Monster Game (JOI21_monster) C++17
컴파일 오류
0 ms 0 KB
/*
Author : DeMen100ns (a.k.a Vo Khac Trieu)
School : VNU-HCM High school for the Gifted
fuck you adhoc
*/
 
#include <monster.h>
#include <bits/stdc++.h>
using namespace std;
 
namespace {
 
};
 
int check(int id, int n){
    int ct = 0;
    for(int i = 0; i < n; ++i){
        if (id == i) continue;
        ct += Query(id, i);
    }
    return ct;
}
 
std::vector<int> Solve(int n)
{
    std::vector<int> v;
    v.push_back(0);
 
    for(int i = 1; i < n; ++i){
        int l = -1, r = v.size();
        if (l + 1 < r){
            int mid = (l + r) >> 1;
            if (Query(i, v[mid])){
                l = mid;
            } else r = mid;
        }
        v.insert(v.begin() + l, i);
    }
    int ct = 0;
    for(int i = 0; i < n; ++i){
        if (check(v[i], n) == 1){
            swap(v[ct], v[i]);
            ++ct;
        }
        if (ct == 2) break;
    }
    if (!Query(v[0], v[1])) swap(v[0], v[1]);
    for(int i = 1; i < n - 1; ++i){
        for(int j = i + 1; j < n; ++j){
            if (Query(v[i], v[j])){
                swap(v[i + 1], v[j]);
                break;
            }
        }
    }
    return v;
}

Compilation message

monster.cpp:41:2: error: extended character   is not valid in an identifier
   41 |         if (check(v[i], n) == 1){
      |  ^
monster.cpp:41:5: error: extended character   is not valid in an identifier
   41 |         if (check(v[i], n) == 1){
      |    ^
monster.cpp:41:8: error: extended character   is not valid in an identifier
   41 |         if (check(v[i], n) == 1){
      |      ^
monster.cpp:41:11: error: extended character   is not valid in an identifier
   41 |         if (check(v[i], n) == 1){
      |        ^
monster.cpp: In function 'std::vector<int> Solve(int)':
monster.cpp:41:2: error: '\U000000a0' was not declared in this scope
   41 |         if (check(v[i], n) == 1){
      |  ^