Submission #795983

#TimeUsernameProblemLanguageResultExecution timeMemory
795983NeroZeinSpring cleaning (CEOI20_cleaning)C++17
0 / 100
13 ms408 KiB
#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'; } } else { cout << 0 << ' ' << 0 << '\n'; } } return 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...