Submission #1162966

#TimeUsernameProblemLanguageResultExecution timeMemory
1162966zhasynSuper Dango Maker (JOI22_dango3)C++20
0 / 100
3 ms584 KiB
#include <bits/stdc++.h> #include "dango3.h" #define pb push_back #define pf push_front #define mp make_pair using namespace std; #define F first #define S second typedef long long ll; #define pii pair <int, int> #define pll pair <ll, ll> typedef long double ld; const ll N = 400 * 25 + 100, M = 4096 + 10, len = 1e5, inf = 1e18; const ll mod = 1e9 + 7; namespace { int var = 1; } // namespace bool was[N]; vector <int> gr[N]; int get(int x, int times){ vector <int> vec; for(int i = times - 1; i >= 1; i--){ vec.pb(gr[i][0]); } for(int i = 1; i <= x; i++){ if(was[i]) continue; vec.pb(i); } return Query(vec); } void Solve(int n, int m) { for(int times = 1; times <= n; times++){ int l = 0, r = n * m; for(int i = 0; i < m; i++){ while(r - l > 1){ int mid = (l + r) / 2; if(get(mid, times) >= 1) r = mid; else l = mid; } gr[times].pb(r); r = n * m; was[r] = true; } } for(int times = 1; times <= m; times++){ vector <int> vec; for(int i = 1; i <= n; i++){ vec.pb(gr[i].back()); gr[i].pop_back(); } Answer(vec); } }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...