답안 #1033249

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
1033249 2024-07-24T15:06:37 Z adaawf Super Dango Maker (JOI22_dango3) C++17
100 / 100
2404 ms 1580 KB
#include <bits/stdc++.h>
#include "dango3.h"
using namespace std;
/*void Print(vector<int> v) {
    for (int w : v) cout << w << " ";
    cout << '\n';
}
int Query(vector<int> v) {
    Print(v);
    int k;
    cin >> k;
    return k;
}
void Answer(vector<int> v) {
    Print(v);
}
void Solve(int n, int m);
int main() {
    int n = 4, m = 4;
    Solve(n, m);
}*/
int dd[26][10005];
void Solve(int n, int m) {
    vector<vector<int>> res(m);
    for (int i = 1; i <= n * m; i++) {
        int l = 0, r = m, h = m - 1;
        while (l <= r) {
            int mid = (l + r) / 2;
            vector<int> v;
            for (int j = 1; j <= n * m; j++) {
                if (dd[mid][j] == 1 || i == j) continue;
                v.push_back(j);
            }
            if (Query(v) == m - 2) {
                l = mid + 1;
            }
            else {
                h = mid;
                r = mid - 1;
            }
        }
        res[h].push_back(i);
        dd[h][i] = 1;
    }
    for (auto w : res) Answer(w);
}
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 344 KB Output is correct
2 Correct 0 ms 348 KB Output is correct
3 Correct 0 ms 348 KB Output is correct
4 Correct 0 ms 348 KB Output is correct
5 Correct 0 ms 348 KB Output is correct
6 Correct 1 ms 348 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 11 ms 348 KB Output is correct
2 Correct 11 ms 556 KB Output is correct
3 Correct 11 ms 348 KB Output is correct
4 Correct 12 ms 544 KB Output is correct
5 Correct 11 ms 344 KB Output is correct
6 Correct 11 ms 348 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 512 ms 852 KB Output is correct
2 Correct 530 ms 848 KB Output is correct
3 Correct 616 ms 1104 KB Output is correct
4 Correct 568 ms 1104 KB Output is correct
5 Correct 534 ms 604 KB Output is correct
6 Correct 548 ms 596 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 2148 ms 1156 KB Output is correct
2 Correct 2250 ms 1196 KB Output is correct
3 Correct 2373 ms 1580 KB Output is correct
4 Correct 2404 ms 1536 KB Output is correct
5 Correct 2199 ms 848 KB Output is correct
6 Correct 2164 ms 848 KB Output is correct