QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#422911#4161. 外星千足虫llzzmm64520 23ms4164kbC++14720b2024-05-27 20:13:022024-05-27 20:13:02

Judging History

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

  • [2024-05-27 20:13:02]
  • 评测
  • 测评结果:20
  • 用时:23ms
  • 内存:4164kb
  • [2024-05-27 20:13:02]
  • 提交

answer

#include <bits/stdc++.h>
using namespace std;
int n,m;
char s[1005];int a[2005];
bitset<1005> b[2005];
int main(){
	ios::sync_with_stdio(false);
	cin.tie(0),cout.tie(0);
	cin>>n>>m;
	for(int i=1;i<=m;i++){
		int x=0;
		scanf("%s%d",s,&x);
		for(int j=1;j<=n;j++) b[i][j]=s[j-1]-'0';
		b[i][n+1]=x;
	}
	if(m<n){
		printf("Cannot Determine");return 0;
	}
	int ans=0;
	for(int i=1;i<=n;i++){
		int u=0;
		for(int j=i;j<=m;j++)
			if(b[j][i]){u=j;break;}
		if(!u){
			printf("Cannot Determine");return 0;
		}
		ans=max(ans,u),swap(b[i],b[u]);
		for(int j=1;j<=m;j++)
			if(i!=j&&b[j][i]) b[j]^=b[i];
	}
	printf("%d\n",ans);
	for(int i=1;i<=n;i++){
		if(b[i][n+1]) printf("?y7M#\n");
		else printf("Earth\n");
	}
	return 0;
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 0
Wrong Answer
time: 0ms
memory: 3728kb

input:

20 20
00101100011001010100 0
01000001111011011111 1
01011111001011110100 1
11011111001100000101 1
01110101100001101000 0
10011000001111011011 0
01100101110100111100 1
11011000011110000110 1
00100010100001010001 0
11011001011010101001 0
01011010000000000011 1
00110001000110101001 1
000000001000001110...

output:

Cannot Determine

result:

wrong answer The insect #1: read Determine but expected ?y7M#

Test #2:

score: 10
Accepted
time: 0ms
memory: 3728kb

input:

20 20
00110001000001011110 0
00111000001110011101 0
00010000011011111001 0
10001010011010101101 0
11011101010011010000 0
10011111001001010001 0
10110000101110101010 1
11101100000101011110 1
00010010010101100110 0
00111101010010100110 1
11111001111111011111 1
01010010001000000010 0
100111100111001110...

output:

Cannot Determine

result:

ok there are multiple solutions, so print Cannot Determine.

Test #3:

score: 0
Wrong Answer
time: 2ms
memory: 3964kb

input:

400 400
1110111100111100111111101011100100111001100010100100110000101111100001111111101011100011110101100100000111001000100100001001000001110100111000011110000111101100001110000111101001011111001111100010100010110101101010001010111000001001000110111001111100011000101010000101110001111010111010011000...

output:

Cannot Determine

result:

wrong answer The insect #1: read Determine but expected Earth

Test #4:

score: 0
Wrong Answer
time: 0ms
memory: 3836kb

input:

500 500
1011011011100011001110110001011000001111010101101000101110000111100011000000110111001001110110001000001000111000111111010100001011010010001110000010011000101000111101001111100110111110010111111011011111110110000010100100101010011000100001011010110111001011100000110010110011110000001010001100...

output:

Cannot Determine

result:

wrong answer The insect #1: read Determine but expected Earth

Test #5:

score: 5
Acceptable Answer
time: 2ms
memory: 3980kb

input:

300 500
1101101001001101011100100010000111000010111001011100011100111101110100011101110111111000100010001010000101101000110010001011100011000101000111101100010011101101100000000010101010011011011011001100101000100011000011001001010000001011110110010101001101000011000011001011010101110011101011101100...

output:

450
?y7M#
?y7M#
Earth
Earth
Earth
?y7M#
?y7M#
Earth
?y7M#
Earth
Earth
Earth
?y7M#
Earth
Earth
Earth
?y7M#
Earth
?y7M#
?y7M#
?y7M#
?y7M#
Earth
?y7M#
Earth
Earth
?y7M#
?y7M#
?y7M#
Earth
?y7M#
Earth
Earth
?y7M#
Earth
Earth
Earth
?y7M#
Earth
?y7M#
?y7M#
?y7M#
Earth
Earth
Earth
?y7M#
Earth
Earth
Earth
?y...

result:

points 0.50 The namelist is correct but the value K is incorrect (read 450 but expected 481)

Test #6:

score: 0
Wrong Answer
time: 4ms
memory: 4012kb

input:

400 800
1101101001001010001110010110000101000000100001100111110001000010011110111110100100101010110110110101010101001011011110001011111100001001110111100100001110010011110000001100110010111101010000000010100100010100111011100110000011010100001000100001001001010011001011010000001010100100000000111000...

output:

741
?y7M#
?y7M#
?y7M#
?y7M#
Earth
?y7M#
Earth
?y7M#
?y7M#
?y7M#
Earth
Earth
Earth
?y7M#
?y7M#
?y7M#
Earth
Earth
Earth
Earth
Earth
Earth
Earth
Earth
?y7M#
?y7M#
?y7M#
?y7M#
Earth
Earth
Earth
?y7M#
Earth
?y7M#
?y7M#
?y7M#
Earth
?y7M#
?y7M#
?y7M#
Earth
Earth
Earth
Earth
Earth
Earth
Earth
Earth
?y7M#
?y...

result:

wrong answer The insect #1: read ?y7M# but expected Earth

Test #7:

score: 0
Wrong Answer
time: 3ms
memory: 4076kb

input:

500 1000
011100001000001000001111111011100000101011110000011101110011011110100000001000011100110101101010111010101010010000000101110101001111111000101110110010111001011001000111111110101001101100100101100111000000011001111111001001110110011010101100010100010011000010111000111100010000111100111110000...

output:

980
?y7M#
Earth
Earth
Earth
Earth
Earth
?y7M#
?y7M#
Earth
Earth
Earth
?y7M#
?y7M#
?y7M#
Earth
Earth
Earth
Earth
?y7M#
?y7M#
?y7M#
Earth
?y7M#
?y7M#
?y7M#
Earth
?y7M#
?y7M#
Earth
Earth
Earth
?y7M#
?y7M#
?y7M#
Earth
Earth
Earth
?y7M#
Earth
?y7M#
Earth
?y7M#
Earth
Earth
Earth
Earth
?y7M#
?y7M#
?y7M#
?y...

result:

wrong answer The insect #6: read Earth but expected ?y7M#

Test #8:

score: 5
Acceptable Answer
time: 14ms
memory: 4164kb

input:

800 1500
000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000...

output:

1445
Earth
?y7M#
?y7M#
Earth
Earth
Earth
Earth
Earth
Earth
?y7M#
?y7M#
?y7M#
Earth
?y7M#
?y7M#
?y7M#
Earth
Earth
Earth
Earth
?y7M#
?y7M#
Earth
?y7M#
?y7M#
?y7M#
?y7M#
Earth
?y7M#
Earth
Earth
?y7M#
?y7M#
?y7M#
Earth
?y7M#
?y7M#
?y7M#
Earth
Earth
Earth
?y7M#
Earth
?y7M#
Earth
Earth
?y7M#
Earth
Earth
E...

result:

points 0.50 The namelist is correct but the value K is incorrect (read 1445 but expected 1455)

Test #9:

score: 0
Wrong Answer
time: 15ms
memory: 4144kb

input:

900 1800
000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000...

output:

1756
?y7M#
?y7M#
?y7M#
Earth
?y7M#
Earth
?y7M#
?y7M#
?y7M#
?y7M#
?y7M#
?y7M#
Earth
Earth
Earth
Earth
Earth
Earth
?y7M#
Earth
Earth
Earth
?y7M#
?y7M#
?y7M#
Earth
?y7M#
Earth
?y7M#
?y7M#
?y7M#
?y7M#
Earth
?y7M#
?y7M#
?y7M#
?y7M#
?y7M#
Earth
Earth
Earth
Earth
?y7M#
Earth
?y7M#
Earth
Earth
?y7M#
Earth
E...

result:

wrong answer The insect #2: read ?y7M# but expected Earth

Test #10:

score: 0
Wrong Answer
time: 23ms
memory: 4164kb

input:

1000 2000
01111110000111111111110011011100000001111000011010000101110101001111101011100010101011001001110111001101000010110010000010000000110111101000110001110001001010110100001101000101101110011110000100100001010101110011000001001001111101111011000101101111110110000010011100100111111000101010101111...

output:

1974
Earth
?y7M#
?y7M#
?y7M#
Earth
?y7M#
Earth
?y7M#
Earth
?y7M#
?y7M#
Earth
?y7M#
Earth
Earth
?y7M#
?y7M#
?y7M#
?y7M#
Earth
Earth
?y7M#
Earth
Earth
?y7M#
?y7M#
?y7M#
Earth
?y7M#
?y7M#
Earth
?y7M#
?y7M#
?y7M#
Earth
?y7M#
?y7M#
?y7M#
?y7M#
?y7M#
?y7M#
Earth
Earth
?y7M#
?y7M#
Earth
Earth
Earth
Earth
?...

result:

wrong answer The insect #2: read ?y7M# but expected Earth