#pragma GCC optimize ("O3") #pragma GCC target ("avx") #include using namespace std; typedef long long ll; #define rep(i, n) for(int i = 0; i < (n); i++) #define rep1(i, n) for(int i = 1; i <= (n); i++) #define co(x) cout << (x) << "\n" #define cosp(x) cout << (x) << " " #define ce(x) cerr << (x) << "\n" #define cesp(x) cerr << (x) << " " #define pb push_back #define mp make_pair #define chmin(x, y) x = min(x, y) #define chmax(x, y) x = max(x, y) #define Would #define you #define please int N; bool K[1000] = {0,0,0,1,1,0,0,1,0,1}; bool A[1000] = {}; string query() { string RA = "? " + to_string(N - 1) + '\n'; rep(i, N) if(A[i]) RA += " " + to_string(i + 1); cout << RA << endl; string ret; //ここにお試し処理 //bool baku = 1; //rep(i, N) if (K[i] && !A[i]) { // baku = 0; //} //if (baku) ret = "1"; //else ret = "0"; //ここに本番処理 cin >> ret; return ret; } int main() { cin >> N; rep(i, N) { A[i] = 1; } vector kotae; rep(i, N) { A[i] = 0; string S = query(); if (S == "0") { kotae.pb(i + 1); } cout << query() << endl; A[i] = 1; } string ans = "! "; ans += to_string((int)kotae.size()); ans += '\n'; rep(i, kotae.size()) ans += to_string(kotae[i]) + " "; co(ans); Would you please return 0; }