CSES - Putka Open 2020 – 4/5 - Results
Submission details
Task:Peli
Sender:rasastusni
Submission time:2020-11-07 22:31:54 +0200
Language:Python2 (PyPy2)
Status:READY
Result:100
Feedback
groupverdictscore
#1ACCEPTED35
#2ACCEPTED65
Test results
testverdicttimegroup
#1ACCEPTED0.04 s1, 2details
#2ACCEPTED0.04 s2details

Code

#!/usr/bin/env python

t = int(raw_input())
for x in range(t):
	thing = raw_input()
	first = thing.find('P')
	second = first + 1 + thing[first+1:].find('P')
	print (second - first) % 2 + 1

Test details

Test 1

Group: 1, 2

Verdict: ACCEPTED

input
100
PP.
P......P.
.PP
..P.P.
...

correct output
2
2
2
1
2
...

user output
2
2
2
1
2
...
Truncated

Test 2

Group: 2

Verdict: ACCEPTED

input
100
.................................

correct output
2
1
2
1
1
...

user output
2
1
2
1
1
...
Truncated