Submission #860348

# Submission time Handle Problem Language Result Execution time Memory
860348 2023-10-12T16:54:30 Z sofijavelkovska Chess Rush (CEOI20_chessrush) C++14
0 / 100
1 ms 600 KB
#include <bits/stdc++.h>
using namespace std;

int m, n;

int queendiagonal(int x, int y)
{
    if (y<x)
        swap(x, y);
    if ((m+y-x-1)%2==1)
        return 0;
    int a=(m+y-x-1)/2;
    int b=m-1-a;
    if (x+a<=n && x-b>=1)
        return 2;
    if (x+a<=n || x-b>=1)
        return 1;

    return 0;
}

int main()
{
    int q, x, y;
    char type;
    cin >> m >> n >> q;
    while (q--)
    {
        cin >> type >> x >> y;
        if (type=='P')
        {
            if (x==y)
                cout << 1 << " " << 1 << '\n';
            else
                cout << 0 << " " << 0 << '\n';
        }
        if (type=='R')
        {
            if (x==y)
                cout << 1 << " " << 1 << '\n';
            else
                cout << 2 << " " << 2 << '\n';
        }
        if (type=='Q')
        {
            if (x==y)
                cout << 1 << " " << 1 << '\n';
            else
                cout << 2 << " " << 4+queendiagonal(x, y) << '\n';
        }
    }

    return 0;
}
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 348 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 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 600 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 600 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 600 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 600 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 348 KB Output isn't correct
2 Halted 0 ms 0 KB -