Submission #1033113

#TimeUsernameProblemLanguageResultExecution timeMemory
1033113shenfe1Super Dango Maker (JOI22_dango3)C++17
22 / 100
10065 ms1172 KiB
#include "dango3.h" #include <bits/stdc++.h> using namespace std; #define pb push_back #define all(v) v.begin(),v.end() #define sz(s) (int)s.size() #define ppb pop_back mt19937 rng(chrono::steady_clock::now().time_since_epoch().count()); int n,m; set<int> st; vector<int> xo(vector<vector<int>> a,int mid){ for(int i=0;i<=mid;i++){ for(int j=0;j<sz(a[i]);j++){ st.erase(a[i][j]); } } vector<int> vec; for(int x:st)vec.pb(x); for(int i=0;i<=mid;i++){ for(int j=0;j<sz(a[i]);j++){ st.insert(a[i][j]); } } return vec; } void Solve(int N, int M) { n=N,m=M; for(int i=1;i<=n*m;i++)st.insert(i); vector<vector<int>> a(M); for(int i=1;i<=N*M;i++){ int l=0,r=M-1,res=M-1; while(l<=r){ int m=(l+r)/2; a[m].pb(i); if(M-Query(xo(a,m))==m+2){ l=m+1; } else{ r=m-1; res=m; } a[m].ppb(); } // cout<<i<<" "<<res<<'\n'; a[res].pb(i); } for(int i=0;i<M;i++)Answer(a[i]); }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...