Task: | Peli |
Sender: | Sisuaski |
Submission time: | 2020-11-07 16:36:01 +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 <iostream> using namespace std; int main() { int t;cin>>t; while(t--){ string s;cin>>s; int a = s.find_first_of("P"); int b = s.find_last_of("P"); cout<<1+((b-a)&1)<<'\n'; } }