9939 | 2024-03-20 19:11:52 | csdavid | Chess Rush | cpp17 | Wrong answer 0/100 | 4ms | 4720 KiB |
#include <iostream>
using namespace std;
int kezdoszlop, celoszlop;
int r, c, q;
char type;
void pawn(){
if(kezdoszlop!=celoszlop){
cout << 0 << ' ' << 0;
}
else{
cout << r-1 << ' ' << 1;
}
}
void rook(){
if(kezdoszlop==celoszlop){
cout << 1 << ' ' << 1;
}
else{
cout << 2 << ' ' << 2;
}
}
void queen(){
if(kezdoszlop==celoszlop||abs(celoszlop-kezdoszlop)==r-1){
cout << 1 << ' ' << 1;
}
else{
int ertek=4, kulonbseg;
if(r==c){
if(kezdoszlop==1){
ertek++;
}
if(celoszlop==1 || celoszlop==c){
ertek++;
}
}
kulonbseg=(r-abs(kezdoszlop-celoszlop)-1)/2;
if(min(celoszlop, kezdoszlop)-kulonbseg>=1){
ertek++;
}
if(max(celoszlop, kezdoszlop)+kulonbseg<=c){
ertek++;
}
cout << 2 << ' ' << ertek;
}
}
using namespace std;
int main()
{
cin >> r >> c >> q;
while(q--){
cin >> type >> kezdoszlop >> celoszlop;
if(type=='P'){
pawn();
}
else if(type=='R'){
rook();
}
else if(type=='Q'){
queen();
}
cout << '\n';
}
return 0;
}
Subtask | Sum | Test | Verdict | Time | Memory | ||
---|---|---|---|---|---|---|---|
subtask1 | 0/0 | ||||||
1 | Wrong answer | 3ms | 1752 KiB | ||||
2 | Wrong answer | 4ms | 1988 KiB | ||||
subtask2 | 0/8 | ||||||
3 | Wrong answer | 3ms | 2200 KiB | ||||
4 | Accepted | 4ms | 2408 KiB | ||||
5 | Accepted | 3ms | 2900 KiB | ||||
6 | Wrong answer | 4ms | 2864 KiB | ||||
subtask3 | 0/15 | ||||||
7 | Wrong answer | 2ms | 2872 KiB | ||||
8 | Wrong answer | 3ms | 2996 KiB | ||||
9 | Wrong answer | 3ms | 3160 KiB | ||||
10 | Wrong answer | 3ms | 3232 KiB | ||||
subtask4 | 0/22 | ||||||
11 | Wrong answer | 4ms | 3480 KiB | ||||
12 | Wrong answer | 4ms | 3484 KiB | ||||
13 | Wrong answer | 4ms | 3628 KiB | ||||
14 | Wrong answer | 4ms | 3516 KiB | ||||
15 | Wrong answer | 4ms | 3796 KiB | ||||
16 | Wrong answer | 4ms | 3736 KiB | ||||
subtask5 | 0/5 | ||||||
17 | Wrong answer | 3ms | 3764 KiB | ||||
18 | Wrong answer | 3ms | 3872 KiB | ||||
19 | Wrong answer | 3ms | 3876 KiB | ||||
20 | Wrong answer | 3ms | 3912 KiB | ||||
subtask6 | 0/8 | ||||||
21 | Wrong answer | 4ms | 3880 KiB | ||||
22 | Wrong answer | 4ms | 3972 KiB | ||||
23 | Wrong answer | 4ms | 4088 KiB | ||||
24 | Wrong answer | 4ms | 4028 KiB | ||||
subtask7 | 0/15 | ||||||
25 | Wrong answer | 4ms | 4156 KiB | ||||
26 | Wrong answer | 4ms | 4172 KiB | ||||
27 | Wrong answer | 4ms | 4280 KiB | ||||
28 | Wrong answer | 4ms | 4280 KiB | ||||
29 | Wrong answer | 4ms | 4276 KiB | ||||
30 | Wrong answer | 3ms | 4296 KiB | ||||
subtask8 | 0/20 | ||||||
31 | Wrong answer | 4ms | 4360 KiB | ||||
32 | Wrong answer | 4ms | 4468 KiB | ||||
33 | Wrong answer | 4ms | 4356 KiB | ||||
34 | Wrong answer | 4ms | 4476 KiB | ||||
35 | Wrong answer | 4ms | 4468 KiB | ||||
36 | Wrong answer | 4ms | 4468 KiB | ||||
subtask9 | 0/7 | ||||||
37 | Wrong answer | 4ms | 4720 KiB | ||||
38 | Wrong answer | 4ms | 4596 KiB | ||||
39 | Wrong answer | 4ms | 4520 KiB | ||||
40 | Wrong answer | 4ms | 4640 KiB | ||||
41 | Wrong answer | 4ms | 4520 KiB | ||||
42 | Wrong answer | 4ms | 4516 KiB |