99372024-03-20 07:17:07csdavidChess Rushcpp17Wrong answer 0/1001.598s5268 KiB
#include <iostream>

using namespace std;

int kezdoszlop, celoszlop;
int r, c, q, type;

void pawn(){
    if(kezdoszlop!=celoszlop){
        cout << 0 << ' ' << 0;
    }
    else{
        cout << r-1 << ' ' << 1;
    }
    return;
}

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=3;
        if(r+kezdoszlop-1<=c){
            ertek++;
        }
        if(kezdoszlop-r+1>0){
            ertek++;
        }
        cout << 2 << ' ' << ertek;
    }
}
using namespace std;

int main()
{

    cin >> q >> r >> c;
    while(q){
        cin >> type >> celoszlop;
        if(type=='P'){
            pawn();
        }
        else if(type=='R'){
            rook();
        }
        else if(type=='Q'){
            queen();
        }

        q--;
    }
    return 0;
}
SubtaskSumTestVerdictTimeMemory
subtask10/0
1Wrong answer3ms1872 KiB
2Wrong answer18ms2064 KiB
subtask20/8
3Wrong answer3ms2288 KiB
4Wrong answer18ms2508 KiB
5Wrong answer3ms2740 KiB
6Wrong answer3ms3000 KiB
subtask30/15
7Wrong answer3ms3072 KiB
8Wrong answer3ms3324 KiB
9Wrong answer3ms3316 KiB
10Wrong answer2ms3396 KiB
subtask40/22
11Wrong answer3ms3528 KiB
12Wrong answer18ms3800 KiB
13Wrong answer166ms4020 KiB
14Time limit exceeded1.562s4068 KiB
15Time limit exceeded1.554s3468 KiB
16Time limit exceeded1.574s4228 KiB
subtask50/5
17Wrong answer3ms4388 KiB
18Wrong answer3ms4404 KiB
19Wrong answer3ms4292 KiB
20Wrong answer3ms4428 KiB
subtask60/8
21Wrong answer3ms4540 KiB
22Wrong answer3ms4572 KiB
23Wrong answer3ms4456 KiB
24Wrong answer3ms4616 KiB
subtask70/15
25Wrong answer18ms4856 KiB
26Time limit exceeded1.578s4928 KiB
27Time limit exceeded1.557s5100 KiB
28Time limit exceeded1.552s4976 KiB
29Time limit exceeded1.572s4900 KiB
30Time limit exceeded1.569s4912 KiB
subtask80/20
31Time limit exceeded1.557s5036 KiB
32Time limit exceeded1.557s4956 KiB
33Time limit exceeded1.562s4116 KiB
34Time limit exceeded1.544s4944 KiB
35Time limit exceeded1.572s4980 KiB
36Time limit exceeded1.56s5000 KiB
subtask90/7
37Time limit exceeded1.565s4980 KiB
38Time limit exceeded1.552s5000 KiB
39Time limit exceeded1.557s5044 KiB
40Wrong answer2ms5152 KiB
41Time limit exceeded1.598s5256 KiB
42Wrong answer3ms5268 KiB