Submission #1031133

#TimeUsernameProblemLanguageResultExecution timeMemory
1031133peraSuper Dango Maker (JOI22_dango3)C++17
100 / 100
2454 ms1772 KiB
#include<bits/stdc++.h> #include "dango3.h" using namespace std; /* int Query(vector<int> v){ cout << "? "; for(int x : v){ cout << x << " "; } cout << endl; int x; cin >> x; return x; } void Answer(vector<int> v){ cout << "! "; for(int x : v){ cout << x << " "; } cout << endl; }*/ void Solve(int N , int M){ vector<vector<int>> a(M + 1) , u(M + 1 , vector<int>(N * M + 1)); for(int i = 1;i <= N * M;i ++){ int pos = 0; for(int bit = 4;bit >= 0;bit --){ int v = pos + (1 << bit) , bad = 0; if(v <= M){ vector<int> t; for(int j = 1;j <= N * M;j ++){ if(!u[v][j] && j != i){ t.push_back(j); } } bad = (M - Query(t) == 2); } if(bad){ pos = v; } } ++pos; a[pos].push_back(i); u[pos][i] = 1; } for(int i = 1;i <= M;i ++){ Answer(a[i]); } }/* int main(){ Solve(3 , 2); }*/
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...