제출 #1363923

#제출 시각아이디문제언어결과실행 시간메모리
1363923inesfiIsland Hopping (JOI24_island)C++20
100 / 100
2 ms416 KiB
#include "island.h"
#include<bits/stdc++.h>
using namespace std;

const int TAILLEMAXI=302;
bool dejavu[TAILLEMAXI];
int pere[TAILLEMAXI];

void q(int a, int b, int c){
    cout<<"query "<<a<<" "<<b<<" rep "<<c<<endl;
}

void solve(int n, int nbquest_max) {
    dejavu[1] = true;
    for (int i=1;i<n;i++){
        int ec = query(1, i);
        //q(1, i, ec);
        dejavu[ec] = true;
        if (pere[ec] == 0){
            int vois = query(ec, 1);
            //q(ec, 1, vois);
            int compt = 1;
            while (!dejavu[vois]){
                pere[vois] = ec;
                compt ++;
                vois = query(ec, compt);
                //q(ec, compt, vois);
            }
            pere[ec] = vois;
        }
    }
    for (int i=2;i<=n;i++){
        //cerr<<i<<" "<<pere[i]<<endl;
        answer(i, pere[i]);
    }
}
#결과 실행 시간메모리채점기 출력
결과를 불러오는 중입니다…
#결과 실행 시간메모리채점기 출력
결과를 불러오는 중입니다…
#결과 실행 시간메모리채점기 출력
결과를 불러오는 중입니다…
#결과 실행 시간메모리채점기 출력
결과를 불러오는 중입니다…
#결과 실행 시간메모리채점기 출력
결과를 불러오는 중입니다…
#결과 실행 시간메모리채점기 출력
결과를 불러오는 중입니다…
#결과 실행 시간메모리채점기 출력
결과를 불러오는 중입니다…
#결과 실행 시간메모리채점기 출력
결과를 불러오는 중입니다…