Submission #1257752

#TimeUsernameProblemLanguageResultExecution timeMemory
1257752tolbiSuper Dango Maker (JOI22_dango3)C++20
0 / 100
4 ms584 KiB
#include "dango3.h" #include <bits/stdc++.h> using namespace std; mt19937 ayahya(chrono::high_resolution_clock().now().time_since_epoch().count()); #define coutarr(x) for (auto &it : x) cout<<it<<" ";cout<<endl; const int X = 1000; void Solve(int N, int M) { vector<int> a(N * M); iota(a.begin(), a.end(), 0); while (a.size() > 0){ vector<int> b; for (int i = 0; i < a.size(); i++){ swap(a[i], a[ayahya()%(i+1)]); } while (a.size() && b.size() < X){ b.push_back(a.back()); a.pop_back(); } if (Query(b) == 0){ for (auto it : b){ a.push_back(it); } continue; } int cur = 0; while (b.size() > M){ int x = b.back(); b.pop_back(); if (Query(b) == 0){ b.push_back(x); swap(b.back(), b[cur++]); } } Answer(b); } }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...