Submission #1039313

# Submission time Handle Problem Language Result Execution time Memory
1039313 2024-07-30T17:04:41 Z Andrey Super Dango Maker (JOI22_dango3) C++17
100 / 100
641 ms 852 KB
#include "dango3.h"
#include<bits/stdc++.h>
using namespace std;

vector<int> ans[1000];
int br = 0;

void dude(int n, int m, vector<int> haha) {
    int c = haha.size()/n;
    if(c == 0) {
        return;
    }
    if(c == 1) {
        ans[br] = haha;
        br++;
        return;
    }
    int mid = c/2;
    vector<bool> yeah(haha.size(),true);
    for(int i = 0; i < haha.size(); i++) {
        vector<int> a(0);
        yeah[i] = false;
        for(int j = 0; j < haha.size(); j++) {
            if(yeah[j]) {
                a.push_back(haha[j]);
            }
        }
        if(Query(a) < mid) {
            yeah[i] = true;
        }
    }
    vector<int> a(0);
    vector<int> b(0);
    for(int i = 0; i < haha.size(); i++) {
        if(yeah[i]) {
            a.push_back(haha[i]);
        }
        else {
            b.push_back(haha[i]);
        }
    }
    dude(n,m,a);
    dude(n,m,b);
}

void Solve(int n, int m) {
    vector<int> haha(0);
    for(int i = 1; i <= n*m; i++) {
        haha.push_back(i);
    }
    dude(n,m,haha);
    for(int i = 0; i < m; i++) {
        Answer(ans[i]);
    }
}

Compilation message

dango3.cpp: In function 'void dude(int, int, std::vector<int>)':
dango3.cpp:20:22: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   20 |     for(int i = 0; i < haha.size(); i++) {
      |                    ~~^~~~~~~~~~~~~
dango3.cpp:23:26: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   23 |         for(int j = 0; j < haha.size(); j++) {
      |                        ~~^~~~~~~~~~~~~
dango3.cpp:34:22: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   34 |     for(int i = 0; i < haha.size(); i++) {
      |                    ~~^~~~~~~~~~~~~
# Verdict Execution time Memory Grader output
1 Correct 0 ms 348 KB Output is correct
2 Correct 0 ms 460 KB Output is correct
3 Correct 1 ms 348 KB Output is correct
4 Correct 0 ms 348 KB Output is correct
5 Correct 0 ms 348 KB Output is correct
6 Correct 0 ms 348 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 5 ms 348 KB Output is correct
2 Correct 6 ms 348 KB Output is correct
3 Correct 6 ms 536 KB Output is correct
4 Correct 6 ms 348 KB Output is correct
5 Correct 6 ms 344 KB Output is correct
6 Correct 5 ms 348 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 152 ms 728 KB Output is correct
2 Correct 141 ms 848 KB Output is correct
3 Correct 169 ms 848 KB Output is correct
4 Correct 159 ms 636 KB Output is correct
5 Correct 141 ms 632 KB Output is correct
6 Correct 140 ms 600 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 518 ms 768 KB Output is correct
2 Correct 548 ms 800 KB Output is correct
3 Correct 641 ms 852 KB Output is correct
4 Correct 614 ms 760 KB Output is correct
5 Correct 525 ms 784 KB Output is correct
6 Correct 508 ms 852 KB Output is correct