Submission #635960

# Submission time Handle Problem Language Result Execution time Memory
635960 2022-08-27T13:13:28 Z Cross_Ratio Super Dango Maker (JOI22_dango3) C++17
2 / 100
2377 ms 480 KB
#include "dango3.h"
#include <bits/stdc++.h>
using namespace std;
int Query(const vector<int>&);
void Answer(const vector<int>&);
vector<vector<int>> A;
vector<int> V;
void Solve(int N, int M) {
    A.resize(M);
    int i, j;
    for(i=1;i<=N*M;i++) V.push_back(i);
    //random_shuffle(V.begin(),V.end());
    int pt = 0;
    vector<int> V2;
    while(V.size()) {
        int k = V.back();
        V.pop_back();
        for(int n : V2) V.push_back(n);
        int k2 = Query(V);
        for(int n : V2) V.pop_back();
        if(k2==M-1-pt) {
            A[pt].push_back(k);
            for(int n : V2) V.push_back(n);
            V2.clear();
            if(A[pt].size()==N) {
                pt++;
                for(int n : V2) V.push_back(n);
                V2.clear();
            }
        }
        else {
            V2.push_back(k);
        }
    }
    for(i=0;i<M;i++) {
        Answer(A[i]);
    }
}

Compilation message

dango3.cpp: In function 'void Solve(int, int)':
dango3.cpp:20:17: warning: unused variable 'n' [-Wunused-variable]
   20 |         for(int n : V2) V.pop_back();
      |                 ^
dango3.cpp:25:28: warning: comparison of integer expressions of different signedness: 'std::vector<int>::size_type' {aka 'long unsigned int'} and 'int' [-Wsign-compare]
   25 |             if(A[pt].size()==N) {
      |                ~~~~~~~~~~~~^~~
dango3.cpp:10:12: warning: unused variable 'j' [-Wunused-variable]
   10 |     int i, j;
      |            ^
# Verdict Execution time Memory Grader output
1 Correct 0 ms 340 KB Output is correct
2 Correct 0 ms 340 KB Output is correct
3 Correct 0 ms 340 KB Output is correct
4 Correct 1 ms 340 KB Output is correct
5 Correct 0 ms 340 KB Output is correct
6 Correct 0 ms 340 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 94 ms 352 KB Output is correct
2 Correct 116 ms 364 KB Output is correct
3 Incorrect 280 ms 468 KB Wrong Answer [3]
4 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1059 ms 412 KB Wrong Answer [3]
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 2377 ms 480 KB Wrong Answer [3]
2 Halted 0 ms 0 KB -