QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#565081 | #8469. Comedy’s Not Omnipotent | ucup-team1231# | WA | 106ms | 4184kb | C++14 | 1.6kb | 2024-09-15 20:10:28 | 2024-09-15 20:10:28 |
Judging History
answer
#include <bits/stdc++.h>
using namespace std;
#define MOD 1000000007
typedef vector<int> vi;
#define pb push_back
int ans[100000];
int query(vi v) {
int z;
cout << "? " << v.size();
for (int z: v) cout << " " << z+1;
cout << endl;
cin >> z;
return z;
}
int main() {
int n;
cin >> n;
vi things;
int c = 0;
fill(ans,ans+n,-1);
while (c+3 < n) {
vi u;
if (!things.empty()) u.pb(things.back()),things.pop_back();
while (u.size() < 4) u.pb(c++);
int z = query({u[0],u[1],u[2]});
if ((z == 0) || (z == 3)) {
ans[u[0]] = ans[u[1]] = ans[u[2]] = z/3,c--;
continue;
}
int y = query({u[2],u[3]});
if ((y == 0) || (y == 2)) {
ans[u[2]] = ans[u[3]] = y/2;
if ((z-ans[u[2]] == 0) || (z-ans[u[2]] == 2)) {
ans[u[0]] = ans[u[1]] = (z-ans[u[2]])/2;
continue;
}
else {
things.pb(u[0]);
things.pb(u[1]);
continue;
}
}
int x = query({u[1],u[3]});
ans[u[0]] = (z+x-1) & 1;
ans[u[1]] = ((z+x-1) & 2) >> 1;
ans[u[2]] = z-ans[u[0]]-ans[u[1]];
ans[u[3]] = 1-ans[u[2]];
}
while (c < n) ans[c] = query({c}),c++;
if (!things.empty()) {
int i;
ans[things[0]] = query({things[0]});
for (i = 1; i < things.size(); i++) ans[things[i]] = 1-ans[things[i-1]];
}
int i;
cout << "= ";
for (i = 0; i < n; i++) cout << ans[i];
cout << endl;
return 0;
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 0
Wrong Answer
time: 106ms
memory: 4184kb
input:
100000 2 1 1 2 2 2 2 3 1 2 2 2 1 2 2 1 2 1 1 1 3 3 2 2 1 0 0 2 1 2 0 2 0 1 0 3 2 1 1 1 1 0 0 2 2 1 2 3 1 1 1 1 1 0 0 1 1 0 2 2 2 0 1 2 2 1 1 3 1 1 1 1 1 1 0 2 0 0 2 2 2 1 1 1 1 1 1 2 2 1 1 0 2 2 2 1 0 1 1 0 3 0 0 2 0 1 2 1 2 2 2 2 0 0 3 2 0 0 2 1 1 1 1 0 0 1 1 2 3 1 0 2 1 1 2 0 3 3 0 3 2 1 2 2 1 2 3...
output:
? 3 1 2 3 ? 2 3 4 ? 2 2 4 ? 3 5 6 7 ? 2 7 8 ? 3 6 9 10 ? 2 10 11 ? 3 9 12 13 ? 3 6 14 15 ? 2 15 16 ? 3 5 17 18 ? 2 18 19 ? 3 17 20 21 ? 2 21 22 ? 3 5 23 24 ? 2 24 25 ? 2 23 25 ? 3 26 27 28 ? 2 28 29 ? 2 27 29 ? 3 30 31 32 ? 3 33 34 35 ? 3 36 37 38 ? 2 38 39 ? 3 37 40 41 ? 2 41 42 ? 3 40 43 44 ? 3 37...
result:
wrong answer Too many queries: 65556