답안 #1077918

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
1077918 2024-08-27T10:33:26 Z 0npata Super Dango Maker (JOI22_dango3) C++17
100 / 100
1905 ms 1408 KB
#include "dango3.h"
#include<bits/stdc++.h>
using namespace std;

#define vec vector

const int MXSZ = 400*25;

void Solve(int N, int M) {
    vec<int> all(N*M);
    iota(all.begin(), all.end(), 1);

    function<void(vec<int>)> divandconq = [&](vec<int> v) {
        if(v.size() == N){
            Answer(v);
            return;
            }
        vec<int> v1{};
        vec<int> v2{};
        set<int> cur;

        for(int i : v) cur.insert(i);

        int tm = (v.size()/N)/2;
        for(int i = 0; i<v.size(); i++) {
            cur.erase(v[i]);
            if(Query(vec<int>(cur.begin(), cur.end())) >= tm) {
                v1.push_back(v[i]);
            }
            else {
                v2.push_back(v[i]);
                cur.insert(v[i]);
            }
        }

        divandconq(v1);
        divandconq(v2);
    };

    divandconq(all);
}

Compilation message

dango3.cpp: In lambda function:
dango3.cpp:14:21: warning: comparison of integer expressions of different signedness: 'std::vector<int>::size_type' {aka 'long unsigned int'} and 'int' [-Wsign-compare]
   14 |         if(v.size() == N){
      |            ~~~~~~~~~^~~~
dango3.cpp:25:25: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   25 |         for(int i = 0; i<v.size(); i++) {
      |                        ~^~~~~~~~~
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 348 KB Output is correct
2 Correct 1 ms 348 KB Output is correct
3 Correct 0 ms 348 KB Output is correct
4 Correct 1 ms 348 KB Output is correct
5 Correct 0 ms 348 KB Output is correct
6 Correct 0 ms 348 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 12 ms 344 KB Output is correct
2 Correct 13 ms 348 KB Output is correct
3 Correct 15 ms 348 KB Output is correct
4 Correct 15 ms 576 KB Output is correct
5 Correct 12 ms 344 KB Output is correct
6 Correct 11 ms 344 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 326 ms 812 KB Output is correct
2 Correct 334 ms 876 KB Output is correct
3 Correct 418 ms 804 KB Output is correct
4 Correct 426 ms 864 KB Output is correct
5 Correct 312 ms 852 KB Output is correct
6 Correct 324 ms 796 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 1402 ms 1116 KB Output is correct
2 Correct 1397 ms 1144 KB Output is correct
3 Correct 1851 ms 1408 KB Output is correct
4 Correct 1905 ms 1128 KB Output is correct
5 Correct 1283 ms 1144 KB Output is correct
6 Correct 1342 ms 1116 KB Output is correct