Submission #799573

#TimeUsernameProblemLanguageResultExecution timeMemory
799573eltu0815Super Dango Maker (JOI22_dango3)C++17
100 / 100
1058 ms624 KiB
#include "dango3.h"

#include <bits/stdc++.h>
using namespace std;

typedef int ll;
typedef pair<ll, ll> pll;

ll chk[100000];
vector<ll> tmp;
vector<ll> tmp2;
vector<ll> ans;

void Solve(int N, int M) {
    for(ll i = M; i >= 1; --i) {
        ans.clear(); tmp2.clear();
        for(ll j = 1; j <= N * M; ++j) if(!chk[j]) tmp2.push_back(j);
        random_shuffle(tmp2.begin(), tmp2.end());
        for(auto j : tmp2) {
            if(ans.size() == N) break;
            tmp.clear();
            for(auto k : tmp2) if(k != j && !chk[k]) tmp.push_back(k);
            if(Query(tmp) == i - 1) chk[j] = 1, ans.push_back(j);
        }
        
        Answer(ans);
    }
    return;
}

Compilation message (stderr)

dango3.cpp: In function 'void Solve(int, int)':
dango3.cpp:20:27: warning: comparison of integer expressions of different signedness: 'std::vector<int>::size_type' {aka 'long unsigned int'} and 'int' [-Wsign-compare]
   20 |             if(ans.size() == N) break;
      |                ~~~~~~~~~~~^~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...