답안 #590918

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
590918 2022-07-06T14:20:21 Z keta_tsimakuridze Super Dango Maker (JOI22_dango3) C++17
100 / 100
3243 ms 880 KB
#include "dango3.h"
#include<bits/stdc++.h>
using namespace std;
#include <vector>

namespace {

int variable_example = 1;

}
/*
4 4
2 2 3 2 4 4 3 2 3 1 1 3 4 1 4 1

*/

  // namespace
const int MAX_N = 2e4;
int id[MAX_N];
vector<int> v[25];
void Solve(int N, int m) {
    vector<vector<int> > x(m);
    for(int i = 1; i <= N * m; i++) {
        int l = 0, r = m - 1;
        while(l <= r) {
            int mid = (l + r) / 2;
            vector<int> x;
            for(int j = 1; j <= N * m; j++) {
                if(j > i) x.push_back(j);
                else if(j < i && id[j] > mid) x.push_back(j);
            }
            if(m - Query(x) > mid + 1) l = mid + 1;
            else r = mid - 1, id[i] = mid;
        }
        v[id[i]].push_back(i);
    }
    for(int i = 1; i <= m; i++) Answer(v[i - 1]);

}

Compilation message

dango3.cpp:8:5: warning: '{anonymous}::variable_example' defined but not used [-Wunused-variable]
    8 | int variable_example = 1;
      |     ^~~~~~~~~~~~~~~~
# 결과 실행 시간 메모리 Grader output
1 Correct 1 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 1 ms 340 KB Output is correct
5 Correct 1 ms 340 KB Output is correct
6 Correct 1 ms 304 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 23 ms 372 KB Output is correct
2 Correct 24 ms 368 KB Output is correct
3 Correct 25 ms 380 KB Output is correct
4 Correct 26 ms 376 KB Output is correct
5 Correct 22 ms 340 KB Output is correct
6 Correct 22 ms 376 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 687 ms 480 KB Output is correct
2 Correct 733 ms 472 KB Output is correct
3 Correct 820 ms 604 KB Output is correct
4 Correct 837 ms 568 KB Output is correct
5 Correct 694 ms 588 KB Output is correct
6 Correct 674 ms 580 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 2878 ms 608 KB Output is correct
2 Correct 2806 ms 720 KB Output is correct
3 Correct 3204 ms 880 KB Output is correct
4 Correct 3243 ms 644 KB Output is correct
5 Correct 2624 ms 796 KB Output is correct
6 Correct 2630 ms 588 KB Output is correct