Submission #1016253

# Submission time Handle Problem Language Result Execution time Memory
1016253 2024-07-07T14:53:32 Z walizamanee Super Dango Maker (JOI22_dango3) C++17
100 / 100
379 ms 652 KB
#include "dango3.h"
#include<bits/stdc++.h>
 
using namespace std;
 
//int Query(vector<int> hehe);
//int Answer( vector<int> lmao );
void Solve(int N, int M) {
   vector<int> one;
   for( int z = 0; z < N * M; z++ ) one.push_back(z + 1);
   for( int z = 0; z < M; z++ ) {
       vector<int> ans;
      // vector<int> one = arr;
       ans.clear();
       //ans.push_back(one[one.size() - 1]);
      // one.pop_back();
       int siz = (int)one.size();
       while( (int)ans.size() != N ) {
           long long lo = ( (long long)rand() * (long long)rand() ) % (long long)( siz );
           int lol = (int)lo;
           int bruh = one[lol];
           one.erase(one.begin() + lol);
           int an = Query(one);
           if( an != (M - z) - 1 ) one.push_back(bruh);
           else ans.push_back(bruh);
           siz--;
       }
       Answer( ans ); 
   }
}
 
/*int main() {
   for( int z = 0; z < 10; z++ ) cout << rand() << " ";
   
} */
# Verdict Execution time Memory Grader output
1 Correct 0 ms 344 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 1 ms 348 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 3 ms 604 KB Output is correct
2 Correct 2 ms 348 KB Output is correct
3 Correct 3 ms 348 KB Output is correct
4 Correct 2 ms 500 KB Output is correct
5 Correct 2 ms 348 KB Output is correct
6 Correct 2 ms 348 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 67 ms 348 KB Output is correct
2 Correct 63 ms 344 KB Output is correct
3 Correct 67 ms 348 KB Output is correct
4 Correct 69 ms 344 KB Output is correct
5 Correct 63 ms 348 KB Output is correct
6 Correct 69 ms 348 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 337 ms 648 KB Output is correct
2 Correct 345 ms 648 KB Output is correct
3 Correct 339 ms 652 KB Output is correct
4 Correct 379 ms 644 KB Output is correct
5 Correct 349 ms 600 KB Output is correct
6 Correct 366 ms 604 KB Output is correct