| Task: | Peli |
| Sender: | Gomhog |
| Submission time: | 2020-11-06 19:07:23 +0200 |
| Language: | C++ (C++11) |
| 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>
typedef long long ll;
typedef long double ld;
#define F first
#define S second
using namespace std;
int main() {
ios_base::sync_with_stdio(false);
cin.tie(0);
int tst;
cin>>tst;
for (int t=0;t<tst;t++) {
string s;
cin>>s;
int i1=-1;
int i2=-1;
int n=s.size();
for (int i=0;i<n;i++) {
if (s[i]=='P') {
if (i1==-1) i1=i;
else i2=i;
}
}
cout<<((i2-i1)%2)+1<<"\n";
}
}
