QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#87071 | #3002. Busy Board | yx20220802 | WA | 14ms | 5564kb | C++14 | 2.2kb | 2023-03-11 16:46:46 | 2023-03-11 16:46:50 |
Judging History
answer
#include<bits/stdc++.h>
using namespace std;
namespace IO_ER{
#define LL long long
#define db double
#define ULL unsigned long long
#define In inline
#define f(a,b,i) for(int i=a;i<=b;i++)
#define ff(a,b,i) for(int i=a;i<b;i++)
#define f_(a,b,i) for(int i=a;i>=b;i--)
#define ff_(a,b,i) for(int i=a;i>b;i--)
typedef pair<int,int> Pi;
int inf=0x3f3f3f3f;
int INF=0x7fffffff;
LL infll=0x3f3f3f3f3f3f3f3fll;
LL INFll=0x7fffffffffffffffll;
int FLAG_=0;
char CHAR=0;
template<typename T>void read(T &x){
x=0;
FLAG_=0;
CHAR=getchar();
while(CHAR<'0'||'9'<CHAR){
if(CHAR=='-')FLAG_=1;
CHAR=getchar();
}
while('0'<=CHAR&&CHAR<='9'){
x=(x<<1)+(x<<3)+(CHAR^48);
CHAR=getchar();
}
x=FLAG_?-x:x;
}
template<typename T,typename ...Args>void read(T &x,Args &...args){
read(x);
read(args...);
}
}
using namespace IO_ER;
#define N 1050
int n,m;
int r[N];
int c[N];
char st[N][N];
char ed[N][N];
int vir[N];
int vic[N];
int main(){
// freopen("ccc.in","r",stdin);
// freopen("ccc.out","w",stdout);
read(n,m);
f(1,n,i)scanf("%s",st[i]+1);
f(1,n,i)scanf("%s",ed[i]+1);
int fl=1;
f(1,n,i){
f(1,m,j){
if(st[i][j]!=ed[i][j]){
fl=0;
break;
}
}
if(!fl)break;
}
if(fl){
puts("1");
return 0;
}
f(1,n,i){
f(1,m,j){
if(ed[i][j]=='X'){
r[i]++;
c[j]++;
}
}
}
fl=1;
while(fl){
fl=0;
f(1,n,i){
f(1,n,j){
// if(vir[i]&&vic[j]||ed[i][j]=='O')continue;
if((ed[i][j]=='X'&&r[i]==1&&c[j]==1)||(ed[i][j]=='?'&&r[i]==0&&c[j]==0&&(!vir[i]||!vic[j]))){
fl=1;
vir[i]=1;
vic[j]=1;
f(1,m,k){
r[i]-=(ed[i][k]=='X');
c[k]-=(ed[i][k]=='X');
ed[i][k]='?';
}
f(1,n,k){
r[k]-=(ed[k][j]=='X');
c[j]-=(ed[k][j]=='X');
ed[k][j]='?';
}
}
}
}
}
fl=0;
f(1,n,i){
if(!vir[i])continue;
f(1,m,j){
if(!vic[j])continue;
fl|=(st[i][j]=='O');
}
}
if(!fl){
puts("0");
return 0;
}
fl=1;
f(1,n,i){
f(1,m,j){
fl&=(ed[i][j]=='?'||st[i][j]==ed[i][j]);
}
}
if(fl)puts("1");
else puts("0");
return 0;
}
詳細信息
Test #1:
score: 100
Accepted
time: 13ms
memory: 5092kb
input:
769 998 OOOOXOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOXOOOOOOOXOOOOOOOOOOOOOOOOOOOOOOOOOOOXOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOXOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOXOOOOOOOOOOOXOOOOOOOOOOOOOOOOOOXOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOXOOOOOOOOOOOOOOOOOOOO...
output:
0
result:
ok answer is 0
Test #2:
score: 0
Accepted
time: 10ms
memory: 5436kb
input:
977 998 OOOOOOXOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOXOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOXOOOOOOOOOOO...
output:
0
result:
ok answer is 0
Test #3:
score: 0
Accepted
time: 8ms
memory: 5292kb
input:
941 973 XOXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXOXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXOXXXXXXXOXXXXXXXOXXOXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX...
output:
1
result:
ok answer is 1
Test #4:
score: 0
Accepted
time: 1ms
memory: 3796kb
input:
65 983 XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXOXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX...
output:
0
result:
ok answer is 0
Test #5:
score: 0
Accepted
time: 2ms
memory: 3776kb
input:
50 201 XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXOXXXXXXXXXXXXXXXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX...
output:
0
result:
ok answer is 0
Test #6:
score: 0
Accepted
time: 7ms
memory: 5436kb
input:
949 507 OXOOOOOOOOOOXOOOOOOOOOOOOOOOOOOOOOOOOOOOXOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOXOOOOOOOOOOOOOOXOOOOOOOOOOOOOOOOOOOOOOOOOOOOXOOOOOXOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOXOOOOXOOOOOOOOOOOOOOOOOOOXOOOOOOOOOOOOOOOOXOOOOOOOOOOOOOOOOOOOOOOOXOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOO...
output:
1
result:
ok answer is 1
Test #7:
score: 0
Accepted
time: 14ms
memory: 5564kb
input:
964 994 XOOOOOOOOOOOOOOOOXXXXOOXXOOOOOOOOOOOOXXOOOOXOOOOOOOOOOOXOOXOOXOOOOXOXOXOOOOOOOXOOXOOOOOOOOXOOXXOXOOOOOXOXOXOOOOOOOOOXOXOOOOOOOXXOOOOOOOOOXOOOXOXOOOOOOXXXXOOOOOOOOOOOOOOOOOXOOXOOOOOOOOOXOOOXXXOOOOOOOOOOOOXOOOOOXOXXOOOOOOOXOOOXOOOXOOOOOOOOOOXOOOOOOOXXOOOOOOXOOOOOOOOOOOOOOOOOOOOOOOOOXOOOXXOXXOO...
output:
0
result:
ok answer is 0
Test #8:
score: 0
Accepted
time: 7ms
memory: 5524kb
input:
992 30 OOOOOOOOOOOOOOOOOOOOOOOOOOOOOO OOOOOOOOOOOOOOOOOOOOOOOOOOXOOO OOXOOOOOXOOOOOOOOOXOOOOOOOOOOO OOOOOOXOOOOOOOOOOOOXOOOOOOOOOO OOOOOOOOOOOOOOOOOOOXOOOOOOOOOO OOXOOOOOOOOOOXOOOOXOOOOOOOOOOO OOOOOOOOOOOOOOOOOOOOOOOOOOOOOO OOOOOOOOOOOOOOOXOOOOOOOOOOOOOO OOOOOOOOOOOOOOOOOOOOOOOOOOXOOO OXOOOOOOOOOOOO...
output:
0
result:
ok answer is 0
Test #9:
score: 0
Accepted
time: 4ms
memory: 5500kb
input:
964 812 OOOOOXOOOOOOOXOOOOOOOOOOOOOOOOOOOOXOOOOOOOOOOOOOOOOOOOOOOOOOOOXOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOXOOOOOOOXOOOOOOXOOOOOOOOOOOXXOOOOOOOOOOOOOOOOOOOOOOOOOXOOOXOOOOOOOOOOXOOOOOOOOOXOOXXOOOOOOOOOOOOOOOOOOXOOOOOOOOOOOOOOOOOOOOOXOOXOXOOOOOOOOOXOOOOOOOOOXOOOOOOOOOOOOOOOOOOXOOOOXOOOXOOOOOOOOOXOOOOOOO...
output:
1
result:
ok answer is 1
Test #10:
score: 0
Accepted
time: 8ms
memory: 4096kb
input:
375 970 OXOXOOOOOOOOOOXOOOOOOOOOOOOOOOOOOOOOOOOXOOOOXOOOOOOOOXOOOOOXOOOOOOOOOOOXOOOOXOOXOOOOOOOOOXOOOOOOOOOOOOXOOOOOOOXOOOOOOOOOOOOOOOOOOOOXXOOOOOOOOOOOOOOXOOOOOOOOOOOOOOOOOXOXOOOOOOXXOXOOOOOOOOOOXOOOOOOOXOOXXOOXOXXOOXXOOOOOXXOXOOOOOOOXOOXOOOOOOOOOOOOXOXOOXOOOOOOOOOOOOOXXXOOOOOOOOOOOXOOOOOXOXOXOOOOO...
output:
0
result:
ok answer is 0
Test #11:
score: -100
Wrong Answer
time: 3ms
memory: 3720kb
input:
116 926 XXXXXXXXXXXXXXXXXXXXXXXOXXXXXXXOXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXOXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXOXXXXXXXXXXXXXXXXXOXXXXXXXXXXXXXXXXXXOXXXXXOXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXOXXXXXXXXXXX...
output:
0
result:
wrong answer expected 1, found 0