답안 #560090

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
560090 2022-05-11T04:00:59 Z two_sides Super Dango Maker (JOI22_dango3) C++17
2 / 100
63 ms 492 KB
#include "dango3.h"
#include <vector>
#include <iostream>

namespace {
    using namespace std;
}

void Solve(int n, int m) {
    vector<vector<int>> a(m);
    vector<char> v(n * m + 1);
    for (int i = 1; i <= n * m; i++) {
        int lo = 0, hi = m - 1;
        while (a[lo].size() == m) lo++;
        while (hi && a[hi - 1].empty()) hi--;
        while (lo < hi) {
            int mi = (lo + hi) / 2;
            fill(v.begin(), v.end(), 0);
            for (int j : a[mi])
                v[j] = true;
            v[i] = true;
            vector<int> b;
            for (int j = 1; j <= n * m; j++)
                if (!v[j]) b.push_back(j);
            if (m == Query(b) + 1) hi = mi;
            else lo = mi + 1;

        }
        a[hi].push_back(i);
    }
    for (int i = 0; i < m; i++)
        Answer(a[i]);
}

Compilation message

dango3.cpp: In function 'void Solve(int, int)':
dango3.cpp:14:29: warning: comparison of integer expressions of different signedness: 'std::vector<int>::size_type' {aka 'long unsigned int'} and 'int' [-Wsign-compare]
   14 |         while (a[lo].size() == m) lo++;
      |                ~~~~~~~~~~~~~^~~~
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 340 KB Output is correct
2 Correct 0 ms 340 KB Output is correct
3 Correct 0 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 0 ms 340 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Incorrect 1 ms 340 KB Wrong Answer [4]
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 36 ms 340 KB Wrong Answer [4]
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 63 ms 492 KB Wrong Answer [4]
2 Halted 0 ms 0 KB -