답안 #806881

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
806881 2023-08-04T10:45:05 Z oscar1f Minerals (JOI19_minerals) C++17
컴파일 오류
0 ms 0 KB
#include<bits/stdc++.h>
#include "cartes.hpp"
using namespace std;

int nbCartes;

vector<int> groupeDeb1,groupeDeb2;

void calc(vector<int> gp1,vector<int> gp2,int mis1) {
    /*for (int i:gp1) {
        cout<<i<<" ";
    }
    cout<<"    ";
    for (int i:gp2) {
        cout<<i<<" ";
    }
    cout<<endl;*/
    if (gp1.size()==1) {
        Answer(gp1[0],gp2[0]);
        return;
    }
    int dernRep=0,ans,mid;
    vector<int> nouvDeb1,nouvDeb2,nouvFin1,nouvFin2;
    if (gp1.size()<6) {
        mid=(gp1.size()+mis1)/2;    
    }
    else {
        if (mis1==0) {
            mid=3849*gp1.size()/10000;
        }
        else {
            mid=6167*gp1.size()/10000;
        }
    }
    for (int i=0;i<mid;i++) {
        nouvDeb1.push_back(gp1[i]);
    }
    for (int i=mid;i<(int)gp1.size();i++) {
        nouvFin1.push_back(gp1[i]);
    }

    if (mis1==0) {
        for (int i:nouvDeb1) {
            dernRep=Query(i);
        }
    }
    else {
        for (int i:nouvFin1) {
            dernRep=Query(i);
        }
    }
    for (int i:gp2) {
        if (i!=gp2.back()) {
            ans=Query(i);
            if (ans==dernRep) {
                nouvDeb2.push_back(i);
            }
            else {
                nouvFin2.push_back(i);
            }
            dernRep=ans;
        }
        else {
            if (nouvDeb2.size()==mid) {
                nouvFin2.push_back(i);
            }
            else {
                nouvDeb2.push_back(i);
            }
        }
    }
    calc(nouvDeb1,nouvDeb2,1);
    calc(nouvFin1,nouvFin2,0);
}

void Solve(int N) {
    nbCartes=N;
    int anci=0,ans;
    for (int i=1;i<=2*nbCartes;i++) {
        ans=Query(i);
        if (ans>anci) {
            groupeDeb1.push_back(i);
        }
        else {
            groupeDeb2.push_back(i);
        }
        anci=ans;
    }
    calc(groupeDeb1,groupeDeb2,1);
}

Compilation message

minerals.cpp:2:10: fatal error: cartes.hpp: No such file or directory
    2 | #include "cartes.hpp"
      |          ^~~~~~~~~~~~
compilation terminated.