QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#422563 | #8093. Jigglypuff | Afterlife# | WA | 1ms | 3996kb | C++17 | 807b | 2024-05-27 16:18:15 | 2024-05-27 16:18:16 |
Judging History
answer
#include<bits/stdc++.h>
using namespace std;
const int N=3111;
int n,m;
string s[N];
int v[N][N];
int main()
{
ios::sync_with_stdio(false);
cin.tie(0);
cin>>n>>m;
for(int i=1;i<=n;i++)
{
cin>>s[i];
s[i]=' '+s[i];
}
int ans=0;
for(int i=1;i<n;i++)
for(int j=1;j<m;j++)
{
v[i][j]=v[i-1][j]|v[i][j-1];
if(s[i][j+1]==s[i+1][j])
v[i][j]=1;
}
for(int i=1;i+1<n;i++)
for(int j=1;j<m;j++)
if(s[i][j+1]==s[i+1][j]&&s[i+1][j+1]==s[i+2][j])
ans=1;
for(int i=1;i<n;i++)
for(int j=1;j+1<m;j++)
if(s[i][j+1]==s[i+1][j]&&s[i+1][j+1]==s[i][j+2])
ans=1;
cout<<(ans?"YES":"NO")<<"\n";
}
详细
Test #1:
score: 100
Accepted
time: 1ms
memory: 3988kb
input:
5 8 petrozav eiiiziio tiiiavid riiiiois ozavodsk
output:
YES
result:
ok answer is YES
Test #2:
score: 0
Accepted
time: 1ms
memory: 3996kb
input:
5 5 abcde fghij klmno pqrst uvwxy
output:
NO
result:
ok answer is NO
Test #3:
score: 0
Accepted
time: 0ms
memory: 3692kb
input:
2 2 ab bc
output:
NO
result:
ok answer is NO
Test #4:
score: 0
Accepted
time: 1ms
memory: 3700kb
input:
2 3 mee eep
output:
YES
result:
ok answer is YES
Test #5:
score: 0
Accepted
time: 0ms
memory: 3628kb
input:
2 2 aa aa
output:
NO
result:
ok answer is NO
Test #6:
score: 0
Accepted
time: 0ms
memory: 3780kb
input:
3 2 xx xx xx
output:
YES
result:
ok answer is YES
Test #7:
score: -100
Wrong Answer
time: 1ms
memory: 3740kb
input:
3 3 abc bde feg
output:
NO
result:
wrong answer expected YES, found NO