Submission #892553

#TimeUsernameProblemLanguageResultExecution timeMemory
892553NurislamSuper Dango Maker (JOI22_dango3)C++17
0 / 100
1 ms604 KiB
#include <bits/stdc++.h> #include "dango3.h" using namespace std; #define ff first #define ss second #define pb push_back #define all(x) x.begin(),x.end() #define rall(x) x.rbegin(),x.rend() //~ #define int long long typedef vector<int> vi; typedef pair<int,int> pii; typedef vector<pair<int,int> > vii; /* __ __ __ */ /* ====== _ /| /| __ _ / | | /| | @ | | | | / /| |\ | / | | @ | / */ /* || |_| |_ / |/ | | | |_ |- | |--| /-| | | \ \ |==| |- /=| | \ | | |--| | |- */ /* || | | |_ / | |__| _| |_ \__ | | / | |__ | __| | | | \ / | | \| \__ | | | | \ */ /* */ vector<vi> ans; void rec(vi v, int m){ if(m == 1){ ans.pb(v); return; } vi a1, a2; while(!v.empty()){ int res = v.back(); v.pop_back(); for(int i:a1)v.pb(i); int x = Query(v); int k = a1.size(); while(k--)v.pop_back(); if(x > m/2+(m&1)){ a2.pb(res); }else{ a1.pb(res); } } rec(a1, m/2+(m&1)); rec(a2, m/2); } void Solve(int N, int M) { vi v; for(int i = 0; i < N*M; i++){ v.pb(i); } rec(v, M); for(auto i:ans){ Answer(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...