Submission #1005704

# Submission time Handle Problem Language Result Execution time Memory
1005704 2024-06-22T20:31:54 Z enzy Super Dango Maker (JOI22_dango3) C++17
100 / 100
1522 ms 912 KB
#include "dango3.h"
#include<bits/stdc++.h>
using namespace std;

void Solve(int n, int m) {
  /*std::vector<int> x(3);
  x[0] = 1;
  x[1] = 2;
  x[2] = 3;
  variable_example = Query(x);
  for (int i = 0; i < M; i++) {
    vector<int> a(N);
    for (int j = 0; j < N; j++) {
      a[j] = N * i + j + 1;
    }
    Answer(a);
}*/
    vector<int>v[m+1];
    for(int i=1;i<=n*m;i++){
        int l=1, r=m;
        while(l<r){
            int mid=(l+r)/2;
            vector<int>q;
            for(int j=i+1;j<=n*m;j++) q.push_back(j);
            for(int j=mid+1;j<=m;j++)
                for(int k=0;k<v[j].size();k++) q.push_back(v[j][k]);
            int check=Query(q);
            if(check>=m-mid) r=mid;
            else l=mid+1;
        }
        v[l].push_back(i);
    }
    for(int i=1;i<=m;i++) Answer(v[i]);
}

Compilation message

dango3.cpp: In function 'void Solve(int, int)':
dango3.cpp:26:30: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   26 |                 for(int k=0;k<v[j].size();k++) q.push_back(v[j][k]);
      |                             ~^~~~~~~~~~~~
# Verdict Execution time Memory Grader output
1 Correct 0 ms 348 KB Output is correct
2 Correct 1 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 7 ms 348 KB Output is correct
2 Correct 7 ms 508 KB Output is correct
3 Correct 9 ms 348 KB Output is correct
4 Correct 8 ms 348 KB Output is correct
5 Correct 7 ms 500 KB Output is correct
6 Correct 7 ms 500 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 269 ms 344 KB Output is correct
2 Correct 265 ms 592 KB Output is correct
3 Correct 364 ms 596 KB Output is correct
4 Correct 375 ms 588 KB Output is correct
5 Correct 250 ms 348 KB Output is correct
6 Correct 269 ms 596 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1134 ms 908 KB Output is correct
2 Correct 1228 ms 600 KB Output is correct
3 Correct 1522 ms 600 KB Output is correct
4 Correct 1507 ms 912 KB Output is correct
5 Correct 1034 ms 668 KB Output is correct
6 Correct 1156 ms 648 KB Output is correct