답안 #1077665

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
1077665 2024-08-27T08:32:07 Z azberjibiou Minerals (JOI19_minerals) C++17
컴파일 오류
0 ms 0 KB
#include "minerals.h"
#include <bits/stdc++.h>
using namespace std;

int solv(vector <int> v, int pval, bool ud){
    int sz=v.size();
    assert(sz%2==0);
    if(sz==2){
        Answer(v[0], v[1]);
        return pval;
    }
    int mid=sz/4;
    vector <int> nv1, nv2;
    for(int i=0;i<sz;i++){
        int now=Query(v[i]);
        if((ud && now>pval+mid) || (!ud && now<pval-mid)){
            nv1.push_back(v[i]);
            Query(v[i]);
        }
        else{
            nv2.push_back(v[i]);
        }
    }
    int nxtv=solv(nv1, pval+(ud ? mid : -mid), ud);
    return solv(nv2, nxtv, ud^1);
}
void Solve(int N) {
    vector <int> v;
    for(int i=1;i<=2*N;i++) v.push_back(i);
    solv(v, 0, 1);
}

Compilation message

minerals.cpp:7:2: error: extended character   is not valid in an identifier
    7 |     assert(sz%2==0);
      |  ^
minerals.cpp:7:5: error: extended character   is not valid in an identifier
    7 |     assert(sz%2==0);
      |    ^
minerals.cpp:8:2: error: extended character   is not valid in an identifier
    8 |     if(sz==2){
      |  ^
minerals.cpp:8:5: error: extended character   is not valid in an identifier
    8 |     if(sz==2){
      |    ^
minerals.cpp: In function 'int solv(std::vector<int>, int, bool)':
minerals.cpp:7:2: error: '\U000000a0' was not declared in this scope
    7 |     assert(sz%2==0);
      |  ^
minerals.cpp:8:4: error: expected ';' before '\U000000a0if'
    8 |     if(sz==2){
      |   ^~~~
      |   ;