QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#422134 | #4161. 外星千足虫 | llzzmm645 | 10 | 11ms | 4216kb | C++14 | 722b | 2024-05-26 20:14:56 | 2024-05-26 20:14:57 |
Judging History
answer
#include <bits/stdc++.h>
using namespace std;
int n,m;
char s[1005];int a[2005];
bitset<1005> b[1005];
int main(){
ios::sync_with_stdio(false);
cin.tie(0),cout.tie(0);
cin>>n>>m;
for(int i=1;i<=m;i++) cin>>b[i]>>a[i],b[i]<<=1,b[i][n+1]=a[i];
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) continue;
ans=max(ans,u),swap(b[i],b[u]);
for(int j=1;j<=m;j++)
if(j!=i&&b[j][i]) b[j]^=b[i];
}
for(int i=1;i<=n;i++){
if(b[i][i]==0){
printf("Cannot Determine");return 0;
}
}
printf("%d\n",ans);
for(int i=1;i<=n;i++){
if(b[i][n+1]==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: 1ms
memory: 4040kb
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:
20 Earth ?y7M# Earth ?y7M# ?y7M# Earth ?y7M# ?y7M# Earth Earth ?y7M# ?y7M# ?y7M# ?y7M# ?y7M# Earth Earth Earth ?y7M# ?y7M#
result:
wrong answer The insect #1: read Earth but expected ?y7M#
Test #2:
score: 10
Accepted
time: 0ms
memory: 3884kb
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: 3812kb
input:
400 400 1110111100111100111111101011100100111001100010100100110000101111100001111111101011100011110101100100000111001000100100001001000001110100111000011110000111101100001110000111101001011111001111100010100010110101101010001010111000001001000110111001111100011000101010000101110001111010111010011000...
output:
400 Earth Earth Earth Earth ?y7M# ?y7M# ?y7M# ?y7M# Earth ?y7M# ?y7M# ?y7M# Earth ?y7M# Earth Earth Earth ?y7M# ?y7M# ?y7M# Earth ?y7M# Earth Earth Earth ?y7M# ?y7M# ?y7M# Earth Earth Earth ?y7M# ?y7M# ?y7M# Earth Earth ?y7M# Earth Earth Earth ?y7M# Earth ?y7M# ?y7M# ?y7M# Earth Earth ?y7M# Earth ?y...
result:
wrong answer The insect #2: read Earth but expected ?y7M#
Test #4:
score: 0
Wrong Answer
time: 6ms
memory: 3764kb
input:
500 500 1011011011100011001110110001011000001111010101101000101110000111100011000000110111001001110110001000001000111000111111010100001011010010001110000010011000101000111101001111100110111110010111111011011111110110000010100100101010011000100001011010110111001011100000110010110011110000001010001100...
output:
500 Earth Earth ?y7M# ?y7M# ?y7M# Earth Earth ?y7M# ?y7M# ?y7M# Earth ?y7M# ?y7M# Earth ?y7M# Earth ?y7M# ?y7M# Earth Earth Earth ?y7M# ?y7M# Earth ?y7M# Earth Earth Earth ?y7M# ?y7M# ?y7M# ?y7M# Earth Earth Earth ?y7M# ?y7M# Earth ?y7M# ?y7M# Earth ?y7M# Earth Earth Earth Earth Earth ?y7M# ?y7M# Ea...
result:
wrong answer The insect #2: read Earth but expected ?y7M#
Test #5:
score: 0
Wrong Answer
time: 4ms
memory: 3860kb
input:
300 500 1101101001001101011100100010000111000010111001011100011100111101110100011101110111111000100010001010000101101000110010001011100011000101000111101100010011101101100000000010101010011011011011001100101000100011000011001001010000001011110110010101001101000011000011001011010101110011101011101100...
output:
481 Earth ?y7M# Earth Earth Earth ?y7M# ?y7M# Earth ?y7M# ?y7M# ?y7M# ?y7M# ?y7M# ?y7M# ?y7M# Earth Earth ?y7M# ?y7M# ?y7M# Earth Earth Earth ?y7M# ?y7M# ?y7M# Earth ?y7M# ?y7M# Earth Earth ?y7M# Earth ?y7M# ?y7M# Earth Earth Earth Earth Earth ?y7M# ?y7M# Earth ?y7M# Earth Earth ?y7M# Earth Earth ?y...
result:
wrong answer The insect #1: read Earth but expected ?y7M#
Test #6:
score: 0
Wrong Answer
time: 8ms
memory: 4216kb
input:
400 800 1101101001001010001110010110000101000000100001100111110001000010011110111110100100101010110110110101010101001011011110001011111100001001110111100100001110010011110000001100110010111101010000000010100100010100111011100110000011010100001000100001001001010011001011010000001010100100000000111000...
output:
769 Earth Earth Earth ?y7M# ?y7M# ?y7M# ?y7M# Earth Earth ?y7M# ?y7M# ?y7M# ?y7M# Earth Earth Earth ?y7M# ?y7M# ?y7M# Earth ?y7M# Earth ?y7M# Earth ?y7M# ?y7M# ?y7M# ?y7M# ?y7M# Earth ?y7M# ?y7M# Earth ?y7M# Earth Earth Earth Earth ?y7M# ?y7M# Earth Earth ?y7M# ?y7M# ?y7M# ?y7M# Earth ?y7M# Earth Ea...
result:
wrong answer The insect #2: read Earth but expected ?y7M#
Test #7:
score: 0
Wrong Answer
time: 11ms
memory: 4164kb
input:
500 1000 011100001000001000001111111011100000101011110000011101110011011110100000001000011100110101101010111010101010010000000101110101001111111000101110110010111001011001000111111110101001101100100101100111000000011001111111001001110110011010101100010100010011000010111000111100010000111100111110000...
output:
997 ?y7M# Earth ?y7M# Earth Earth ?y7M# ?y7M# ?y7M# Earth Earth ?y7M# Earth ?y7M# Earth ?y7M# Earth ?y7M# Earth Earth Earth Earth ?y7M# ?y7M# ?y7M# ?y7M# ?y7M# ?y7M# ?y7M# ?y7M# ?y7M# ?y7M# ?y7M# Earth Earth Earth ?y7M# Earth ?y7M# ?y7M# ?y7M# Earth ?y7M# ?y7M# ?y7M# ?y7M# Earth Earth Earth Earth Ea...
result:
wrong answer The insect #3: read ?y7M# but expected Earth
Test #8:
score: 0
Runtime Error
input:
800 1500 000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000...
output:
result:
Test #9:
score: 0
Runtime Error
input:
900 1800 000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000...
output:
result:
Test #10:
score: 0
Runtime Error
input:
1000 2000 01111110000111111111110011011100000001111000011010000101110101001111101011100010101011001001110111001101000010110010000010000000110111101000110001110001001010110100001101000101101110011110000100100001010101110011000001001001111101111011000101101111110110000010011100100111111000101010101111...