QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#810678 | #9783. Duloc Network | BINYU | WA | 1ms | 3884kb | C++14 | 751b | 2024-12-12 09:01:48 | 2024-12-12 09:01:49 |
Judging History
answer
#include<bits/stdc++.h>
using namespace std;
const int N = 200;
int n,d[N + 5];
vector <pair <int,int> > a;
int query(int x,int y)
{
putchar('?');putchar(' ');
for(int i = 1;i <= n;i++)
putchar((i == x||i == y) ? '1' : '0');
puts("");fflush(stdout);
int res;
scanf("%d",&res);
return res;
}
int main()
{
srand(time(0));
scanf("%d",&n);
for(int i = 1;i <= n;i++)
d[i] = query(i,0);
int m = 3500 - n;
for(int i = 1;i <= n;i++)
for(int j = i + 1;j <= n;j++)
a.push_back({i,j});
random_shuffle(a.begin(),a.end());
for(int i = 0;i < m&&i < a.size();i++)
{
int u = a[i].first,v = a[i].second;
if(query(u,v) != d[u] + d[v])
return puts("! 1"),fflush(stdout),0;
}
puts("! 0");fflush(stdout);
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 1ms
memory: 3884kb
input:
4 1 3 2 2 2
output:
? 1000 ? 0100 ? 0010 ? 0001 ? 1001 ! 1
result:
ok Correct answer with 5 queries.
Test #2:
score: 0
Accepted
time: 0ms
memory: 3876kb
input:
2 0 0 0
output:
? 10 ? 01 ? 11 ! 0
result:
ok Correct answer with 3 queries.
Test #3:
score: 0
Accepted
time: 1ms
memory: 3828kb
input:
4 1 3 2 2 2
output:
? 1000 ? 0100 ? 0010 ? 0001 ? 1001 ! 1
result:
ok Correct answer with 5 queries.
Test #4:
score: 0
Accepted
time: 0ms
memory: 3824kb
input:
2 0 0 0
output:
? 10 ? 01 ? 11 ! 0
result:
ok Correct answer with 3 queries.
Test #5:
score: -100
Wrong Answer
time: 1ms
memory: 3768kb
input:
50 3 1 1 1 1 4 3 1 1 2 3 3 2 1 2 4 3 1 1 1 2 4 1 3 1 4 3 2 2 2 4 2 2 1 1 2 1 2 4 1 1 3 3 3 6 2 1 3 2 3 8 2 2 5 4 8 3 2 4 6 4 3 3 3
output:
? 10000000000000000000000000000000000000000000000000 ? 01000000000000000000000000000000000000000000000000 ? 00100000000000000000000000000000000000000000000000 ? 00010000000000000000000000000000000000000000000000 ? 00001000000000000000000000000000000000000000000000 ? 000001000000000000000000000000000...
result:
wrong answer Wrong answer.