답안 #795977

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
795977 2023-07-28T02:41:41 Z NeroZein Chess Rush (CEOI20_chessrush) C++17
0 / 100
0 ms 212 KB
#include "bits/stdc++.h"

using namespace std;
 
int main() {
  ios::sync_with_stdio(false); 
  cin.tie(NULL); 
  int r, c, q;
  cin >> r >> c >> q;
  while (q--) {
    char p;
    int c1, c2;
    cin >> p >> c1 >> c2;
    if (p == 'P') {
      if (c1 == c2) {
        cout << 1 << ' ' << 1 << '\n';
      } else {
        cout << 0 << ' ' << 0 << '\n';
      }
    } 
    else if (p == 'R') {
      if (c1 == c2) {
        cout << 1 << ' ' << 1 << '\n';
      } else {
        cout << 2 << ' ' << 2 << '\n';
      }
    } 
    else if (p == 'Q') {
      if (r - 1 == abs(c2 - c1)) {//diagonal
        cout << 1 << ' ' << 1 << '\n';
      }
      else if (c1 == c2) {
        cout << 1 << ' ' << 1 << '\n';
      } else {
        cout << 2 << ' ' << 4 + (((r - 1) - abs(c2 - c1)) % 2 == 0) << '\n';
      }
    } 
  }
  return 0; 
}
# 결과 실행 시간 메모리 Grader output
1 Incorrect 0 ms 212 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 0 ms 212 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 0 ms 212 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 0 ms 212 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 0 ms 212 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 0 ms 212 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 0 ms 212 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 0 ms 212 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 0 ms 212 KB Output isn't correct
2 Halted 0 ms 0 KB -