Submission #754865

# Submission time Handle Problem Language Result Execution time Memory
754865 2023-06-08T19:02:14 Z definitelynotmee Super Dango Maker (JOI22_dango3) C++17
100 / 100
3571 ms 832 KB
#include "dango3.h"
#include<bits/stdc++.h>
#define ff first
#define ss second
#define all(x) x.begin(), x.end()
using namespace std;
using ll = long long;
using pii = pair<int,int>;
using pll = pair<ll,ll>;
template<typename T>
using matrix = vector<vector<T>>;

namespace {

int variable_example = 1;

}  // namespace

void Solve(int N, int M) {
    matrix<int> resp(M);

    for(int i = 1; i <= N*M; i++){
        int ini = 0, fim = M-1;

        while(ini!=fim){
            int m = (ini+fim)>>1;

            vector<int> ban(N*M);

            for(int i = m+1; i < M; i++){
                for(int j : resp[i])
                    ban[j] = 1;
            }
            ban[i] = 1;

            vector<int> qry;
            for(int i = 1; i <= N*M; i++){
                if(!ban[i])
                    qry.push_back(i);
            }

            if(Query(qry) <= m)
                fim = m;
            else ini = m+1;
        }

        resp[ini].push_back(i);
    }
    // for(int i = 0; i < M; i++){
    //     for(int j : resp[i])
    //         cout << j << ' ';
    //     cout << '\n';
    // }

    for(int i = 0; i < M; i++)
        Answer(resp[i]);
}

Compilation message

dango3.cpp:15:5: warning: '{anonymous}::variable_example' defined but not used [-Wunused-variable]
   15 | int variable_example = 1;
      |     ^~~~~~~~~~~~~~~~
# Verdict Execution time Memory 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 300 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 27 ms 364 KB Output is correct
2 Correct 29 ms 368 KB Output is correct
3 Correct 30 ms 372 KB Output is correct
4 Correct 31 ms 464 KB Output is correct
5 Correct 29 ms 352 KB Output is correct
6 Correct 29 ms 340 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 835 ms 456 KB Output is correct
2 Correct 879 ms 480 KB Output is correct
3 Correct 907 ms 616 KB Output is correct
4 Correct 927 ms 472 KB Output is correct
5 Correct 837 ms 460 KB Output is correct
6 Correct 860 ms 468 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 3445 ms 620 KB Output is correct
2 Correct 3420 ms 708 KB Output is correct
3 Correct 3547 ms 624 KB Output is correct
4 Correct 3571 ms 832 KB Output is correct
5 Correct 3372 ms 668 KB Output is correct
6 Correct 3305 ms 720 KB Output is correct