Submission #799573

# Submission time Handle Problem Language Result Execution time Memory
799573 2023-07-31T16:06:40 Z eltu0815 Super Dango Maker (JOI22_dango3) C++17
100 / 100
1058 ms 624 KB
#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

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 time Memory Grader output
1 Correct 1 ms 340 KB Output is correct
2 Correct 0 ms 308 KB Output is correct
3 Correct 1 ms 308 KB Output is correct
4 Correct 0 ms 308 KB Output is correct
5 Correct 1 ms 340 KB Output is correct
6 Correct 0 ms 340 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 8 ms 340 KB Output is correct
2 Correct 8 ms 384 KB Output is correct
3 Correct 7 ms 340 KB Output is correct
4 Correct 7 ms 340 KB Output is correct
5 Correct 9 ms 380 KB Output is correct
6 Correct 8 ms 308 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 227 ms 484 KB Output is correct
2 Correct 234 ms 468 KB Output is correct
3 Correct 232 ms 452 KB Output is correct
4 Correct 228 ms 484 KB Output is correct
5 Correct 236 ms 476 KB Output is correct
6 Correct 218 ms 596 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1027 ms 612 KB Output is correct
2 Correct 1058 ms 612 KB Output is correct
3 Correct 979 ms 608 KB Output is correct
4 Correct 1044 ms 612 KB Output is correct
5 Correct 932 ms 624 KB Output is correct
6 Correct 984 ms 612 KB Output is correct