답안 #596800

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
596800 2022-07-15T05:44:11 Z 반딧불(#8447) Super Dango Maker (JOI22_dango3) C++17
100 / 100
660 ms 672 KB
#include "dango3.h"
#include <bits/stdc++.h>

using namespace std;

namespace {
    int n, k;

    void dnc(vector<int> &vec, int cnt){
        if(cnt == 1){
            Answer(vec);
            return;
        }
        int mid = cnt/2;
        vector<int> vec1 = vec;
        vector<int> vec2;
        for(int i=0; i<(int)vec.size(); i++){
            vec1.erase(find(vec1.begin(), vec1.end(), vec[i]));
            if(Query(vec1) < mid) vec1.push_back(vec[i]);
            else vec2.push_back(vec[i]);
        }
        dnc(vec1, mid);
        dnc(vec2, cnt-mid);
    }
}

void Solve(int N, int M){
    n = N, k = M;
    vector<int> vec;
    for(int i=1; i<=n*k; i++) vec.push_back(i);
    dnc(vec, k);
}
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 340 KB Output is correct
2 Correct 1 ms 340 KB Output is correct
3 Correct 1 ms 340 KB Output is correct
4 Correct 0 ms 340 KB Output is correct
5 Correct 1 ms 340 KB Output is correct
6 Correct 1 ms 340 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 8 ms 340 KB Output is correct
2 Correct 6 ms 340 KB Output is correct
3 Correct 9 ms 304 KB Output is correct
4 Correct 9 ms 368 KB Output is correct
5 Correct 6 ms 304 KB Output is correct
6 Correct 7 ms 380 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 164 ms 460 KB Output is correct
2 Correct 162 ms 468 KB Output is correct
3 Correct 163 ms 440 KB Output is correct
4 Correct 168 ms 472 KB Output is correct
5 Correct 148 ms 472 KB Output is correct
6 Correct 152 ms 444 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 468 ms 584 KB Output is correct
2 Correct 660 ms 592 KB Output is correct
3 Correct 631 ms 672 KB Output is correct
4 Correct 614 ms 588 KB Output is correct
5 Correct 596 ms 668 KB Output is correct
6 Correct 492 ms 588 KB Output is correct