Submission #1029607

# Submission time Handle Problem Language Result Execution time Memory
1029607 2024-07-21T05:44:05 Z Otalp Super Dango Maker (JOI22_dango3) C++17
7 / 100
4180 ms 1004 KB
#include "dango3.h"
#include<bits/stdc++.h>
using namespace std;
#define pb push_back


namespace {

int variable_example = 1;

}  // namespace

void Solve(int N, int M) {
    int n = N, m = M;
    map<int, int> us;
    vector<int> rs;
    for(int i=1; i<=n*m; i++){
        rs.pb(i);
    }
    random_shuffle(rs.begin(), rs.end());
    for(int i=1; i<=m; i++){
        vector<int> d;
        for(int j: rs){
            if(us[j]) continue;
            d.pb(j);
            if(d.size() >= n){
                int g = Query(d);
                if(g) break;
            }
        }
        map<int, int> dus;
        for(int x: d){
            vector<int> f;
            for(int y: d){
                if(x == y) continue;
                if(dus[y]) continue;
                f.pb(y);
            }
            int g = Query(f);
            if(g == 1){
                dus[x] = 1;
            }
            else{
                us[x] = 1;
            }
        }
        vector<int> f;
        for(int x: d){
            if(us[x]) f.pb(x);
        }
        Answer(f);
    }
}

Compilation message

dango3.cpp: In function 'void Solve(int, int)':
dango3.cpp:26:25: warning: comparison of integer expressions of different signedness: 'std::vector<int>::size_type' {aka 'long unsigned int'} and 'int' [-Wsign-compare]
   26 |             if(d.size() >= n){
      |                ~~~~~~~~~^~~~
dango3.cpp: At global scope:
dango3.cpp:9:5: warning: '{anonymous}::variable_example' defined but not used [-Wunused-variable]
    9 | int variable_example = 1;
      |     ^~~~~~~~~~~~~~~~
# Verdict Execution time Memory Grader output
1 Correct 0 ms 348 KB Output is correct
2 Correct 0 ms 348 KB Output is correct
3 Correct 0 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 21 ms 348 KB Output is correct
2 Correct 25 ms 552 KB Output is correct
3 Correct 19 ms 348 KB Output is correct
4 Correct 19 ms 552 KB Output is correct
5 Correct 17 ms 536 KB Output is correct
6 Correct 19 ms 436 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 443 ms 680 KB Output is correct
2 Incorrect 526 ms 684 KB Wrong Answer [3]
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 4180 ms 1004 KB Wrong Answer [3]
2 Halted 0 ms 0 KB -