Submission #546178

#TimeUsernameProblemLanguageResultExecution timeMemory
546178leakedSuper Dango Maker (JOI22_dango3)C++17
2 / 100
257 ms1816 KiB
#include "dango3.h" #include <vector> #include <bits/stdc++.h> #define f first #define s second #define vec vector #define pb push_back #define all(x) (x).begin(),(x).end() #define rall(x) (x).rbegin(),(x).rend() #define pw(x) (1LL<<(x)) #define sz(x) (int)(x).size() #define m_p make_pair #define fast_prep ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0); using namespace std; typedef long long ll; typedef pair<int,int> pii; typedef long double ld; template<class T> bool umin(T &a,const T &b){return (a>b?a=b,1:0);} template<class T> bool umax(T &a,const T &b){return (a<b?a=b,1:0);} const int N=1e5+1; const ll inf=1e18; namespace { int variable_example = 1; } // namespace vec<int> ids; int n,m; void rec(vec<int> vc){ if(sz(vc)==n){ Answer(vc); return; } random_shuffle(all(vc)); vec<int> ask; for(int i=0;i<sz(vc);i++){ ask.pb(vc[i]); if(sz(ask)>=n){ if(Query(ask)==1){ for(int j=i+1;j<sz(vc);j++) ids.pb(vc[j]); rec(ask); return; } } } } void Solve(int n, int m) { ::n=n;::m=m; // vec<int> ids; for(int i=1;i<=n*m;i++) ids.pb(i); // queue<vec<int>> q; // q.push(ids); int i=0; while(sz(ids)){ vec<int> ask; vec<int> vc=ids; ids.clear(); // cerr<<"SZ "<<sz(ids)<<endl; for(int i=0;i<sz(vc);i++){ ask.pb(vc[i]); if(sz(ask)>=n){ if(Query(ask)==1){ rec(ask); for(int j=i+1;j<sz(vc);j++) ids.pb(vc[j]); break; } } } } } /* 3 2 3 3 1 2 1 2 4 4 2 2 3 2 4 4 3 2 3 1 1 3 4 1 4 1 */

Compilation message (stderr)

dango3.cpp: In function 'void Solve(int, int)':
dango3.cpp:59:9: warning: unused variable 'i' [-Wunused-variable]
   59 |     int i=0;
      |         ^
dango3.cpp: At global scope:
dango3.cpp:26:5: warning: '{anonymous}::variable_example' defined but not used [-Wunused-variable]
   26 | int variable_example = 1;
      |     ^~~~~~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...