Submission #922153

# Submission time Handle Problem Language Result Execution time Memory
922153 2024-02-05T07:29:41 Z huutuan Super Dango Maker (JOI22_dango3) C++17
22 / 100
141 ms 616 KB
#include "dango3.h"

#include <bits/stdc++.h>

using namespace std;

void Solve(int n, int m){
   vector<int> idx;
   for (int i=1; i<=n*m; ++i) idx.push_back(i);
   for (int i=0; i<m-1; ++i){
      vector<int> cur;
      int cr=(int)idx.size()-1;
      while ((int)cur.size()!=n){
         int l=0, r=cr;
         while (l<=r){
            int mid=(l+r)>>1;
            vector<int> query(idx.begin(), idx.begin()+mid+1);
            query.insert(query.end(), cur.begin(), cur.end());
            if (Query(query)>=1) r=mid-1;
            else l=mid+1;
         }
         cur.push_back(idx[l]);
         cr=l-1;
         idx.erase(idx.begin()+l);
      }
      Answer(cur);
   }
   Answer(idx);
}
# Verdict Execution time Memory Grader output
1 Correct 1 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 440 KB Output is correct
6 Correct 1 ms 348 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 3 ms 348 KB Output is correct
2 Correct 3 ms 348 KB Output is correct
3 Correct 5 ms 532 KB Output is correct
4 Correct 5 ms 352 KB Output is correct
5 Correct 3 ms 348 KB Output is correct
6 Correct 2 ms 348 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 34 ms 600 KB Output is correct
2 Correct 33 ms 604 KB Output is correct
3 Correct 141 ms 616 KB Output is correct
4 Correct 141 ms 604 KB Output is correct
5 Correct 22 ms 600 KB Output is correct
6 Correct 22 ms 348 KB Output is correct
# Verdict Execution time Memory Grader output
1 Incorrect 93 ms 604 KB Wrong Answer [3]
2 Halted 0 ms 0 KB -