10538 | 2024-04-04 18:41:50 | 111 | Stefan sakkmesteri ambíciói | cpp17 | Wrong answer 43/100 | 4ms | 4536 KiB |
#include<bits/stdc++.h>
using namespace std;
#define int long long
signed main(){
ios::sync_with_stdio(false);
cin.tie(nullptr);
int T;
cin>>T;
while(T--){
char x[10][10]{};
for(int i=1;i<=8;i++){
for(int j=1;j<=8;j++){
cin>>x[i][j];
}
}
int ok=0;
for(int i=1;i<=8;i++){
for(int j=1;j<=8;j++){
if(x[i][j]=='q'){
for(int k=j+1;;k++){
if(x[i][k]!='.'){
if(x[i][k]=='R'||x[i][k]=='Q'){
ok=1;
}
break;
}
}
for(int k=j-1;;k--){
if(x[i][k]!='.'){
if(x[i][k]=='R'||x[i][k]=='Q'){
ok=1;
}
break;
}
}
for(int k=i+1;;k++){
if(x[k][j]!='.'){
if(x[k][j]=='R'||x[k][j]=='Q'){
ok=1;
}
break;
}
}
for(int k=i-1;;k--){
if(x[k][j]!='.'){
if(x[k][j]=='R'||x[k][j]=='Q'){
ok=1;
}
break;
}
}
for(int k=i+1,l=j+1;;k++,l++){
if(x[k][l]!='.'){
if(x[k][l]=='B'||x[k][l]=='Q'){
ok=1;
}
break;
}
}
for(int k=i+1,l=j-1;;k++,l--){
if(x[k][l]!='.'){
if(x[k][l]=='B'||x[k][l]=='Q'){
ok=1;
}
break;
}
}
for(int k=i-1,l=j+1;;k--,l++){
if(x[k][l]!='.'){
if(x[k][l]=='B'||x[k][l]=='Q'){
ok=1;
}
break;
}
}
for(int k=i-1,l=j-1;;k--,l--){
if(x[k][l]!='.'){
if(x[k][l]=='B'||x[k][l]=='Q'){
ok=1;
}
break;
}
}
for(int k=1;k<=8;k++){
for(int l=1;l<=8;l++){
if(x[k][l]=='N'&&(abs(k-i)==1&&abs(l-j)==2||abs(k-i)==2&&abs(l-j)==1)){
ok=1;
}
}
}
}
}
}
cout<<(ok?"YES":"NO")<<'\n';
}
return 0;
}
Subtask | Sum | Test | Verdict | Time | Memory | ||
---|---|---|---|---|---|---|---|
subtask1 | 0/0 | ||||||
1 | Accepted | 3ms | 1888 KiB | ||||
subtask2 | 0/11 | ||||||
2 | Wrong answer | 3ms | 2268 KiB | ||||
3 | Wrong answer | 3ms | 2340 KiB | ||||
4 | Wrong answer | 3ms | 2580 KiB | ||||
5 | Wrong answer | 4ms | 2796 KiB | ||||
subtask3 | 12/12 | ||||||
6 | Accepted | 3ms | 2900 KiB | ||||
7 | Accepted | 3ms | 3128 KiB | ||||
8 | Accepted | 3ms | 3228 KiB | ||||
9 | Accepted | 4ms | 3300 KiB | ||||
subtask4 | 15/15 | ||||||
10 | Accepted | 3ms | 3268 KiB | ||||
11 | Accepted | 3ms | 3496 KiB | ||||
12 | Accepted | 3ms | 3604 KiB | ||||
13 | Accepted | 4ms | 3688 KiB | ||||
subtask5 | 16/16 | ||||||
14 | Accepted | 3ms | 3808 KiB | ||||
15 | Accepted | 2ms | 3876 KiB | ||||
16 | Accepted | 3ms | 3880 KiB | ||||
17 | Accepted | 4ms | 3884 KiB | ||||
subtask6 | 0/46 | ||||||
18 | Accepted | 2ms | 3876 KiB | ||||
19 | Wrong answer | 3ms | 3872 KiB | ||||
20 | Wrong answer | 3ms | 3980 KiB | ||||
21 | Wrong answer | 4ms | 4212 KiB | ||||
22 | Wrong answer | 4ms | 4208 KiB | ||||
23 | Wrong answer | 4ms | 4320 KiB | ||||
24 | Wrong answer | 4ms | 4316 KiB | ||||
25 | Wrong answer | 4ms | 4444 KiB | ||||
26 | Wrong answer | 4ms | 4536 KiB |