Submission #1002176

# Submission time Handle Problem Language Result Execution time Memory
1002176 2024-06-19T10:43:21 Z RaresFelix Chess Rush (CEOI20_chessrush) C++17
0 / 100
0 ms 348 KB
#include <bits/stdc++.h>

using namespace std;

int main() {
    cin.tie(0);
    ios_base::sync_with_stdio(0);
    int r, c, q;
    cin >> r >> c >> q;
    for(int i = 0; i < q; ++i) {
        char t;
        int c1, c2;
        cin >> t >> c1 >> c2;
        --c1; --c2;
        if(t == 'P') {
            if(c1 != c2) cout << "0 0\n";
            else cout << r - 1 << " 1\n";
        }
        if(t == 'R') {
            if(c1 == c2) cout << "1 1\n";
            else cout << "2 2\n";
        }
        if(t == 'Q') {
            if(c1 == c2) cout << "1 1\n";
            else {
                int nr = 4;
                ///asta se poate inlocuii cu un bishop + verificare cost = 2
                if(r == c && abs(c2 - c1) == c - 1) --nr;
                else if((c1 + c2 + r) % 2 == 1) {
                    int x1 = (c1 + c2 + r - 1) / 2;
                    int x2 = (c1 + c2 - (r - 1)) / 2;
                    if(x1 >= 0 && x1 < c) ++nr;
                    if(x2 >= 0 && x2 < c) ++nr;
                }
                cout << "2 " << nr << "\n";
            }
        }
    }
    return 0;
}
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 344 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 348 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 348 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 348 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 348 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 348 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 348 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 348 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 344 KB Output isn't correct
2 Halted 0 ms 0 KB -