Task: | Peli |
Sender: | PallomerenPiikki |
Submission time: | 2020-11-06 18:07:59 +0200 |
Language: | C++ (C++17) |
Status: | READY |
Result: | 100 |
group | verdict | score |
---|---|---|
#1 | ACCEPTED | 35 |
#2 | ACCEPTED | 65 |
test | verdict | time | group | |
---|---|---|---|---|
#1 | ACCEPTED | 0.01 s | 1, 2 | details |
#2 | ACCEPTED | 0.01 s | 2 | details |
Code
#include <bits/stdc++.h>using namespace std;#define int long longsigned main() {ios::sync_with_stdio(0);int t;cin >> t;while (t--) {string s;cin >> s;int i = s.find_first_of('P');int j = s.find_last_of('P');cout << (1+(j-i)%2) << '\n';}}