QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#810677#9783. Duloc NetworkBINYUWA 1ms3876kbC++14745b2024-12-12 08:59:232024-12-12 08:59:25

Judging History

你现在查看的是最新测评结果

  • [2024-12-12 08:59:25]
  • 评测
  • 测评结果:WA
  • 用时:1ms
  • 内存:3876kb
  • [2024-12-12 08:59:23]
  • 提交

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;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);
}

详细

Test #1:

score: 100
Accepted
time: 1ms
memory: 3744kb

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: 1ms
memory: 3832kb

input:

2
0
0
0
0
0

output:

? 10
? 01
? 11
? 01
? 10
! 0

result:

ok Correct answer with 5 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: 1ms
memory: 3876kb

input:

2
0
0
0
0
0

output:

? 10
? 01
? 11
? 01
? 10
! 0

result:

ok Correct answer with 5 queries.

Test #5:

score: -100
Wrong Answer
time: 1ms
memory: 3728kb

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
3
2
4
4
6
5
4
3
4
5
3
6
1

output:

? 10000000000000000000000000000000000000000000000000
? 01000000000000000000000000000000000000000000000000
? 00100000000000000000000000000000000000000000000000
? 00010000000000000000000000000000000000000000000000
? 00001000000000000000000000000000000000000000000000
? 000001000000000000000000000000000...

result:

wrong answer Wrong answer.