답안 #409964

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
409964 2021-05-21T19:55:39 Z dolphingarlic Chess Rush (CEOI20_chessrush) C++14
0 / 100
1 ms 204 KB
#include "arithmetics.h"

#include <bits/stdc++.h>
typedef long long ll;
using namespace std;

int main() {
    cin.tie(0)->sync_with_stdio(0);
    int r, c, q;
    cin >> r >> c >> q;
    while (q--) {
        char c;
        int x, y;
        cin >> c >> x >> y;
        switch (c) {
            case 'P':
                if (x == y)
                    cout << r - 1 << " 1\n";
                else
                    cout << "0 0\n";
                break;
            case 'R':
                if (x == y)
                    cout << "1 1\n";
                else
                    cout << "2 2\n";
                break;
            case 'Q':
                if (x == y || x + r - 1 == y || x - r + 1 == y)
                    cout << "1 1\n";
                else {
                    int ways = 4;
                    if ((x + y + r) & 1) {
                        if (r - x < y) ways++;
                        if (r - c + x - 1 < c - y + 1) ways++;
                    }
                    cout << "2 " << ways << '\n';
                }
                break;
            case 'B':
                // Not yet implemented
                cout << "NYI\n";
                break;
            case 'K':
                // Not yet implemented
                cout << "NYI\n";
                break;
        }
    }
    return 0;
}
# 결과 실행 시간 메모리 Grader output
1 Incorrect 1 ms 204 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 1 ms 204 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 1 ms 204 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 1 ms 204 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 1 ms 204 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 1 ms 204 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 1 ms 204 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 1 ms 204 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 1 ms 204 KB Output isn't correct
2 Halted 0 ms 0 KB -