답안 #754358

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
754358 2023-06-07T14:53:23 Z bachhoangxuan Super Dango Maker (JOI22_dango3) C++17
100 / 100
787 ms 788 KB
#include "dango3.h"
#include <bits/stdc++.h>
using namespace std;

void Solve(int N, int M) {
    function<void(int,vector<int>)> dnc = [&](int m,vector<int> x){
        if(m==1){Answer(x);return;}
        int k=m/2;
        vector<int> x1;
        for(int i=N*m-1;i>=0;i--){
            int d=x[i];x.erase(x.begin()+i);
            if(Query(x)>=k) x1.push_back(d);
            else x.insert(x.begin()+i,d);
        }
        dnc(k,x);dnc(m-k,x1);
    };
    vector<int> x;
    for(int i=1;i<=N*M;i++) x.push_back(i);
    dnc(M,x);
}
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 340 KB Output is correct
2 Correct 1 ms 300 KB Output is correct
3 Correct 1 ms 304 KB Output is correct
4 Correct 1 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 4 ms 340 KB Output is correct
2 Correct 6 ms 300 KB Output is correct
3 Correct 8 ms 372 KB Output is correct
4 Correct 6 ms 304 KB Output is correct
5 Correct 7 ms 300 KB Output is correct
6 Correct 5 ms 340 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 170 ms 468 KB Output is correct
2 Correct 150 ms 456 KB Output is correct
3 Correct 192 ms 456 KB Output is correct
4 Correct 155 ms 436 KB Output is correct
5 Correct 159 ms 468 KB Output is correct
6 Correct 168 ms 472 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 694 ms 696 KB Output is correct
2 Correct 630 ms 588 KB Output is correct
3 Correct 787 ms 788 KB Output is correct
4 Correct 757 ms 648 KB Output is correct
5 Correct 637 ms 788 KB Output is correct
6 Correct 664 ms 696 KB Output is correct