description stringlengths 171 4k | code stringlengths 94 3.98k | normalized_code stringlengths 57 4.99k |
|---|---|---|
Recently, you found a bot to play "Rock paper scissors" with. Unfortunately, the bot uses quite a simple algorithm to play: he has a string $s = s_1 s_2 \dots s_{n}$ of length $n$ where each letter is either R, S or P.
While initializing, the bot is choosing a starting index $pos$ ($1 \le pos \le n$), and then it can ... | t = int(input())
while t:
t -= 1
a = list(input())
prs = [0, 0, 0]
for i in a:
if i == "P":
prs[0] += 1
elif i == "R":
prs[1] += 1
elif i == "S":
prs[2] += 1
if prs[0] >= prs[1] and prs[0] >= prs[2]:
ans = "S"
elif prs[1] >= prs... | ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR WHILE VAR VAR NUMBER ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR LIST NUMBER NUMBER NUMBER FOR VAR VAR IF VAR STRING VAR NUMBER NUMBER IF VAR STRING VAR NUMBER NUMBER IF VAR STRING VAR NUMBER NUMBER IF VAR NUMBER VAR NUMBER VAR NUMBER VAR NUMBER ASSIGN VAR STRING IF VAR NUMB... |
Recently, you found a bot to play "Rock paper scissors" with. Unfortunately, the bot uses quite a simple algorithm to play: he has a string $s = s_1 s_2 \dots s_{n}$ of length $n$ where each letter is either R, S or P.
While initializing, the bot is choosing a starting index $pos$ ($1 \le pos \le n$), and then it can ... | t = int(input())
for _ in range(t):
l = input()
d = {"R": "P", "P": "S", "S": "R"}
figures = ["R", "P", "S"]
counts = [l.count("R"), l.count("P"), l.count("S")]
print(d[figures[counts.index(max(counts))]] * len(l)) | ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR FOR VAR FUNC_CALL VAR VAR ASSIGN VAR FUNC_CALL VAR ASSIGN VAR DICT STRING STRING STRING STRING STRING STRING ASSIGN VAR LIST STRING STRING STRING ASSIGN VAR LIST FUNC_CALL VAR STRING FUNC_CALL VAR STRING FUNC_CALL VAR STRING EXPR FUNC_CALL VAR BIN_OP VAR VAR FUNC_CALL VAR FUNC_CAL... |
Recently, you found a bot to play "Rock paper scissors" with. Unfortunately, the bot uses quite a simple algorithm to play: he has a string $s = s_1 s_2 \dots s_{n}$ of length $n$ where each letter is either R, S or P.
While initializing, the bot is choosing a starting index $pos$ ($1 \le pos \le n$), and then it can ... | for _ in range(int(input())):
s = list(input())
R = s.count("R")
S = s.count("S")
P = s.count("P")
m = max(R, max(S, P))
R -= m
S -= m
P -= m
if R == 0:
print("P" * len(s))
elif S == 0:
print("R" * len(s))
elif P == 0:
print("S" * len(s)) | FOR VAR FUNC_CALL VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR STRING ASSIGN VAR FUNC_CALL VAR STRING ASSIGN VAR FUNC_CALL VAR STRING ASSIGN VAR FUNC_CALL VAR VAR FUNC_CALL VAR VAR VAR VAR VAR VAR VAR VAR VAR IF VAR NUMBER EXPR FUNC_CALL VAR BIN_OP STRING FUNC_CALL VAR... |
Recently, you found a bot to play "Rock paper scissors" with. Unfortunately, the bot uses quite a simple algorithm to play: he has a string $s = s_1 s_2 \dots s_{n}$ of length $n$ where each letter is either R, S or P.
While initializing, the bot is choosing a starting index $pos$ ($1 \le pos \le n$), and then it can ... | n = int(input())
for _ in range(0, n):
a = input()
x = len(a)
p = 0
r = 0
s = 0
for i in range(0, len(a)):
if a[i] == "R":
r += 1
if a[i] == "P":
p += 1
if a[i] == "S":
s += 1
if p >= s and p >= r:
while x:
print... | ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR FOR VAR FUNC_CALL VAR NUMBER VAR ASSIGN VAR FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR VAR ASSIGN VAR NUMBER ASSIGN VAR NUMBER ASSIGN VAR NUMBER FOR VAR FUNC_CALL VAR NUMBER FUNC_CALL VAR VAR IF VAR VAR STRING VAR NUMBER IF VAR VAR STRING VAR NUMBER IF VAR VAR STRING VAR NUMBER IF VAR... |
Recently, you found a bot to play "Rock paper scissors" with. Unfortunately, the bot uses quite a simple algorithm to play: he has a string $s = s_1 s_2 \dots s_{n}$ of length $n$ where each letter is either R, S or P.
While initializing, the bot is choosing a starting index $pos$ ($1 \le pos \le n$), and then it can ... | cases = int(input())
for i in range(cases):
s = input()
rock = "R"
scis = "S"
pape = "P"
ans = ""
r1 = s.count(rock)
s1 = s.count(scis)
p1 = s.count(pape)
ma = max(r1, s1, p1)
if ma == r1:
ans += len(s) * "P"
elif ma == s1:
ans += len(s) * "R"
elif ma == p... | ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR FOR VAR FUNC_CALL VAR VAR ASSIGN VAR FUNC_CALL VAR ASSIGN VAR STRING ASSIGN VAR STRING ASSIGN VAR STRING ASSIGN VAR STRING ASSIGN VAR FUNC_CALL VAR VAR ASSIGN VAR FUNC_CALL VAR VAR ASSIGN VAR FUNC_CALL VAR VAR ASSIGN VAR FUNC_CALL VAR VAR VAR VAR IF VAR VAR VAR BIN_OP FUNC_CALL VA... |
Recently, you found a bot to play "Rock paper scissors" with. Unfortunately, the bot uses quite a simple algorithm to play: he has a string $s = s_1 s_2 \dots s_{n}$ of length $n$ where each letter is either R, S or P.
While initializing, the bot is choosing a starting index $pos$ ($1 \le pos \le n$), and then it can ... | for _ in range(int(input())):
s = input()
a = {"R": 0, "S": 0, "P": 0}
b = {"R": "P", "S": "R", "P": "S"}
for i in s:
a[i] += 1
val = max(a, key=a.get)
print(b[val] * len(s)) | FOR VAR FUNC_CALL VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR ASSIGN VAR DICT STRING STRING STRING NUMBER NUMBER NUMBER ASSIGN VAR DICT STRING STRING STRING STRING STRING STRING FOR VAR VAR VAR VAR NUMBER ASSIGN VAR FUNC_CALL VAR VAR VAR EXPR FUNC_CALL VAR BIN_OP VAR VAR FUNC_CALL VAR VAR |
Recently, you found a bot to play "Rock paper scissors" with. Unfortunately, the bot uses quite a simple algorithm to play: he has a string $s = s_1 s_2 \dots s_{n}$ of length $n$ where each letter is either R, S or P.
While initializing, the bot is choosing a starting index $pos$ ($1 \le pos \le n$), and then it can ... | t = int(input())
while t:
t -= 1
s = input()
n = len(s)
d = {"R": 0, "P": 0, "S": 0}
for i in range(n):
d[s[i]] += 1
if d["R"] == max(d.values()):
print("P" * n)
elif d["P"] == max(d.values()):
print("S" * n)
elif d["S"] == max(d.values()):
print("R" * n) | ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR WHILE VAR VAR NUMBER ASSIGN VAR FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR VAR ASSIGN VAR DICT STRING STRING STRING NUMBER NUMBER NUMBER FOR VAR FUNC_CALL VAR VAR VAR VAR VAR NUMBER IF VAR STRING FUNC_CALL VAR FUNC_CALL VAR EXPR FUNC_CALL VAR BIN_OP STRING VAR IF VAR STRING FUNC_CALL ... |
Recently, you found a bot to play "Rock paper scissors" with. Unfortunately, the bot uses quite a simple algorithm to play: he has a string $s = s_1 s_2 \dots s_{n}$ of length $n$ where each letter is either R, S or P.
While initializing, the bot is choosing a starting index $pos$ ($1 \le pos \le n$), and then it can ... | for testcase in range(int(input())):
s = input().strip()
cnt = {"R": 0, "S": 0, "P": 0}
for i in s:
cnt[i] += 1
_, w = max(zip(cnt.values(), cnt.keys()))
ans = {"R": "P", "P": "S", "S": "R"}[w] * len(s)
print(ans) | FOR VAR FUNC_CALL VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR DICT STRING STRING STRING NUMBER NUMBER NUMBER FOR VAR VAR VAR VAR NUMBER ASSIGN VAR VAR FUNC_CALL VAR FUNC_CALL VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR BIN_OP DICT STRING STRING STRING STRING STRING STRING VAR FUNC_CALL ... |
Recently, you found a bot to play "Rock paper scissors" with. Unfortunately, the bot uses quite a simple algorithm to play: he has a string $s = s_1 s_2 \dots s_{n}$ of length $n$ where each letter is either R, S or P.
While initializing, the bot is choosing a starting index $pos$ ($1 \le pos \le n$), and then it can ... | t = int(input())
for i in range(t):
ch = input()
n = len(ch)
nbR = ch.count("R")
nbS = ch.count("S")
nbP = ch.count("P")
L = [nbR, nbS, nbP]
if nbR == max(L):
print("P" * n)
elif nbS == max(L):
print("R" * n)
else:
print("S" * n) | ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR FOR VAR FUNC_CALL VAR VAR ASSIGN VAR FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR VAR ASSIGN VAR FUNC_CALL VAR STRING ASSIGN VAR FUNC_CALL VAR STRING ASSIGN VAR FUNC_CALL VAR STRING ASSIGN VAR LIST VAR VAR VAR IF VAR FUNC_CALL VAR VAR EXPR FUNC_CALL VAR BIN_OP STRING VAR IF VAR FUNC_CAL... |
Recently, you found a bot to play "Rock paper scissors" with. Unfortunately, the bot uses quite a simple algorithm to play: he has a string $s = s_1 s_2 \dots s_{n}$ of length $n$ where each letter is either R, S or P.
While initializing, the bot is choosing a starting index $pos$ ($1 \le pos \le n$), and then it can ... | t = int(input())
while t > 0:
s = str(input())
R = s.count("R")
P = s.count("P")
S = s.count("S")
A = max(R, P, S)
n = len(s)
if A == R:
for i in range(n):
print("P", end="")
elif A == P:
for j in range(n):
print("S", end="")
elif A == S:
... | ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR WHILE VAR NUMBER ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR STRING ASSIGN VAR FUNC_CALL VAR STRING ASSIGN VAR FUNC_CALL VAR STRING ASSIGN VAR FUNC_CALL VAR VAR VAR VAR ASSIGN VAR FUNC_CALL VAR VAR IF VAR VAR FOR VAR FUNC_CALL VAR VAR EXPR FUNC_CALL VAR STRING ... |
Recently, you found a bot to play "Rock paper scissors" with. Unfortunately, the bot uses quite a simple algorithm to play: he has a string $s = s_1 s_2 \dots s_{n}$ of length $n$ where each letter is either R, S or P.
While initializing, the bot is choosing a starting index $pos$ ($1 \le pos \le n$), and then it can ... | s = int(input())
for tc in range(s):
d = {}
string = input()
for i in string:
if i in d:
d[i] += 1
else:
d[i] = 1
sorted_d = sorted(d.items(), key=lambda x: x[1])
letter = sorted_d[-1][0]
if letter == "R":
ans = "P"
elif letter == "P":
... | ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR FOR VAR FUNC_CALL VAR VAR ASSIGN VAR DICT ASSIGN VAR FUNC_CALL VAR FOR VAR VAR IF VAR VAR VAR VAR NUMBER ASSIGN VAR VAR NUMBER ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR VAR NUMBER ASSIGN VAR VAR NUMBER NUMBER IF VAR STRING ASSIGN VAR STRING IF VAR STRING ASSIGN VAR STRING IF VAR STRI... |
Recently, you found a bot to play "Rock paper scissors" with. Unfortunately, the bot uses quite a simple algorithm to play: he has a string $s = s_1 s_2 \dots s_{n}$ of length $n$ where each letter is either R, S or P.
While initializing, the bot is choosing a starting index $pos$ ($1 \le pos \le n$), and then it can ... | for t in range(int(input())):
s = input()
l = [0] * 3
n = len(s)
for z in range(n):
if s[z] == "R":
l[0] += 1
elif s[z] == "P":
l[1] += 1
else:
l[-1] += 1
idx = l.index(max(l))
if idx == 0:
ans = ["P"] * n
elif idx == 1:
... | FOR VAR FUNC_CALL VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR ASSIGN VAR BIN_OP LIST NUMBER NUMBER ASSIGN VAR FUNC_CALL VAR VAR FOR VAR FUNC_CALL VAR VAR IF VAR VAR STRING VAR NUMBER NUMBER IF VAR VAR STRING VAR NUMBER NUMBER VAR NUMBER NUMBER ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR VAR IF VAR NUMBER ASSIGN... |
Recently, you found a bot to play "Rock paper scissors" with. Unfortunately, the bot uses quite a simple algorithm to play: he has a string $s = s_1 s_2 \dots s_{n}$ of length $n$ where each letter is either R, S or P.
While initializing, the bot is choosing a starting index $pos$ ($1 \le pos \le n$), and then it can ... | t = int(input())
for i in range(t):
s = str(input())
n = len(s)
a = ""
s1 = 0
s2 = 0
s3 = 0
for j in range(n):
if s[j] == "R":
s1 += 1
elif s[j] == "P":
s2 += 1
else:
s3 += 1
lis = [s1, s2, s3]
lis.sort()
if lis[-1] != l... | ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR FOR VAR FUNC_CALL VAR VAR ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR VAR ASSIGN VAR STRING ASSIGN VAR NUMBER ASSIGN VAR NUMBER ASSIGN VAR NUMBER FOR VAR FUNC_CALL VAR VAR IF VAR VAR STRING VAR NUMBER IF VAR VAR STRING VAR NUMBER VAR NUMBER ASSIGN VAR LIST VAR ... |
Recently, you found a bot to play "Rock paper scissors" with. Unfortunately, the bot uses quite a simple algorithm to play: he has a string $s = s_1 s_2 \dots s_{n}$ of length $n$ where each letter is either R, S or P.
While initializing, the bot is choosing a starting index $pos$ ($1 \le pos \le n$), and then it can ... | def solve():
s = input()
d = {"R": 0, "S": 0, "P": 0}
for c in s:
d[c] += 1
m = max(d.values())
print(len(s) * "PRS"[[*d.values()].index(m)])
def main():
for _ in range(int(input())):
solve()
main() | FUNC_DEF ASSIGN VAR FUNC_CALL VAR ASSIGN VAR DICT STRING STRING STRING NUMBER NUMBER NUMBER FOR VAR VAR VAR VAR NUMBER ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR EXPR FUNC_CALL VAR BIN_OP FUNC_CALL VAR VAR STRING FUNC_CALL LIST FUNC_CALL VAR VAR FUNC_DEF FOR VAR FUNC_CALL VAR FUNC_CALL VAR FUNC_CALL VAR EXPR FUNC_CALL VAR ... |
Recently, you found a bot to play "Rock paper scissors" with. Unfortunately, the bot uses quite a simple algorithm to play: he has a string $s = s_1 s_2 \dots s_{n}$ of length $n$ where each letter is either R, S or P.
While initializing, the bot is choosing a starting index $pos$ ($1 \le pos \le n$), and then it can ... | for _ in range(int(input())):
s = input()
n = len(s)
d = {"R": "P", "P": "S", "S": "R"}
freq = {}
for i in s:
freq[i] = freq.get(i, 0) + 1
maxx = max(freq, key=freq.get)
ans = d[maxx] * n
print(ans) | FOR VAR FUNC_CALL VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR VAR ASSIGN VAR DICT STRING STRING STRING STRING STRING STRING ASSIGN VAR DICT FOR VAR VAR ASSIGN VAR VAR BIN_OP FUNC_CALL VAR VAR NUMBER NUMBER ASSIGN VAR FUNC_CALL VAR VAR VAR ASSIGN VAR BIN_OP VAR VAR VAR EXPR FUNC_CAL... |
Recently, you found a bot to play "Rock paper scissors" with. Unfortunately, the bot uses quite a simple algorithm to play: he has a string $s = s_1 s_2 \dots s_{n}$ of length $n$ where each letter is either R, S or P.
While initializing, the bot is choosing a starting index $pos$ ($1 \le pos \le n$), and then it can ... | from sys import *
t = int(stdin.readline())
while t > 0:
s = stdin.readline()
d = dict()
for i in range(len(s)):
if s[i] not in d:
d[s[i]] = 1
else:
d[s[i]] += 1
dk = max(d, key=d.get)
if dk == "R":
ans = "P"
if dk == "P":
ans = "S"
if... | ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR WHILE VAR NUMBER ASSIGN VAR FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR FOR VAR FUNC_CALL VAR FUNC_CALL VAR VAR IF VAR VAR VAR ASSIGN VAR VAR VAR NUMBER VAR VAR VAR NUMBER ASSIGN VAR FUNC_CALL VAR VAR VAR IF VAR STRING ASSIGN VAR STRING IF VAR STRING ASSIGN VAR STRING IF VAR STRING ASS... |
Recently, you found a bot to play "Rock paper scissors" with. Unfortunately, the bot uses quite a simple algorithm to play: he has a string $s = s_1 s_2 \dots s_{n}$ of length $n$ where each letter is either R, S or P.
While initializing, the bot is choosing a starting index $pos$ ($1 \le pos \le n$), and then it can ... | n = int(input())
for i in range(n):
string = str(input())
flag = 0
r = 0
s = 0
p = 0
for j in range(0, len(string)):
if string[j] == "R":
r = r + 1
elif string[j] == "S":
s = s + 1
elif string[j] == "P":
p = p + 1
m = 0
if r >= ... | ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR FOR VAR FUNC_CALL VAR VAR ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR NUMBER ASSIGN VAR NUMBER ASSIGN VAR NUMBER ASSIGN VAR NUMBER FOR VAR FUNC_CALL VAR NUMBER FUNC_CALL VAR VAR IF VAR VAR STRING ASSIGN VAR BIN_OP VAR NUMBER IF VAR VAR STRING ASSIGN VAR BIN_OP VAR NUMBER IF ... |
Recently, you found a bot to play "Rock paper scissors" with. Unfortunately, the bot uses quite a simple algorithm to play: he has a string $s = s_1 s_2 \dots s_{n}$ of length $n$ where each letter is either R, S or P.
While initializing, the bot is choosing a starting index $pos$ ($1 \le pos \le n$), and then it can ... | for u in range(int(input())):
s = input()
n = len(s)
h = dict()
l = ["R", "S", "P"]
r = ["P", "R", "S"]
for i in l:
h[s.count(i)] = i
t = max(h)
out = [r[l.index(h[t])]] * n
print("".join(out)) | FOR VAR FUNC_CALL VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR VAR ASSIGN VAR FUNC_CALL VAR ASSIGN VAR LIST STRING STRING STRING ASSIGN VAR LIST STRING STRING STRING FOR VAR VAR ASSIGN VAR FUNC_CALL VAR VAR VAR ASSIGN VAR FUNC_CALL VAR VAR ASSIGN VAR BIN_OP LIST VAR FUNC_CALL VAR VA... |
Recently, you found a bot to play "Rock paper scissors" with. Unfortunately, the bot uses quite a simple algorithm to play: he has a string $s = s_1 s_2 \dots s_{n}$ of length $n$ where each letter is either R, S or P.
While initializing, the bot is choosing a starting index $pos$ ($1 \le pos \le n$), and then it can ... | for _ in range(int(input())):
s = input()
tmp = {s.count("S"): "S", s.count("P"): "P", s.count("R"): "R"}
tmp = tmp[max(tmp)]
ans = {"R": "P", "S": "R", "P": "S"}
print(ans[tmp] * len(s)) | FOR VAR FUNC_CALL VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR ASSIGN VAR DICT FUNC_CALL VAR STRING FUNC_CALL VAR STRING FUNC_CALL VAR STRING STRING STRING STRING ASSIGN VAR VAR FUNC_CALL VAR VAR ASSIGN VAR DICT STRING STRING STRING STRING STRING STRING EXPR FUNC_CALL VAR BIN_OP VAR VAR FUNC_CALL VAR VAR |
Recently, you found a bot to play "Rock paper scissors" with. Unfortunately, the bot uses quite a simple algorithm to play: he has a string $s = s_1 s_2 \dots s_{n}$ of length $n$ where each letter is either R, S or P.
While initializing, the bot is choosing a starting index $pos$ ($1 \le pos \le n$), and then it can ... | for z in range(int(input())):
s = input()
d = {"R": 0, "P": 0, "S": 0}
for c in s:
d[c] += 1
mc = max(d, key=d.get)
print({"R": "P", "P": "S", "S": "R"}[mc] * len(s)) | FOR VAR FUNC_CALL VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR ASSIGN VAR DICT STRING STRING STRING NUMBER NUMBER NUMBER FOR VAR VAR VAR VAR NUMBER ASSIGN VAR FUNC_CALL VAR VAR VAR EXPR FUNC_CALL VAR BIN_OP DICT STRING STRING STRING STRING STRING STRING VAR FUNC_CALL VAR VAR |
Recently, you found a bot to play "Rock paper scissors" with. Unfortunately, the bot uses quite a simple algorithm to play: he has a string $s = s_1 s_2 \dots s_{n}$ of length $n$ where each letter is either R, S or P.
While initializing, the bot is choosing a starting index $pos$ ($1 \le pos \le n$), and then it can ... | def in1():
return int(input())
for _ in range(in1()):
s = list(input())
d = [0, 0, 0]
for i in range(len(s) - 1, -1, -1):
if s[i] == "R":
d[0] += 1
elif s[i] == "S":
d[1] += 1
else:
d[2] += 1
s1 = ""
t1 = max(d)
t2 = d.index(t1)
... | FUNC_DEF RETURN FUNC_CALL VAR FUNC_CALL VAR FOR VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR LIST NUMBER NUMBER NUMBER FOR VAR FUNC_CALL VAR BIN_OP FUNC_CALL VAR VAR NUMBER NUMBER NUMBER IF VAR VAR STRING VAR NUMBER NUMBER IF VAR VAR STRING VAR NUMBER NUMBER VAR NUMBER NUMBER ASSIGN... |
Recently, you found a bot to play "Rock paper scissors" with. Unfortunately, the bot uses quite a simple algorithm to play: he has a string $s = s_1 s_2 \dots s_{n}$ of length $n$ where each letter is either R, S or P.
While initializing, the bot is choosing a starting index $pos$ ($1 \le pos \le n$), and then it can ... | def solve():
lst = list(input())
n = len(lst)
r = 0
s = 0
p = 0
for i in lst:
if i == "R":
p += 1
if i == "S":
r += 1
if i == "P":
s += 1
q = max([r, s, p])
if r == q:
print("R" * n)
elif s == q:
print("S" * ... | FUNC_DEF ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR VAR ASSIGN VAR NUMBER ASSIGN VAR NUMBER ASSIGN VAR NUMBER FOR VAR VAR IF VAR STRING VAR NUMBER IF VAR STRING VAR NUMBER IF VAR STRING VAR NUMBER ASSIGN VAR FUNC_CALL VAR LIST VAR VAR VAR IF VAR VAR EXPR FUNC_CALL VAR BIN_OP STRING VAR IF VAR VAR E... |
Recently, you found a bot to play "Rock paper scissors" with. Unfortunately, the bot uses quite a simple algorithm to play: he has a string $s = s_1 s_2 \dots s_{n}$ of length $n$ where each letter is either R, S or P.
While initializing, the bot is choosing a starting index $pos$ ($1 \le pos \le n$), and then it can ... | for _ in range(int(input())):
arr = list(input())
a = arr.count("R")
b = arr.count("P")
c = arr.count("S")
if a == b == c:
print("".join(arr))
elif a is max(a, b, c):
arr2 = ["P"] * len(arr)
print("".join(arr2))
elif b is max(a, b, c):
arr2 = ["S"] * len(arr)
... | FOR VAR FUNC_CALL VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR STRING ASSIGN VAR FUNC_CALL VAR STRING ASSIGN VAR FUNC_CALL VAR STRING IF VAR VAR VAR EXPR FUNC_CALL VAR FUNC_CALL STRING VAR IF VAR FUNC_CALL VAR VAR VAR VAR ASSIGN VAR BIN_OP LIST STRING FUNC_CALL VAR VAR... |
Recently, you found a bot to play "Rock paper scissors" with. Unfortunately, the bot uses quite a simple algorithm to play: he has a string $s = s_1 s_2 \dots s_{n}$ of length $n$ where each letter is either R, S or P.
While initializing, the bot is choosing a starting index $pos$ ($1 \le pos \le n$), and then it can ... | t = int(input())
for i in range(t):
s = input()
l = len(s)
m = 0
for each in set(s):
if s.count(each) > m:
m = s.count(each)
x = each
if x == "R":
print("P" * l)
elif x == "S":
print("R" * l)
elif x == "P":
print("S" * l) | ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR FOR VAR FUNC_CALL VAR VAR ASSIGN VAR FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR VAR ASSIGN VAR NUMBER FOR VAR FUNC_CALL VAR VAR IF FUNC_CALL VAR VAR VAR ASSIGN VAR FUNC_CALL VAR VAR ASSIGN VAR VAR IF VAR STRING EXPR FUNC_CALL VAR BIN_OP STRING VAR IF VAR STRING EXPR FUNC_CALL VAR BIN_... |
Recently, you found a bot to play "Rock paper scissors" with. Unfortunately, the bot uses quite a simple algorithm to play: he has a string $s = s_1 s_2 \dots s_{n}$ of length $n$ where each letter is either R, S or P.
While initializing, the bot is choosing a starting index $pos$ ($1 \le pos \le n$), and then it can ... | for _ in range(int(input())):
s = input()
d = dict()
d["R"] = 0
d["S"] = 0
d["P"] = 0
d1 = dict()
d1["R"] = "P"
d1["S"] = "R"
d1["P"] = "S"
for i in s:
d[i] += 1
ans = ""
c = ""
mx = -1
for i in list(d.items()):
if mx < i[1]:
c = d1[i[0... | FOR VAR FUNC_CALL VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR ASSIGN VAR STRING NUMBER ASSIGN VAR STRING NUMBER ASSIGN VAR STRING NUMBER ASSIGN VAR FUNC_CALL VAR ASSIGN VAR STRING STRING ASSIGN VAR STRING STRING ASSIGN VAR STRING STRING FOR VAR VAR VAR VAR NUMBER ASSIGN VAR STRING ... |
Recently, you found a bot to play "Rock paper scissors" with. Unfortunately, the bot uses quite a simple algorithm to play: he has a string $s = s_1 s_2 \dots s_{n}$ of length $n$ where each letter is either R, S or P.
While initializing, the bot is choosing a starting index $pos$ ($1 \le pos \le n$), and then it can ... | import sys
input = sys.stdin.readline
inp, ip = lambda: int(input()), lambda: [int(w) for w in input().split()]
for _ in range(inp()):
s = input().strip()
n = len(s)
dt = {}
for i in s:
dt[i] = dt.get(i, 0) + 1
mx = -1
for i in dt:
if dt[i] == max(dt.values()):
mx = ... | IMPORT ASSIGN VAR VAR ASSIGN VAR VAR FUNC_CALL VAR FUNC_CALL VAR FUNC_CALL VAR VAR VAR FUNC_CALL FUNC_CALL VAR FOR VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR VAR ASSIGN VAR DICT FOR VAR VAR ASSIGN VAR VAR BIN_OP FUNC_CALL VAR VAR NUMBER NUMBER ASSIGN VAR NUMBER FOR VAR V... |
Recently, you found a bot to play "Rock paper scissors" with. Unfortunately, the bot uses quite a simple algorithm to play: he has a string $s = s_1 s_2 \dots s_{n}$ of length $n$ where each letter is either R, S or P.
While initializing, the bot is choosing a starting index $pos$ ($1 \le pos \le n$), and then it can ... | def maximum(a, b, c):
list = [a, b, c]
return max(list)
n = int(input())
for i in range(0, n):
s = str(input())
a = list(s)
countp = 0
counts = 0
countr = 0
b = len(s)
for j in range(b):
if a[j] == "R":
countr += 1
elif a[j] == "P":
countp +=... | FUNC_DEF ASSIGN VAR LIST VAR VAR VAR RETURN FUNC_CALL VAR VAR ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR FOR VAR FUNC_CALL VAR NUMBER VAR ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR VAR ASSIGN VAR NUMBER ASSIGN VAR NUMBER ASSIGN VAR NUMBER ASSIGN VAR FUNC_CALL VAR VAR FOR VAR FUNC_CALL VAR VAR IF VAR VA... |
Recently, you found a bot to play "Rock paper scissors" with. Unfortunately, the bot uses quite a simple algorithm to play: he has a string $s = s_1 s_2 \dots s_{n}$ of length $n$ where each letter is either R, S or P.
While initializing, the bot is choosing a starting index $pos$ ($1 \le pos \le n$), and then it can ... | for _ in range(int(input())):
a = input().strip()
n = len(a)
r, p, s = a.count("R"), a.count("P"), a.count("S")
if r == 0 and p == 0:
print("R" * n)
elif p == 0 and s == 0:
print("P" * n)
elif s == 0 and r == 0:
print("S" * n)
elif r == p and p == s and s == r:
... | FOR VAR FUNC_CALL VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR VAR ASSIGN VAR VAR VAR FUNC_CALL VAR STRING FUNC_CALL VAR STRING FUNC_CALL VAR STRING IF VAR NUMBER VAR NUMBER EXPR FUNC_CALL VAR BIN_OP STRING VAR IF VAR NUMBER VAR NUMBER EXPR FUNC_CALL VAR BIN_OP STRING VAR ... |
Recently, you found a bot to play "Rock paper scissors" with. Unfortunately, the bot uses quite a simple algorithm to play: he has a string $s = s_1 s_2 \dots s_{n}$ of length $n$ where each letter is either R, S or P.
While initializing, the bot is choosing a starting index $pos$ ($1 \le pos \le n$), and then it can ... | for _ in range(int(input())):
s = input()
d = {"R": "P", "S": "R", "P": "S"}
print(d[max("RSP", key=lambda x: s.count(x))] * len(s)) | FOR VAR FUNC_CALL VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR ASSIGN VAR DICT STRING STRING STRING STRING STRING STRING EXPR FUNC_CALL VAR BIN_OP VAR FUNC_CALL VAR STRING FUNC_CALL VAR VAR FUNC_CALL VAR VAR |
Recently, you found a bot to play "Rock paper scissors" with. Unfortunately, the bot uses quite a simple algorithm to play: he has a string $s = s_1 s_2 \dots s_{n}$ of length $n$ where each letter is either R, S or P.
While initializing, the bot is choosing a starting index $pos$ ($1 \le pos \le n$), and then it can ... | def mi():
return map(int, input().split())
def ii():
return int(input())
def li():
return list(map(int, input().split()))
def si():
return input().split()
t = ii()
ans = [
"PPP",
"PPR",
"PPS",
"PRP",
"PRR",
"PRS",
"PSP",
"PSR",
"PSS",
"RPP",
"RPR",
... | FUNC_DEF RETURN FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR FUNC_DEF RETURN FUNC_CALL VAR FUNC_CALL VAR FUNC_DEF RETURN FUNC_CALL VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR FUNC_DEF RETURN FUNC_CALL FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR ASSIGN VAR LIST STRING STRING STRING STRING STRING STRING STRING STRING STRING ST... |
Recently, you found a bot to play "Rock paper scissors" with. Unfortunately, the bot uses quite a simple algorithm to play: he has a string $s = s_1 s_2 \dots s_{n}$ of length $n$ where each letter is either R, S or P.
While initializing, the bot is choosing a starting index $pos$ ($1 \le pos \le n$), and then it can ... | t = int(input())
for _ in range(t):
s = str(input())
n = len(s)
d = {}
for x in s:
if x in d:
d[x] += 1
else:
d[x] = 1
mn = -1
fx = None
for x in d:
if mn < d[x]:
mn = d[x]
fx = x
if fx == "R":
c = "P" * n
... | ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR FOR VAR FUNC_CALL VAR VAR ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR VAR ASSIGN VAR DICT FOR VAR VAR IF VAR VAR VAR VAR NUMBER ASSIGN VAR VAR NUMBER ASSIGN VAR NUMBER ASSIGN VAR NONE FOR VAR VAR IF VAR VAR VAR ASSIGN VAR VAR VAR ASSIGN VAR VAR IF VAR STRING AS... |
Recently, you found a bot to play "Rock paper scissors" with. Unfortunately, the bot uses quite a simple algorithm to play: he has a string $s = s_1 s_2 \dots s_{n}$ of length $n$ where each letter is either R, S or P.
While initializing, the bot is choosing a starting index $pos$ ($1 \le pos \le n$), and then it can ... | r = {"S": "R", "P": "S", "R": "P"}
for _ in range(int(input())):
s = input()
sc, pc, rc = s.count("S"), s.count("P"), s.count("R")
if max(sc, pc, rc) == sc:
print(r["S"] * len(s))
elif max(sc, pc, rc) == pc:
print(r["P"] * len(s))
elif max(sc, pc, rc) == rc:
print(r["R"] * le... | ASSIGN VAR DICT STRING STRING STRING STRING STRING STRING FOR VAR FUNC_CALL VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR ASSIGN VAR VAR VAR FUNC_CALL VAR STRING FUNC_CALL VAR STRING FUNC_CALL VAR STRING IF FUNC_CALL VAR VAR VAR VAR VAR EXPR FUNC_CALL VAR BIN_OP VAR STRING FUNC_CALL VAR VAR IF FUNC_CALL VAR ... |
Recently, you found a bot to play "Rock paper scissors" with. Unfortunately, the bot uses quite a simple algorithm to play: he has a string $s = s_1 s_2 \dots s_{n}$ of length $n$ where each letter is either R, S or P.
While initializing, the bot is choosing a starting index $pos$ ($1 \le pos \le n$), and then it can ... | for _ in range(int(input())):
n = input()
r, p, s = 0, 0, 0
for i in n:
if i == "R":
r += 1
elif i == "P":
p += 1
else:
s += 1
if r >= p and r >= s:
print("P" * len(n))
elif p >= r and p >= s:
print("S" * len(n))
else:
... | FOR VAR FUNC_CALL VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR ASSIGN VAR VAR VAR NUMBER NUMBER NUMBER FOR VAR VAR IF VAR STRING VAR NUMBER IF VAR STRING VAR NUMBER VAR NUMBER IF VAR VAR VAR VAR EXPR FUNC_CALL VAR BIN_OP STRING FUNC_CALL VAR VAR IF VAR VAR VAR VAR EXPR FUNC_CALL VAR BIN_OP STRING FUNC_CALL ... |
Recently, you found a bot to play "Rock paper scissors" with. Unfortunately, the bot uses quite a simple algorithm to play: he has a string $s = s_1 s_2 \dots s_{n}$ of length $n$ where each letter is either R, S or P.
While initializing, the bot is choosing a starting index $pos$ ($1 \le pos \le n$), and then it can ... | tests = int(input())
for test in range(tests):
s = input()
cnt = {"P": 0, "R": 0, "S": 0}
for ch in s:
cnt[ch] += 1
best = "P"
for k, v in cnt.items():
if cnt[best] < v:
best = k
winner = {"P": "S", "R": "P", "S": "R"}
print(winner[best] * len(s)) | ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR FOR VAR FUNC_CALL VAR VAR ASSIGN VAR FUNC_CALL VAR ASSIGN VAR DICT STRING STRING STRING NUMBER NUMBER NUMBER FOR VAR VAR VAR VAR NUMBER ASSIGN VAR STRING FOR VAR VAR FUNC_CALL VAR IF VAR VAR VAR ASSIGN VAR VAR ASSIGN VAR DICT STRING STRING STRING STRING STRING STRING EXPR FUNC_CAL... |
Recently, you found a bot to play "Rock paper scissors" with. Unfortunately, the bot uses quite a simple algorithm to play: he has a string $s = s_1 s_2 \dots s_{n}$ of length $n$ where each letter is either R, S or P.
While initializing, the bot is choosing a starting index $pos$ ($1 \le pos \le n$), and then it can ... | t = int(input())
for _ in range(t):
s = str(input())
n = len(s)
a = {"R", "P", "S"}
r = s.count("R")
p = s.count("P")
s = s.count("S")
if r == max(r, p, s):
ans = n * "P"
elif p == max(r, p, s):
ans = n * "S"
else:
ans = n * "R"
print(ans) | ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR FOR VAR FUNC_CALL VAR VAR ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR VAR ASSIGN VAR STRING STRING STRING ASSIGN VAR FUNC_CALL VAR STRING ASSIGN VAR FUNC_CALL VAR STRING ASSIGN VAR FUNC_CALL VAR STRING IF VAR FUNC_CALL VAR VAR VAR VAR ASSIGN VAR BIN_OP VAR STRI... |
Recently, you found a bot to play "Rock paper scissors" with. Unfortunately, the bot uses quite a simple algorithm to play: he has a string $s = s_1 s_2 \dots s_{n}$ of length $n$ where each letter is either R, S or P.
While initializing, the bot is choosing a starting index $pos$ ($1 \le pos \le n$), and then it can ... | t = int(input())
def majorityCnt(classList):
count_dict = {}
for label in classList:
if label not in count_dict.keys():
count_dict[label] = 0
count_dict[label] += 1
return max(zip(count_dict.values(), count_dict.keys()))[1]
for _ in range(t):
s = list(input())
res_dic... | ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR FUNC_DEF ASSIGN VAR DICT FOR VAR VAR IF VAR FUNC_CALL VAR ASSIGN VAR VAR NUMBER VAR VAR NUMBER RETURN FUNC_CALL VAR FUNC_CALL VAR FUNC_CALL VAR FUNC_CALL VAR NUMBER FOR VAR FUNC_CALL VAR VAR ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR DICT STRING STRING STRING STRING STRING ... |
Recently, you found a bot to play "Rock paper scissors" with. Unfortunately, the bot uses quite a simple algorithm to play: he has a string $s = s_1 s_2 \dots s_{n}$ of length $n$ where each letter is either R, S or P.
While initializing, the bot is choosing a starting index $pos$ ($1 \le pos \le n$), and then it can ... | tests = int(input())
for t in range(tests):
string = input()
roks = 0
paper = 0
scissor = 0
for n in range(len(string)):
if string[n] == "R":
roks += 1
elif string[n] == "P":
paper += 1
else:
scissor += 1
print_str = (
"P" * (ro... | ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR FOR VAR FUNC_CALL VAR VAR ASSIGN VAR FUNC_CALL VAR ASSIGN VAR NUMBER ASSIGN VAR NUMBER ASSIGN VAR NUMBER FOR VAR FUNC_CALL VAR FUNC_CALL VAR VAR IF VAR VAR STRING VAR NUMBER IF VAR VAR STRING VAR NUMBER VAR NUMBER ASSIGN VAR BIN_OP BIN_OP BIN_OP STRING VAR FUNC_CALL VAR VAR VAR BI... |
Recently, you found a bot to play "Rock paper scissors" with. Unfortunately, the bot uses quite a simple algorithm to play: he has a string $s = s_1 s_2 \dots s_{n}$ of length $n$ where each letter is either R, S or P.
While initializing, the bot is choosing a starting index $pos$ ($1 \le pos \le n$), and then it can ... | for _ in range(int(input())):
s = str(input())
l = list(s)
x = l.count("R")
y = l.count("S")
z = l.count("P")
if x >= y and x >= z:
for i in range(len(s)):
print("P", end="")
elif y >= x and y >= z:
for i in range(len(s)):
print("R", end="")
elif z... | FOR VAR FUNC_CALL VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR VAR ASSIGN VAR FUNC_CALL VAR STRING ASSIGN VAR FUNC_CALL VAR STRING ASSIGN VAR FUNC_CALL VAR STRING IF VAR VAR VAR VAR FOR VAR FUNC_CALL VAR FUNC_CALL VAR VAR EXPR FUNC_CALL VAR STRING STRING IF VAR VAR VAR... |
Recently, you found a bot to play "Rock paper scissors" with. Unfortunately, the bot uses quite a simple algorithm to play: he has a string $s = s_1 s_2 \dots s_{n}$ of length $n$ where each letter is either R, S or P.
While initializing, the bot is choosing a starting index $pos$ ($1 \le pos \le n$), and then it can ... | for _ in range(int(input())):
a = input()
n = len(a)
x = a.count("R")
y = a.count("S")
z = a.count("P")
if x == y == z:
print("".join(a), end="")
elif max(x, y, z) == x:
for i in range(n):
print("P", end="")
elif max(x, y, z) == y:
for i in range(n):
... | FOR VAR FUNC_CALL VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR VAR ASSIGN VAR FUNC_CALL VAR STRING ASSIGN VAR FUNC_CALL VAR STRING ASSIGN VAR FUNC_CALL VAR STRING IF VAR VAR VAR EXPR FUNC_CALL VAR FUNC_CALL STRING VAR STRING IF FUNC_CALL VAR VAR VAR VAR VAR FOR VAR FUNC_CALL VAR VAR... |
Recently, you found a bot to play "Rock paper scissors" with. Unfortunately, the bot uses quite a simple algorithm to play: he has a string $s = s_1 s_2 \dots s_{n}$ of length $n$ where each letter is either R, S or P.
While initializing, the bot is choosing a starting index $pos$ ($1 \le pos \le n$), and then it can ... | for _ in range(int(input())):
n = str(input())
r = 0
p = 0
s = 0
for i in n:
if i == "R":
r += 1
if i == "P":
p += 1
if i == "S":
s += 1
if r == p == s:
print(n)
elif max(r, p, s) == r:
print("P" * len(n))
elif m... | FOR VAR FUNC_CALL VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR NUMBER ASSIGN VAR NUMBER ASSIGN VAR NUMBER FOR VAR VAR IF VAR STRING VAR NUMBER IF VAR STRING VAR NUMBER IF VAR STRING VAR NUMBER IF VAR VAR VAR EXPR FUNC_CALL VAR VAR IF FUNC_CALL VAR VAR VAR VAR VAR EXPR FUNC_CALL VAR ... |
Recently, you found a bot to play "Rock paper scissors" with. Unfortunately, the bot uses quite a simple algorithm to play: he has a string $s = s_1 s_2 \dots s_{n}$ of length $n$ where each letter is either R, S or P.
While initializing, the bot is choosing a starting index $pos$ ($1 \le pos \le n$), and then it can ... | for i in range(int(input())):
s = input()
a = {"P": 0, "R": 0, "S": 0}
for i in range(len(s)):
a[s[i]] += 1
ma = max(a["P"], a["R"], a["S"])
if a["R"] == ma:
ans = "P" * len(s)
elif a["P"] == ma:
ans = "S" * len(s)
elif a["S"] == ma:
ans = "R" * len(s)
pri... | FOR VAR FUNC_CALL VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR ASSIGN VAR DICT STRING STRING STRING NUMBER NUMBER NUMBER FOR VAR FUNC_CALL VAR FUNC_CALL VAR VAR VAR VAR VAR NUMBER ASSIGN VAR FUNC_CALL VAR VAR STRING VAR STRING VAR STRING IF VAR STRING VAR ASSIGN VAR BIN_OP STRING FUNC_CALL VAR VAR IF VAR ST... |
Recently, you found a bot to play "Rock paper scissors" with. Unfortunately, the bot uses quite a simple algorithm to play: he has a string $s = s_1 s_2 \dots s_{n}$ of length $n$ where each letter is either R, S or P.
While initializing, the bot is choosing a starting index $pos$ ($1 \le pos \le n$), and then it can ... | for ty in range(int(input())):
s = list(input())
p = 0
r = 0
o = 0
for i in range(len(s)):
if s[i] == "R":
s[i] = "P"
p += 1
elif s[i] == "S":
s[i] = "R"
r += 1
else:
s[i] = "S"
o += 1
if max(p, o, r)... | FOR VAR FUNC_CALL VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR NUMBER ASSIGN VAR NUMBER ASSIGN VAR NUMBER FOR VAR FUNC_CALL VAR FUNC_CALL VAR VAR IF VAR VAR STRING ASSIGN VAR VAR STRING VAR NUMBER IF VAR VAR STRING ASSIGN VAR VAR STRING VAR NUMBER ASSIGN VAR VAR STRING VAR NUMBER IF... |
Recently, you found a bot to play "Rock paper scissors" with. Unfortunately, the bot uses quite a simple algorithm to play: he has a string $s = s_1 s_2 \dots s_{n}$ of length $n$ where each letter is either R, S or P.
While initializing, the bot is choosing a starting index $pos$ ($1 \le pos \le n$), and then it can ... | for _ in range(int(input())):
s = input()
o = max("RSP", key=lambda x: s.count(x))
if o == "R":
o = "P"
elif o == "S":
o = "R"
else:
o = "S"
print(o * len(s)) | FOR VAR FUNC_CALL VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR STRING FUNC_CALL VAR VAR IF VAR STRING ASSIGN VAR STRING IF VAR STRING ASSIGN VAR STRING ASSIGN VAR STRING EXPR FUNC_CALL VAR BIN_OP VAR FUNC_CALL VAR VAR |
Recently, you found a bot to play "Rock paper scissors" with. Unfortunately, the bot uses quite a simple algorithm to play: he has a string $s = s_1 s_2 \dots s_{n}$ of length $n$ where each letter is either R, S or P.
While initializing, the bot is choosing a starting index $pos$ ($1 \le pos \le n$), and then it can ... | t = int(input())
for _ in range(t):
ip = input()
n = len(ip)
l = [0, 0, 0]
d = {"r": 0, "p": 0, "s": 0}
for i in ip:
if i == "R":
d["r"] += 1
elif i == "P":
d["p"] += 1
else:
d["s"] += 1
d1 = sorted(d.items(), key=lambda x: x[1], revers... | ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR FOR VAR FUNC_CALL VAR VAR ASSIGN VAR FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR VAR ASSIGN VAR LIST NUMBER NUMBER NUMBER ASSIGN VAR DICT STRING STRING STRING NUMBER NUMBER NUMBER FOR VAR VAR IF VAR STRING VAR STRING NUMBER IF VAR STRING VAR STRING NUMBER VAR STRING NUMBER ASSIGN VAR F... |
Recently, you found a bot to play "Rock paper scissors" with. Unfortunately, the bot uses quite a simple algorithm to play: he has a string $s = s_1 s_2 \dots s_{n}$ of length $n$ where each letter is either R, S or P.
While initializing, the bot is choosing a starting index $pos$ ($1 \le pos \le n$), and then it can ... | for _ in range(int(input())):
s = list(input())
s1 = set(s)
if len(s1) == 1:
if s[0] == "R":
print("P" * len(s))
elif s[0] == "P":
print("S" * len(s))
else:
print("R" * len(s))
else:
p = s.count("P")
r = s.count("R")
ss ... | FOR VAR FUNC_CALL VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR VAR IF FUNC_CALL VAR VAR NUMBER IF VAR NUMBER STRING EXPR FUNC_CALL VAR BIN_OP STRING FUNC_CALL VAR VAR IF VAR NUMBER STRING EXPR FUNC_CALL VAR BIN_OP STRING FUNC_CALL VAR VAR EXPR FUNC_CALL VAR BIN_OP STRI... |
Recently, you found a bot to play "Rock paper scissors" with. Unfortunately, the bot uses quite a simple algorithm to play: he has a string $s = s_1 s_2 \dots s_{n}$ of length $n$ where each letter is either R, S or P.
While initializing, the bot is choosing a starting index $pos$ ($1 \le pos \le n$), and then it can ... | n = int(input())
d = {"R": "P", "P": "S", "S": "R"}
for _ in range(n):
cnt = {"R": 0, "P": 0, "S": 0}
s = input()
for x in s:
cnt[x] += 1
for x in cnt.keys():
if cnt[x] == max(cnt.values()):
ans = x
print(d[ans] * len(s)) | ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR DICT STRING STRING STRING STRING STRING STRING FOR VAR FUNC_CALL VAR VAR ASSIGN VAR DICT STRING STRING STRING NUMBER NUMBER NUMBER ASSIGN VAR FUNC_CALL VAR FOR VAR VAR VAR VAR NUMBER FOR VAR FUNC_CALL VAR IF VAR VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR VAR EXPR FUNC_C... |
Recently, you found a bot to play "Rock paper scissors" with. Unfortunately, the bot uses quite a simple algorithm to play: he has a string $s = s_1 s_2 \dots s_{n}$ of length $n$ where each letter is either R, S or P.
While initializing, the bot is choosing a starting index $pos$ ($1 \le pos \le n$), and then it can ... | def most_frequent(lineup):
ans = {}
for i in lineup:
if i in ans:
ans[i] += 1
else:
ans[i] = 1
max_value = -1
for j in ans:
max_value = max(max_value, ans[j])
if max_value == ans[j]:
printed = j
if printed == "R":
return "P"... | FUNC_DEF ASSIGN VAR DICT FOR VAR VAR IF VAR VAR VAR VAR NUMBER ASSIGN VAR VAR NUMBER ASSIGN VAR NUMBER FOR VAR VAR ASSIGN VAR FUNC_CALL VAR VAR VAR VAR IF VAR VAR VAR ASSIGN VAR VAR IF VAR STRING RETURN STRING IF VAR STRING RETURN STRING RETURN STRING FOR VAR FUNC_CALL VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR FUNC_CA... |
Recently, you found a bot to play "Rock paper scissors" with. Unfortunately, the bot uses quite a simple algorithm to play: he has a string $s = s_1 s_2 \dots s_{n}$ of length $n$ where each letter is either R, S or P.
While initializing, the bot is choosing a starting index $pos$ ($1 \le pos \le n$), and then it can ... | r = "R"
p = "P"
s = "S"
c = [r, p, s]
for _ in range(int(input())):
n = input()
a = {r: 0, p: 0, s: 0}
for v in n:
a[v] += 1
best = 0
bc = r
for k, v in a.items():
if v > best:
best = v
bc = k
print(c[(c.index(bc) + 1) % 3] * len(n)) | ASSIGN VAR STRING ASSIGN VAR STRING ASSIGN VAR STRING ASSIGN VAR LIST VAR VAR VAR FOR VAR FUNC_CALL VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR ASSIGN VAR DICT VAR VAR VAR NUMBER NUMBER NUMBER FOR VAR VAR VAR VAR NUMBER ASSIGN VAR NUMBER ASSIGN VAR VAR FOR VAR VAR FUNC_CALL VAR IF VAR VAR ASSIGN VAR VAR AS... |
Recently, you found a bot to play "Rock paper scissors" with. Unfortunately, the bot uses quite a simple algorithm to play: he has a string $s = s_1 s_2 \dots s_{n}$ of length $n$ where each letter is either R, S or P.
While initializing, the bot is choosing a starting index $pos$ ($1 \le pos \le n$), and then it can ... | t = int(input())
for _ in range(t):
s = input()
rcount = 0
pcount = 0
scount = 0
for i in range(len(s)):
if s[i] == "R":
rcount += 1
if s[i] == "S":
scount += 1
if s[i] == "P":
pcount += 1
ans = []
if rcount >= pcount and rcount >= ... | ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR FOR VAR FUNC_CALL VAR VAR ASSIGN VAR FUNC_CALL VAR ASSIGN VAR NUMBER ASSIGN VAR NUMBER ASSIGN VAR NUMBER FOR VAR FUNC_CALL VAR FUNC_CALL VAR VAR IF VAR VAR STRING VAR NUMBER IF VAR VAR STRING VAR NUMBER IF VAR VAR STRING VAR NUMBER ASSIGN VAR LIST IF VAR VAR VAR VAR FOR VAR FUNC_C... |
Recently, you found a bot to play "Rock paper scissors" with. Unfortunately, the bot uses quite a simple algorithm to play: he has a string $s = s_1 s_2 \dots s_{n}$ of length $n$ where each letter is either R, S or P.
While initializing, the bot is choosing a starting index $pos$ ($1 \le pos \le n$), and then it can ... | from sys import stdin
input = lambda: stdin.readline().rstrip()
for _ in range(int(input())):
s = input()
n = len(s)
S = R = P = 0
for i in s:
if i == "S":
S += 1
elif i == "R":
R += 1
else:
P += 1
k = max(S, R, P)
if k == S:
a... | ASSIGN VAR FUNC_CALL FUNC_CALL VAR FOR VAR FUNC_CALL VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR VAR ASSIGN VAR VAR VAR NUMBER FOR VAR VAR IF VAR STRING VAR NUMBER IF VAR STRING VAR NUMBER VAR NUMBER ASSIGN VAR FUNC_CALL VAR VAR VAR VAR IF VAR VAR ASSIGN VAR STRING IF VAR VAR ASSIG... |
Recently, you found a bot to play "Rock paper scissors" with. Unfortunately, the bot uses quite a simple algorithm to play: he has a string $s = s_1 s_2 \dots s_{n}$ of length $n$ where each letter is either R, S or P.
While initializing, the bot is choosing a starting index $pos$ ($1 \le pos \le n$), and then it can ... | for _ in range(int(input())):
s = input()
opp = {"R": "P", "S": "R", "P": "S"}
counts = {"R": 0, "S": 0, "P": 0}
hi, bestC = 0, "R"
for c in s:
counts[c] += 1
if counts[c] > hi:
hi = counts[c]
bestC = c
print(opp[bestC] * len(s)) | FOR VAR FUNC_CALL VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR ASSIGN VAR DICT STRING STRING STRING STRING STRING STRING ASSIGN VAR DICT STRING STRING STRING NUMBER NUMBER NUMBER ASSIGN VAR VAR NUMBER STRING FOR VAR VAR VAR VAR NUMBER IF VAR VAR VAR ASSIGN VAR VAR VAR ASSIGN VAR VAR EXPR FUNC_CALL VAR BIN_O... |
Recently, you found a bot to play "Rock paper scissors" with. Unfortunately, the bot uses quite a simple algorithm to play: he has a string $s = s_1 s_2 \dots s_{n}$ of length $n$ where each letter is either R, S or P.
While initializing, the bot is choosing a starting index $pos$ ($1 \le pos \le n$), and then it can ... | t = int(input())
for x in range(t):
s = list(input())
rocks = s.count("R")
scissors = s.count("S")
paper = s.count("P")
if rocks == scissors and paper == scissors:
print("".join(s))
elif rocks == max(scissors, paper, rocks):
print("P" * len(s))
elif paper == max(scissors, pap... | ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR FOR VAR FUNC_CALL VAR VAR ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR STRING ASSIGN VAR FUNC_CALL VAR STRING ASSIGN VAR FUNC_CALL VAR STRING IF VAR VAR VAR VAR EXPR FUNC_CALL VAR FUNC_CALL STRING VAR IF VAR FUNC_CALL VAR VAR VAR VAR EXPR FUNC_CALL VAR BIN_OP ST... |
Recently, you found a bot to play "Rock paper scissors" with. Unfortunately, the bot uses quite a simple algorithm to play: he has a string $s = s_1 s_2 \dots s_{n}$ of length $n$ where each letter is either R, S or P.
While initializing, the bot is choosing a starting index $pos$ ($1 \le pos \le n$), and then it can ... | T = int(input())
for _ in range(T):
arr = input().strip()
n = len(arr)
R, P, S = 0, 0, 0
for ch in arr:
if ch == "R":
R += 1
elif ch == "P":
P += 1
else:
S += 1
maxc = max(max(R, P), S)
ans = ""
if R == maxc:
for i in range(... | ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR FOR VAR FUNC_CALL VAR VAR ASSIGN VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR VAR ASSIGN VAR VAR VAR NUMBER NUMBER NUMBER FOR VAR VAR IF VAR STRING VAR NUMBER IF VAR STRING VAR NUMBER VAR NUMBER ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR VAR VAR VAR ASSIGN VAR STRING IF VAR VA... |
Recently, you found a bot to play "Rock paper scissors" with. Unfortunately, the bot uses quite a simple algorithm to play: he has a string $s = s_1 s_2 \dots s_{n}$ of length $n$ where each letter is either R, S or P.
While initializing, the bot is choosing a starting index $pos$ ($1 \le pos \le n$), and then it can ... | t = int(input())
x = ["R", "S", "P"]
for _ in range(t):
s = list(input())
n = len(s)
cnt = [s.count(x[i]) for i in range(3)]
c = x[(cnt.index(max(cnt)) - 1) % 3]
print(c * n) | ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR LIST STRING STRING STRING FOR VAR FUNC_CALL VAR VAR ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR VAR ASSIGN VAR FUNC_CALL VAR VAR VAR VAR FUNC_CALL VAR NUMBER ASSIGN VAR VAR BIN_OP BIN_OP FUNC_CALL VAR FUNC_CALL VAR VAR NUMBER NUMBER EXPR FUNC_CALL VA... |
Recently, you found a bot to play "Rock paper scissors" with. Unfortunately, the bot uses quite a simple algorithm to play: he has a string $s = s_1 s_2 \dots s_{n}$ of length $n$ where each letter is either R, S or P.
While initializing, the bot is choosing a starting index $pos$ ($1 \le pos \le n$), and then it can ... | t = int(input())
for _ in range(t):
a = input()
r = a.count("R")
p = a.count("P")
s = a.count("S")
if r >= p and r >= s:
print("P" * len(a))
elif p >= r and p >= s:
print("S" * len(a))
elif s >= p and s >= r:
print("R" * len(a)) | ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR FOR VAR FUNC_CALL VAR VAR ASSIGN VAR FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR STRING ASSIGN VAR FUNC_CALL VAR STRING ASSIGN VAR FUNC_CALL VAR STRING IF VAR VAR VAR VAR EXPR FUNC_CALL VAR BIN_OP STRING FUNC_CALL VAR VAR IF VAR VAR VAR VAR EXPR FUNC_CALL VAR BIN_OP STRING FUNC_CALL VA... |
Recently, you found a bot to play "Rock paper scissors" with. Unfortunately, the bot uses quite a simple algorithm to play: he has a string $s = s_1 s_2 \dots s_{n}$ of length $n$ where each letter is either R, S or P.
While initializing, the bot is choosing a starting index $pos$ ($1 \le pos \le n$), and then it can ... | t = int(input())
for q in range(t):
s = input()
n = len(s)
hs = [0, 0, 0]
for i in range(n):
if s[i] == "R":
hs[0] += 1
elif s[i] == "P":
hs[1] += 1
else:
hs[2] += 1
c = "P"
if hs[0] == max(hs):
c = "P"
elif hs[1] == max(hs)... | ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR FOR VAR FUNC_CALL VAR VAR ASSIGN VAR FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR VAR ASSIGN VAR LIST NUMBER NUMBER NUMBER FOR VAR FUNC_CALL VAR VAR IF VAR VAR STRING VAR NUMBER NUMBER IF VAR VAR STRING VAR NUMBER NUMBER VAR NUMBER NUMBER ASSIGN VAR STRING IF VAR NUMBER FUNC_CALL VAR VA... |
Recently, you found a bot to play "Rock paper scissors" with. Unfortunately, the bot uses quite a simple algorithm to play: he has a string $s = s_1 s_2 \dots s_{n}$ of length $n$ where each letter is either R, S or P.
While initializing, the bot is choosing a starting index $pos$ ($1 \le pos \le n$), and then it can ... | for t in range(int(input())):
s = input()
d = {}
for i in s:
if i in d:
d[i] += 1
else:
d[i] = 1
keylist = list(d.keys())
vallist = list(d.values())
m = 0
for i in d:
if m < d[i]:
m = d[i]
res = keylist[vallist.index(m)]
if ... | FOR VAR FUNC_CALL VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR ASSIGN VAR DICT FOR VAR VAR IF VAR VAR VAR VAR NUMBER ASSIGN VAR VAR NUMBER ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR NUMBER FOR VAR VAR IF VAR VAR VAR ASSIGN VAR VAR VAR ASSIGN VAR VAR FUNC_CALL VA... |
Recently, you found a bot to play "Rock paper scissors" with. Unfortunately, the bot uses quite a simple algorithm to play: he has a string $s = s_1 s_2 \dots s_{n}$ of length $n$ where each letter is either R, S or P.
While initializing, the bot is choosing a starting index $pos$ ($1 \le pos \le n$), and then it can ... | for _ in range(int(input())):
s = input()
dem1 = 0
dem2 = 0
dem3 = 0
result = ""
dem1 = s.count("R")
dem2 = s.count("S")
dem3 = s.count("P")
m = max(dem1, dem2, dem3)
if dem1 == m:
ans = "P"
elif dem2 >= dem3 and dem2 >= dem1:
ans = "R"
else:
ans =... | FOR VAR FUNC_CALL VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR ASSIGN VAR NUMBER ASSIGN VAR NUMBER ASSIGN VAR NUMBER ASSIGN VAR STRING ASSIGN VAR FUNC_CALL VAR STRING ASSIGN VAR FUNC_CALL VAR STRING ASSIGN VAR FUNC_CALL VAR STRING ASSIGN VAR FUNC_CALL VAR VAR VAR VAR IF VAR VAR ASSIGN VAR STRING IF VAR VAR ... |
Recently, you found a bot to play "Rock paper scissors" with. Unfortunately, the bot uses quite a simple algorithm to play: he has a string $s = s_1 s_2 \dots s_{n}$ of length $n$ where each letter is either R, S or P.
While initializing, the bot is choosing a starting index $pos$ ($1 \le pos \le n$), and then it can ... | for nt in range(int(input())):
string = input()
n = len(string)
r, s, p = 0, 0, 0
for i in string:
if i == "R":
r += 1
elif i == "S":
s += 1
else:
p += 1
new = [[r, "R"], [s, "S"], [p, "P"]]
new.sort()
win = new[-1][1]
if win ==... | FOR VAR FUNC_CALL VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR VAR ASSIGN VAR VAR VAR NUMBER NUMBER NUMBER FOR VAR VAR IF VAR STRING VAR NUMBER IF VAR STRING VAR NUMBER VAR NUMBER ASSIGN VAR LIST LIST VAR STRING LIST VAR STRING LIST VAR STRING EXPR FUNC_CALL VAR ASSIGN VAR VAR NUMBE... |
Recently, you found a bot to play "Rock paper scissors" with. Unfortunately, the bot uses quite a simple algorithm to play: he has a string $s = s_1 s_2 \dots s_{n}$ of length $n$ where each letter is either R, S or P.
While initializing, the bot is choosing a starting index $pos$ ($1 \le pos \le n$), and then it can ... | for _ in range(int(input())):
s = input()
dic = {"S": "R", "R": "P", "P": "S"}
d = {"S": 0, "R": 0, "P": 0}
for i in s:
d[i] += 1
if d["S"] == max(d.values()):
print("R" * len(s))
elif d["R"] == max(d.values()):
print("P" * len(s))
elif d["P"] == max(d.values()):
... | FOR VAR FUNC_CALL VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR ASSIGN VAR DICT STRING STRING STRING STRING STRING STRING ASSIGN VAR DICT STRING STRING STRING NUMBER NUMBER NUMBER FOR VAR VAR VAR VAR NUMBER IF VAR STRING FUNC_CALL VAR FUNC_CALL VAR EXPR FUNC_CALL VAR BIN_OP STRING FUNC_CALL VAR VAR IF VAR ST... |
Recently, you found a bot to play "Rock paper scissors" with. Unfortunately, the bot uses quite a simple algorithm to play: he has a string $s = s_1 s_2 \dots s_{n}$ of length $n$ where each letter is either R, S or P.
While initializing, the bot is choosing a starting index $pos$ ($1 \le pos \le n$), and then it can ... | t = int(input())
for i in range(t):
rsp = list(input())
rpsstring = ""
rps = {"R": "P", "P": "S", "S": "R"}
rc = 0
pc = 0
sc = 0
for k in rsp:
if k == "R":
rc += 1
continue
elif k == "P":
pc += 1
continue
else:
... | ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR FOR VAR FUNC_CALL VAR VAR ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR STRING ASSIGN VAR DICT STRING STRING STRING STRING STRING STRING ASSIGN VAR NUMBER ASSIGN VAR NUMBER ASSIGN VAR NUMBER FOR VAR VAR IF VAR STRING VAR NUMBER IF VAR STRING VAR NUMBER VAR NUMBER IF VAR VAR VA... |
Recently, you found a bot to play "Rock paper scissors" with. Unfortunately, the bot uses quite a simple algorithm to play: he has a string $s = s_1 s_2 \dots s_{n}$ of length $n$ where each letter is either R, S or P.
While initializing, the bot is choosing a starting index $pos$ ($1 \le pos \le n$), and then it can ... | import sys
def solve(a):
result = [" "] * len(a)
nr, np, ns = 0, 0, 0
for played in a:
if played == "R":
nr += 1
elif played == "P":
np += 1
elif played == "S":
ns += 1
MX = "R"
if max(nr, np, ns) == np:
MX = "S"
if max(nr, np... | IMPORT FUNC_DEF ASSIGN VAR BIN_OP LIST STRING FUNC_CALL VAR VAR ASSIGN VAR VAR VAR NUMBER NUMBER NUMBER FOR VAR VAR IF VAR STRING VAR NUMBER IF VAR STRING VAR NUMBER IF VAR STRING VAR NUMBER ASSIGN VAR STRING IF FUNC_CALL VAR VAR VAR VAR VAR ASSIGN VAR STRING IF FUNC_CALL VAR VAR VAR VAR VAR ASSIGN VAR STRING FOR VAR F... |
Recently, you found a bot to play "Rock paper scissors" with. Unfortunately, the bot uses quite a simple algorithm to play: he has a string $s = s_1 s_2 \dots s_{n}$ of length $n$ where each letter is either R, S or P.
While initializing, the bot is choosing a starting index $pos$ ($1 \le pos \le n$), and then it can ... | def main(s):
hash = {}
flip = {"S": "R", "R": "P", "P": "S"}
for i in s:
if i not in hash:
hash[i] = 1
else:
hash[i] += 1
char = ""
c = 0
for i in hash:
if hash[i] > c:
c = hash[i]
char = i
print(flip[char] * len(s))
n... | FUNC_DEF ASSIGN VAR DICT ASSIGN VAR DICT STRING STRING STRING STRING STRING STRING FOR VAR VAR IF VAR VAR ASSIGN VAR VAR NUMBER VAR VAR NUMBER ASSIGN VAR STRING ASSIGN VAR NUMBER FOR VAR VAR IF VAR VAR VAR ASSIGN VAR VAR VAR ASSIGN VAR VAR EXPR FUNC_CALL VAR BIN_OP VAR VAR FUNC_CALL VAR VAR ASSIGN VAR FUNC_CALL VAR FUN... |
Recently, you found a bot to play "Rock paper scissors" with. Unfortunately, the bot uses quite a simple algorithm to play: he has a string $s = s_1 s_2 \dots s_{n}$ of length $n$ where each letter is either R, S or P.
While initializing, the bot is choosing a starting index $pos$ ($1 \le pos \le n$), and then it can ... | t = int(input())
ans = []
for i in range(t):
s = input()
c = dict()
k = 0
c["R"] = 0
c["P"] = 0
c["S"] = 0
for j in s:
c[j] += 1
for j in c:
k = max(k, c[j])
if c["R"] == k:
ans.append("P" * len(s))
elif c["P"] == k:
ans.append("S" * len(s))
el... | ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR LIST FOR VAR FUNC_CALL VAR VAR ASSIGN VAR FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR ASSIGN VAR NUMBER ASSIGN VAR STRING NUMBER ASSIGN VAR STRING NUMBER ASSIGN VAR STRING NUMBER FOR VAR VAR VAR VAR NUMBER FOR VAR VAR ASSIGN VAR FUNC_CALL VAR VAR VAR VAR IF VAR STRING VAR EX... |
Recently, you found a bot to play "Rock paper scissors" with. Unfortunately, the bot uses quite a simple algorithm to play: he has a string $s = s_1 s_2 \dots s_{n}$ of length $n$ where each letter is either R, S or P.
While initializing, the bot is choosing a starting index $pos$ ($1 \le pos \le n$), and then it can ... | def solve():
s = input()
ans = ""
op = {"R": "P", "S": "R", "P": "S"}
counter = {}
mx = s[0]
mxc = 1
for c in s:
counter.setdefault(c, 0)
counter[c] += 1
if counter[c] > mxc:
mxc = counter[c]
mx = c
ans = op[mx] * len(s)
print(ans)
t ... | FUNC_DEF ASSIGN VAR FUNC_CALL VAR ASSIGN VAR STRING ASSIGN VAR DICT STRING STRING STRING STRING STRING STRING ASSIGN VAR DICT ASSIGN VAR VAR NUMBER ASSIGN VAR NUMBER FOR VAR VAR EXPR FUNC_CALL VAR VAR NUMBER VAR VAR NUMBER IF VAR VAR VAR ASSIGN VAR VAR VAR ASSIGN VAR VAR ASSIGN VAR BIN_OP VAR VAR FUNC_CALL VAR VAR EXPR... |
Recently, you found a bot to play "Rock paper scissors" with. Unfortunately, the bot uses quite a simple algorithm to play: he has a string $s = s_1 s_2 \dots s_{n}$ of length $n$ where each letter is either R, S or P.
While initializing, the bot is choosing a starting index $pos$ ($1 \le pos \le n$), and then it can ... | for test_i in range(int(input())):
s = input()
l = len(s)
n1, n2, n3 = s.count("R"), s.count("S"), s.count("P")
if n2 <= n1 >= n3:
print("P" * l)
elif n1 <= n2 >= n3:
print("R" * l)
else:
print("S" * l) | FOR VAR FUNC_CALL VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR VAR ASSIGN VAR VAR VAR FUNC_CALL VAR STRING FUNC_CALL VAR STRING FUNC_CALL VAR STRING IF VAR VAR VAR EXPR FUNC_CALL VAR BIN_OP STRING VAR IF VAR VAR VAR EXPR FUNC_CALL VAR BIN_OP STRING VAR EXPR FUNC_CALL VAR BIN_OP STRI... |
Recently, you found a bot to play "Rock paper scissors" with. Unfortunately, the bot uses quite a simple algorithm to play: he has a string $s = s_1 s_2 \dots s_{n}$ of length $n$ where each letter is either R, S or P.
While initializing, the bot is choosing a starting index $pos$ ($1 \le pos \le n$), and then it can ... | for _ in range(int(input())):
s = input()
x, y, z = 0, 0, 0
k = ""
for i in range(len(s)):
if s[i] == "R":
x += 1
elif s[i] == "S":
y += 1
else:
z += 1
if x >= y and x >= z:
k = k + "P" * len(s)
elif y >= x and y >= z:
k... | FOR VAR FUNC_CALL VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR ASSIGN VAR VAR VAR NUMBER NUMBER NUMBER ASSIGN VAR STRING FOR VAR FUNC_CALL VAR FUNC_CALL VAR VAR IF VAR VAR STRING VAR NUMBER IF VAR VAR STRING VAR NUMBER VAR NUMBER IF VAR VAR VAR VAR ASSIGN VAR BIN_OP VAR BIN_OP STRING FUNC_CALL VAR VAR IF VA... |
Recently, you found a bot to play "Rock paper scissors" with. Unfortunately, the bot uses quite a simple algorithm to play: he has a string $s = s_1 s_2 \dots s_{n}$ of length $n$ where each letter is either R, S or P.
While initializing, the bot is choosing a starting index $pos$ ($1 \le pos \le n$), and then it can ... | def checker(orig, ans):
for i in range(len(orig)):
score = 0
cnt = 0
for j in range(i, i + len(orig)):
ind = j % len(orig)
if orig[ind] == "P" and ans[cnt] == "S":
score += 1
elif orig[ind] == "S" and ans[cnt] == "R":
score ... | FUNC_DEF FOR VAR FUNC_CALL VAR FUNC_CALL VAR VAR ASSIGN VAR NUMBER ASSIGN VAR NUMBER FOR VAR FUNC_CALL VAR VAR BIN_OP VAR FUNC_CALL VAR VAR ASSIGN VAR BIN_OP VAR FUNC_CALL VAR VAR IF VAR VAR STRING VAR VAR STRING VAR NUMBER IF VAR VAR STRING VAR VAR STRING VAR NUMBER IF VAR VAR STRING VAR VAR STRING VAR NUMBER VAR NUMB... |
Recently, you found a bot to play "Rock paper scissors" with. Unfortunately, the bot uses quite a simple algorithm to play: he has a string $s = s_1 s_2 \dots s_{n}$ of length $n$ where each letter is either R, S or P.
While initializing, the bot is choosing a starting index $pos$ ($1 \le pos \le n$), and then it can ... | abc = int(input())
for x in range(abc):
s = input()
n = len(s)
n1 = s.count("R")
n2 = s.count("P")
n3 = n - n1 - n2
A = []
m = max(n1, n2, n3)
if m == n1:
A.append("P" * n)
elif m == n2:
A.append("S" * n)
else:
A.append("R" * n)
print("".join(A)) | ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR FOR VAR FUNC_CALL VAR VAR ASSIGN VAR FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR VAR ASSIGN VAR FUNC_CALL VAR STRING ASSIGN VAR FUNC_CALL VAR STRING ASSIGN VAR BIN_OP BIN_OP VAR VAR VAR ASSIGN VAR LIST ASSIGN VAR FUNC_CALL VAR VAR VAR VAR IF VAR VAR EXPR FUNC_CALL VAR BIN_OP STRING VAR... |
Recently, you found a bot to play "Rock paper scissors" with. Unfortunately, the bot uses quite a simple algorithm to play: he has a string $s = s_1 s_2 \dots s_{n}$ of length $n$ where each letter is either R, S or P.
While initializing, the bot is choosing a starting index $pos$ ($1 \le pos \le n$), and then it can ... | ans = []
for _ in range(int(input())):
s = list(input())
n = len(s)
cnt = [0] * 3
for i in range(n):
if s[i] == "R":
cnt[0] += 1
elif s[i] == "P":
cnt[1] += 1
else:
cnt[2] += 1
if cnt[0] == max(cnt):
ansi = "P" * n
elif cnt[1] =... | ASSIGN VAR LIST FOR VAR FUNC_CALL VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR VAR ASSIGN VAR BIN_OP LIST NUMBER NUMBER FOR VAR FUNC_CALL VAR VAR IF VAR VAR STRING VAR NUMBER NUMBER IF VAR VAR STRING VAR NUMBER NUMBER VAR NUMBER NUMBER IF VAR NUMBER FUNC_CALL VAR VAR A... |
Recently, you found a bot to play "Rock paper scissors" with. Unfortunately, the bot uses quite a simple algorithm to play: he has a string $s = s_1 s_2 \dots s_{n}$ of length $n$ where each letter is either R, S or P.
While initializing, the bot is choosing a starting index $pos$ ($1 \le pos \le n$), and then it can ... | t = int(input())
for _t in range(t):
s = input()
h = ["R", "P", "S"]
h2 = ["R", "P", "S", "R"]
m = 0
sol = ""
for k in range(len(h)):
if s.count(h[k]) > m:
m = s.count(h[k])
sol = h2[k + 1]
for i in range(len(s)):
print(sol, end="")
print("") | ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR FOR VAR FUNC_CALL VAR VAR ASSIGN VAR FUNC_CALL VAR ASSIGN VAR LIST STRING STRING STRING ASSIGN VAR LIST STRING STRING STRING STRING ASSIGN VAR NUMBER ASSIGN VAR STRING FOR VAR FUNC_CALL VAR FUNC_CALL VAR VAR IF FUNC_CALL VAR VAR VAR VAR ASSIGN VAR FUNC_CALL VAR VAR VAR ASSIGN VAR ... |
Recently, you found a bot to play "Rock paper scissors" with. Unfortunately, the bot uses quite a simple algorithm to play: he has a string $s = s_1 s_2 \dots s_{n}$ of length $n$ where each letter is either R, S or P.
While initializing, the bot is choosing a starting index $pos$ ($1 \le pos \le n$), and then it can ... | def sol(s: str) -> str:
R, S, P = s.count("R"), s.count("S"), s.count("P")
maxs = max(R, S, P)
if maxs == R:
return "P" * len(s)
elif maxs == S:
return "R" * len(s)
else:
return "S" * len(s)
tmp = []
p = print
def print(*args, **kwargs):
tmp.append((args, kwargs))
d... | FUNC_DEF VAR ASSIGN VAR VAR VAR FUNC_CALL VAR STRING FUNC_CALL VAR STRING FUNC_CALL VAR STRING ASSIGN VAR FUNC_CALL VAR VAR VAR VAR IF VAR VAR RETURN BIN_OP STRING FUNC_CALL VAR VAR IF VAR VAR RETURN BIN_OP STRING FUNC_CALL VAR VAR RETURN BIN_OP STRING FUNC_CALL VAR VAR VAR ASSIGN VAR LIST ASSIGN VAR VAR FUNC_DEF EXPR ... |
Recently, you found a bot to play "Rock paper scissors" with. Unfortunately, the bot uses quite a simple algorithm to play: he has a string $s = s_1 s_2 \dots s_{n}$ of length $n$ where each letter is either R, S or P.
While initializing, the bot is choosing a starting index $pos$ ($1 \le pos \le n$), and then it can ... | d = {"S": "R", "P": "S", "R": "P"}
for _ in range(int(input())):
s = input()
m = 0
c = ""
for i in d:
x = s.count(i)
if x >= m:
m = x
c = i
ans = d[c] * len(s)
print(ans) | ASSIGN VAR DICT STRING STRING STRING STRING STRING STRING FOR VAR FUNC_CALL VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR ASSIGN VAR NUMBER ASSIGN VAR STRING FOR VAR VAR ASSIGN VAR FUNC_CALL VAR VAR IF VAR VAR ASSIGN VAR VAR ASSIGN VAR VAR ASSIGN VAR BIN_OP VAR VAR FUNC_CALL VAR VAR EXPR FUNC_CALL VAR VAR |
Recently, you found a bot to play "Rock paper scissors" with. Unfortunately, the bot uses quite a simple algorithm to play: he has a string $s = s_1 s_2 \dots s_{n}$ of length $n$ where each letter is either R, S or P.
While initializing, the bot is choosing a starting index $pos$ ($1 \le pos \le n$), and then it can ... | t = int(input())
for _ in range(t):
s = input()
n = len(s)
ans = ""
d = {}
for i in s:
if i not in d:
d[i] = 1
else:
d[i] += 1
a = list(d.keys())
move = a[0]
for i in d:
if d[i] > d[move]:
move = i
if move == "R":
mo... | ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR FOR VAR FUNC_CALL VAR VAR ASSIGN VAR FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR VAR ASSIGN VAR STRING ASSIGN VAR DICT FOR VAR VAR IF VAR VAR ASSIGN VAR VAR NUMBER VAR VAR NUMBER ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR VAR NUMBER FOR VAR VAR IF VAR VAR VAR VAR ASSIGN VAR VAR ... |
Recently, you found a bot to play "Rock paper scissors" with. Unfortunately, the bot uses quite a simple algorithm to play: he has a string $s = s_1 s_2 \dots s_{n}$ of length $n$ where each letter is either R, S or P.
While initializing, the bot is choosing a starting index $pos$ ($1 \le pos \le n$), and then it can ... | T = int(input())
while T > 0:
s = input()
dic = {"R": 0, "S": 1, "P": 2}
count = [0] * 3
for i in range(len(s)):
count[dic[s[i]]] += 1
x = 0
index = 0
for i in range(3):
if count[i] > x:
x = count[i]
index = i
if index == 0:
print("P" * len... | ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR WHILE VAR NUMBER ASSIGN VAR FUNC_CALL VAR ASSIGN VAR DICT STRING STRING STRING NUMBER NUMBER NUMBER ASSIGN VAR BIN_OP LIST NUMBER NUMBER FOR VAR FUNC_CALL VAR FUNC_CALL VAR VAR VAR VAR VAR VAR NUMBER ASSIGN VAR NUMBER ASSIGN VAR NUMBER FOR VAR FUNC_CALL VAR NUMBER IF VAR VAR VAR A... |
Recently, you found a bot to play "Rock paper scissors" with. Unfortunately, the bot uses quite a simple algorithm to play: he has a string $s = s_1 s_2 \dots s_{n}$ of length $n$ where each letter is either R, S or P.
While initializing, the bot is choosing a starting index $pos$ ($1 \le pos \le n$), and then it can ... | import sys
print = sys.stdout.write
dic = {"R": "P", "P": "S", "S": "R"}
for _ in range(int(input())):
s = input()
a = max(["R", "P", "S"], key=s.count)
print(dic[a] * len(s) + "\n") | IMPORT ASSIGN VAR VAR ASSIGN VAR DICT STRING STRING STRING STRING STRING STRING FOR VAR FUNC_CALL VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR LIST STRING STRING STRING VAR EXPR FUNC_CALL VAR BIN_OP BIN_OP VAR VAR FUNC_CALL VAR VAR STRING |
Recently, you found a bot to play "Rock paper scissors" with. Unfortunately, the bot uses quite a simple algorithm to play: he has a string $s = s_1 s_2 \dots s_{n}$ of length $n$ where each letter is either R, S or P.
While initializing, the bot is choosing a starting index $pos$ ($1 \le pos \le n$), and then it can ... | for _ in range(int(input())):
s = input()
L = len(s)
count = [0] * 3
for i in s:
if i == "R":
count[0] += 1
elif i == "P":
count[1] += 1
else:
count[2] += 1
if count[0] == max(count):
print("P" * L)
elif count[1] == max(count):
... | FOR VAR FUNC_CALL VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR VAR ASSIGN VAR BIN_OP LIST NUMBER NUMBER FOR VAR VAR IF VAR STRING VAR NUMBER NUMBER IF VAR STRING VAR NUMBER NUMBER VAR NUMBER NUMBER IF VAR NUMBER FUNC_CALL VAR VAR EXPR FUNC_CALL VAR BIN_OP STRING VAR IF VAR NUMBER FU... |
Recently, you found a bot to play "Rock paper scissors" with. Unfortunately, the bot uses quite a simple algorithm to play: he has a string $s = s_1 s_2 \dots s_{n}$ of length $n$ where each letter is either R, S or P.
While initializing, the bot is choosing a starting index $pos$ ($1 \le pos \le n$), and then it can ... | for tc in range(int(input())):
A = input()
R = 0
S = 0
P = 0
for i in A:
exec(i + "+=1")
if R >= S and R >= P:
print("P" * len(A))
elif S >= R and S >= P:
print("R" * len(A))
else:
print("S" * len(A)) | FOR VAR FUNC_CALL VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR ASSIGN VAR NUMBER ASSIGN VAR NUMBER ASSIGN VAR NUMBER FOR VAR VAR EXPR FUNC_CALL VAR BIN_OP VAR STRING IF VAR VAR VAR VAR EXPR FUNC_CALL VAR BIN_OP STRING FUNC_CALL VAR VAR IF VAR VAR VAR VAR EXPR FUNC_CALL VAR BIN_OP STRING FUNC_CALL VAR VAR EX... |
Recently, you found a bot to play "Rock paper scissors" with. Unfortunately, the bot uses quite a simple algorithm to play: he has a string $s = s_1 s_2 \dots s_{n}$ of length $n$ where each letter is either R, S or P.
While initializing, the bot is choosing a starting index $pos$ ($1 \le pos \le n$), and then it can ... | __MULTITEST = True
def solve():
s = str(input())
play = {}
play["R"] = "P"
play["P"] = "S"
play["S"] = "R"
maxChar = "P"
for p in ["R", "S"]:
if s.count(p) > s.count(maxChar):
maxChar = p
tac = play[maxChar] * len(s)
print(tac)
t = int(input()) if __MULTITEST ... | ASSIGN VAR NUMBER FUNC_DEF ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR DICT ASSIGN VAR STRING STRING ASSIGN VAR STRING STRING ASSIGN VAR STRING STRING ASSIGN VAR STRING FOR VAR LIST STRING STRING IF FUNC_CALL VAR VAR FUNC_CALL VAR VAR ASSIGN VAR VAR ASSIGN VAR BIN_OP VAR VAR FUNC_CALL VAR VAR EXPR FUNC_CALL VAR V... |
Recently, you found a bot to play "Rock paper scissors" with. Unfortunately, the bot uses quite a simple algorithm to play: he has a string $s = s_1 s_2 \dots s_{n}$ of length $n$ where each letter is either R, S or P.
While initializing, the bot is choosing a starting index $pos$ ($1 \le pos \le n$), and then it can ... | for i in range(int(input())):
a = input()
if a.count("R") >= max(a.count("S"), a.count("P")):
print("P" * len(a))
elif a.count("S") >= max(a.count("R"), a.count("P")):
print("R" * len(a))
else:
print("S" * len(a)) | FOR VAR FUNC_CALL VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR IF FUNC_CALL VAR STRING FUNC_CALL VAR FUNC_CALL VAR STRING FUNC_CALL VAR STRING EXPR FUNC_CALL VAR BIN_OP STRING FUNC_CALL VAR VAR IF FUNC_CALL VAR STRING FUNC_CALL VAR FUNC_CALL VAR STRING FUNC_CALL VAR STRING EXPR FUNC_CALL VAR BIN_OP STRING F... |
Recently, you found a bot to play "Rock paper scissors" with. Unfortunately, the bot uses quite a simple algorithm to play: he has a string $s = s_1 s_2 \dots s_{n}$ of length $n$ where each letter is either R, S or P.
While initializing, the bot is choosing a starting index $pos$ ($1 \le pos \le n$), and then it can ... | t = int(input())
i = 0
while i < t:
s = input()
n = len(s)
countp = 0
countr = 0
counts = 0
for x in s:
if x == "P":
countp = countp + 1
if x == "R":
countr = countr + 1
if x == "S":
counts = counts + 1
res = [[countp, "P"], [countr... | ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR NUMBER WHILE VAR VAR ASSIGN VAR FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR VAR ASSIGN VAR NUMBER ASSIGN VAR NUMBER ASSIGN VAR NUMBER FOR VAR VAR IF VAR STRING ASSIGN VAR BIN_OP VAR NUMBER IF VAR STRING ASSIGN VAR BIN_OP VAR NUMBER IF VAR STRING ASSIGN VAR BIN_OP VAR NUMBER ... |
Recently, you found a bot to play "Rock paper scissors" with. Unfortunately, the bot uses quite a simple algorithm to play: he has a string $s = s_1 s_2 \dots s_{n}$ of length $n$ where each letter is either R, S or P.
While initializing, the bot is choosing a starting index $pos$ ($1 \le pos \le n$), and then it can ... | for i in [*open(0)][1:]:
l = [i.count("S"), i.count("P"), i.count("R")]
print(["S", "P", "R"][l.index(max(l)) - 1] * (len(i) - 1)) | FOR VAR LIST FUNC_CALL VAR NUMBER NUMBER ASSIGN VAR LIST FUNC_CALL VAR STRING FUNC_CALL VAR STRING FUNC_CALL VAR STRING EXPR FUNC_CALL VAR BIN_OP LIST STRING STRING STRING BIN_OP FUNC_CALL VAR FUNC_CALL VAR VAR NUMBER BIN_OP FUNC_CALL VAR VAR NUMBER |
Recently, you found a bot to play "Rock paper scissors" with. Unfortunately, the bot uses quite a simple algorithm to play: he has a string $s = s_1 s_2 \dots s_{n}$ of length $n$ where each letter is either R, S or P.
While initializing, the bot is choosing a starting index $pos$ ($1 \le pos \le n$), and then it can ... | def problemA():
n = int(input())
l = list(map(int, input().split()))
i = 0
while i < n - 1 and l[i] > l[i + 1]:
i += 1
if i == n - 1:
print("NO")
return
j = i + 1
while j < n - 1 and l[j] < l[j + 1]:
j += 1
if j == n - 1:
print("NO")
return... | FUNC_DEF ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR NUMBER WHILE VAR BIN_OP VAR NUMBER VAR VAR VAR BIN_OP VAR NUMBER VAR NUMBER IF VAR BIN_OP VAR NUMBER EXPR FUNC_CALL VAR STRING RETURN ASSIGN VAR BIN_OP VAR NUMBER WHILE VAR BIN_OP VAR NUMBER VAR... |
Recently, you found a bot to play "Rock paper scissors" with. Unfortunately, the bot uses quite a simple algorithm to play: he has a string $s = s_1 s_2 \dots s_{n}$ of length $n$ where each letter is either R, S or P.
While initializing, the bot is choosing a starting index $pos$ ($1 \le pos \le n$), and then it can ... | from sys import stdin, stdout
def main():
from sys import stdin, stdout
for _ in range(int(stdin.readline())):
inp = stdin.readline().strip()
counter = {}
for i in inp:
if i not in counter:
counter[i] = 1
else:
counter[i] += 1
... | FUNC_DEF FOR VAR FUNC_CALL VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR DICT FOR VAR VAR IF VAR VAR ASSIGN VAR VAR NUMBER VAR VAR NUMBER ASSIGN VAR NUMBER ASSIGN VAR NONE FOR VAR VAR IF VAR VAR VAR ASSIGN VAR VAR VAR ASSIGN VAR VAR ASSIGN VAR VAR STRING STRING VAR STRING STRING STRING A... |
Recently, you found a bot to play "Rock paper scissors" with. Unfortunately, the bot uses quite a simple algorithm to play: he has a string $s = s_1 s_2 \dots s_{n}$ of length $n$ where each letter is either R, S or P.
While initializing, the bot is choosing a starting index $pos$ ($1 \le pos \le n$), and then it can ... | def solution():
for _ in range(int(input())):
s = input()
ans = ""
r = 0
p = 0
sc = 0
for i in s:
if i == "S":
sc += 1
elif i == "P":
p += 1
else:
r += 1
if max([r, sc, p]) == ... | FUNC_DEF FOR VAR FUNC_CALL VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR ASSIGN VAR STRING ASSIGN VAR NUMBER ASSIGN VAR NUMBER ASSIGN VAR NUMBER FOR VAR VAR IF VAR STRING VAR NUMBER IF VAR STRING VAR NUMBER VAR NUMBER IF FUNC_CALL VAR LIST VAR VAR VAR VAR ASSIGN VAR BIN_OP STRING FUNC_CALL VAR VAR IF FUNC_CA... |
Recently, you found a bot to play "Rock paper scissors" with. Unfortunately, the bot uses quite a simple algorithm to play: he has a string $s = s_1 s_2 \dots s_{n}$ of length $n$ where each letter is either R, S or P.
While initializing, the bot is choosing a starting index $pos$ ($1 \le pos \le n$), and then it can ... | def multiple_input():
return map(int, input().split())
def list_input():
return list(map(int, input().split()))
for _ in range(int(input())):
x = input()
r, s, p = 0, 0, 0
for i in x:
if i == "R":
r += 1
elif i == "S":
s += 1
else:
p +=... | FUNC_DEF RETURN FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR FUNC_DEF RETURN FUNC_CALL VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR FOR VAR FUNC_CALL VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR ASSIGN VAR VAR VAR NUMBER NUMBER NUMBER FOR VAR VAR IF VAR STRING VAR NUMBER IF VAR STRING VAR NUMBER VAR NUMBER IF... |
Recently, you found a bot to play "Rock paper scissors" with. Unfortunately, the bot uses quite a simple algorithm to play: he has a string $s = s_1 s_2 \dots s_{n}$ of length $n$ where each letter is either R, S or P.
While initializing, the bot is choosing a starting index $pos$ ($1 \le pos \le n$), and then it can ... | def solve():
ss = input()
d = {}
d["R"] = 0
d["P"] = 0
d["S"] = 0
for i in ss:
d[i] += 1
r, p, s = d["R"], d["P"], d["S"]
e = max(r, max(p, s))
if e == r:
print("P" * len(ss))
elif e == p:
print("S" * len(ss))
else:
print("R" * len(ss))
for _... | FUNC_DEF ASSIGN VAR FUNC_CALL VAR ASSIGN VAR DICT ASSIGN VAR STRING NUMBER ASSIGN VAR STRING NUMBER ASSIGN VAR STRING NUMBER FOR VAR VAR VAR VAR NUMBER ASSIGN VAR VAR VAR VAR STRING VAR STRING VAR STRING ASSIGN VAR FUNC_CALL VAR VAR FUNC_CALL VAR VAR VAR IF VAR VAR EXPR FUNC_CALL VAR BIN_OP STRING FUNC_CALL VAR VAR IF ... |
Recently, you found a bot to play "Rock paper scissors" with. Unfortunately, the bot uses quite a simple algorithm to play: he has a string $s = s_1 s_2 \dots s_{n}$ of length $n$ where each letter is either R, S or P.
While initializing, the bot is choosing a starting index $pos$ ($1 \le pos \le n$), and then it can ... | for _ in range(int(input())):
sl = input()
r, s, p = 0, 0, 0
maxx = 0
c = "R"
for i in sl:
if i == "R":
r += 1
if r > maxx:
maxx = r
c = "P"
elif i == "S":
s += 1
if s > maxx:
maxx = s
... | FOR VAR FUNC_CALL VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR ASSIGN VAR VAR VAR NUMBER NUMBER NUMBER ASSIGN VAR NUMBER ASSIGN VAR STRING FOR VAR VAR IF VAR STRING VAR NUMBER IF VAR VAR ASSIGN VAR VAR ASSIGN VAR STRING IF VAR STRING VAR NUMBER IF VAR VAR ASSIGN VAR VAR ASSIGN VAR STRING VAR NUMBER IF VAR V... |
Recently, you found a bot to play "Rock paper scissors" with. Unfortunately, the bot uses quite a simple algorithm to play: he has a string $s = s_1 s_2 \dots s_{n}$ of length $n$ where each letter is either R, S or P.
While initializing, the bot is choosing a starting index $pos$ ($1 \le pos \le n$), and then it can ... | for T in range(int(input())):
s = input()
num = {"R": 0, "S": 0, "P": 0}
trans = {"R": "P", "S": "R", "P": "S"}
for i in s:
num[i] += 1
mx = max(num.values())
for i in num.keys():
if num[i] == mx:
for j in s:
print(trans[i], end="")
print()... | FOR VAR FUNC_CALL VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR ASSIGN VAR DICT STRING STRING STRING NUMBER NUMBER NUMBER ASSIGN VAR DICT STRING STRING STRING STRING STRING STRING FOR VAR VAR VAR VAR NUMBER ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR FOR VAR FUNC_CALL VAR IF VAR VAR VAR FOR VAR VAR EXPR FUNC_CALL... |
Recently, you found a bot to play "Rock paper scissors" with. Unfortunately, the bot uses quite a simple algorithm to play: he has a string $s = s_1 s_2 \dots s_{n}$ of length $n$ where each letter is either R, S or P.
While initializing, the bot is choosing a starting index $pos$ ($1 \le pos \le n$), and then it can ... | d = {}
d["R"] = "P"
d["P"] = "S"
d["S"] = "R"
for n in range(int(input())):
s = list(input())
v = {}
v["R"] = s.count("R")
v["P"] = s.count("P")
v["S"] = s.count("S")
mx = max(v["R"], v["P"], v["S"])
for n in v:
if v[n] == mx:
print(d[n] * len(s))
break | ASSIGN VAR DICT ASSIGN VAR STRING STRING ASSIGN VAR STRING STRING ASSIGN VAR STRING STRING FOR VAR FUNC_CALL VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR DICT ASSIGN VAR STRING FUNC_CALL VAR STRING ASSIGN VAR STRING FUNC_CALL VAR STRING ASSIGN VAR STRING FUNC_CALL VAR STRING ASSIGN ... |
Recently, you found a bot to play "Rock paper scissors" with. Unfortunately, the bot uses quite a simple algorithm to play: he has a string $s = s_1 s_2 \dots s_{n}$ of length $n$ where each letter is either R, S or P.
While initializing, the bot is choosing a starting index $pos$ ($1 \le pos \le n$), and then it can ... | for t in range(int(input())):
s = input()
arr = [0] * 3
for i in s:
if i == "R":
arr[0] += 1
elif i == "P":
arr[1] += 1
else:
arr[2] += 1
ind = arr.index(max(arr))
if ind == 0:
v = "P"
elif ind == 1:
v = "S"
else:
... | FOR VAR FUNC_CALL VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR ASSIGN VAR BIN_OP LIST NUMBER NUMBER FOR VAR VAR IF VAR STRING VAR NUMBER NUMBER IF VAR STRING VAR NUMBER NUMBER VAR NUMBER NUMBER ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR VAR IF VAR NUMBER ASSIGN VAR STRING IF VAR NUMBER ASSIGN VAR STRING ASSIGN ... |
Recently, you found a bot to play "Rock paper scissors" with. Unfortunately, the bot uses quite a simple algorithm to play: he has a string $s = s_1 s_2 \dots s_{n}$ of length $n$ where each letter is either R, S or P.
While initializing, the bot is choosing a starting index $pos$ ($1 \le pos \le n$), and then it can ... | t = int(input())
w = {"R": "P", "S": "R", "P": "S"}
for c in range(t):
s = input()
count = {"R": 0, "S": 0, "P": 0}
for x in s:
count[x] += 1
print(w[max(count, key=lambda key: count[key])] * len(s)) | ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR DICT STRING STRING STRING STRING STRING STRING FOR VAR FUNC_CALL VAR VAR ASSIGN VAR FUNC_CALL VAR ASSIGN VAR DICT STRING STRING STRING NUMBER NUMBER NUMBER FOR VAR VAR VAR VAR NUMBER EXPR FUNC_CALL VAR BIN_OP VAR FUNC_CALL VAR VAR VAR VAR FUNC_CALL VAR VAR |
Recently, you found a bot to play "Rock paper scissors" with. Unfortunately, the bot uses quite a simple algorithm to play: he has a string $s = s_1 s_2 \dots s_{n}$ of length $n$ where each letter is either R, S or P.
While initializing, the bot is choosing a starting index $pos$ ($1 \le pos \le n$), and then it can ... | from sys import *
input = stdin.readline
t = int(input())
for _ in range(t):
st = input()
n = len(st)
r = 0
p = 0
s = 0
for i in st:
if i == "R":
r += 1
elif i == "S":
s += 1
elif i == "P":
p += 1
m = max(r, p, s)
n -= 1
if... | ASSIGN VAR VAR ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR FOR VAR FUNC_CALL VAR VAR ASSIGN VAR FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR VAR ASSIGN VAR NUMBER ASSIGN VAR NUMBER ASSIGN VAR NUMBER FOR VAR VAR IF VAR STRING VAR NUMBER IF VAR STRING VAR NUMBER IF VAR STRING VAR NUMBER ASSIGN VAR FUNC_CALL VAR VAR VAR VAR VAR NUMB... |
Recently, you found a bot to play "Rock paper scissors" with. Unfortunately, the bot uses quite a simple algorithm to play: he has a string $s = s_1 s_2 \dots s_{n}$ of length $n$ where each letter is either R, S or P.
While initializing, the bot is choosing a starting index $pos$ ($1 \le pos \le n$), and then it can ... | t = int(input())
for i in range(t):
inputstr = input()
output = ""
count = {}
for i in inputstr:
if i not in count:
count[i] = 1
else:
count[i] += 1
dict2 = {"R": "P", "P": "S", "S": "R"}
output = dict2[max(count, key=lambda i: count[i])] * len(inputstr)
... | ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR FOR VAR FUNC_CALL VAR VAR ASSIGN VAR FUNC_CALL VAR ASSIGN VAR STRING ASSIGN VAR DICT FOR VAR VAR IF VAR VAR ASSIGN VAR VAR NUMBER VAR VAR NUMBER ASSIGN VAR DICT STRING STRING STRING STRING STRING STRING ASSIGN VAR BIN_OP VAR FUNC_CALL VAR VAR VAR VAR FUNC_CALL VAR VAR EXPR FUNC_CA... |
Recently, you found a bot to play "Rock paper scissors" with. Unfortunately, the bot uses quite a simple algorithm to play: he has a string $s = s_1 s_2 \dots s_{n}$ of length $n$ where each letter is either R, S or P.
While initializing, the bot is choosing a starting index $pos$ ($1 \le pos \le n$), and then it can ... | import sys
input = sys.stdin.readline
MOD = 1000000007
MOD2 = 998244353
ii = lambda: int(input().strip("\n"))
si = lambda: input().strip("\n")
dgl = lambda: list(map(int, input().strip("\n")))
f = lambda: map(int, input().strip("\n").split())
il = lambda: list(map(int, input().strip("\n").split()))
ls = lambda: list(i... | IMPORT ASSIGN VAR VAR ASSIGN VAR NUMBER ASSIGN VAR NUMBER ASSIGN VAR FUNC_CALL VAR FUNC_CALL FUNC_CALL VAR STRING ASSIGN VAR FUNC_CALL FUNC_CALL VAR STRING ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR STRING ASSIGN VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL FUNC_CALL VAR STRING ASSIGN VAR FUNC_CALL... |
Recently, you found a bot to play "Rock paper scissors" with. Unfortunately, the bot uses quite a simple algorithm to play: he has a string $s = s_1 s_2 \dots s_{n}$ of length $n$ where each letter is either R, S or P.
While initializing, the bot is choosing a starting index $pos$ ($1 \le pos \le n$), and then it can ... | T = int(input())
t = "RPSR"
for _ in range(T):
a = input()
l = []
for i in range(3):
l.append([a.count(t[i]), t[i + 1]])
print(max(l)[1] * len(a)) | ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR STRING FOR VAR FUNC_CALL VAR VAR ASSIGN VAR FUNC_CALL VAR ASSIGN VAR LIST FOR VAR FUNC_CALL VAR NUMBER EXPR FUNC_CALL VAR LIST FUNC_CALL VAR VAR VAR VAR BIN_OP VAR NUMBER EXPR FUNC_CALL VAR BIN_OP FUNC_CALL VAR VAR NUMBER FUNC_CALL VAR VAR |
Recently, you found a bot to play "Rock paper scissors" with. Unfortunately, the bot uses quite a simple algorithm to play: he has a string $s = s_1 s_2 \dots s_{n}$ of length $n$ where each letter is either R, S or P.
While initializing, the bot is choosing a starting index $pos$ ($1 \le pos \le n$), and then it can ... | for _ in range(int(input())):
si = input()
r = s = p = 0
n = len(si)
for i in si:
if i == "S":
s += 1
elif i == "R":
r += 1
else:
p += 1
m = max(s, p, r)
l = [("S", "R"), ("R", "P"), ("P", "S")]
if m == s:
print(n * "R")
... | FOR VAR FUNC_CALL VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR ASSIGN VAR VAR VAR NUMBER ASSIGN VAR FUNC_CALL VAR VAR FOR VAR VAR IF VAR STRING VAR NUMBER IF VAR STRING VAR NUMBER VAR NUMBER ASSIGN VAR FUNC_CALL VAR VAR VAR VAR ASSIGN VAR LIST STRING STRING STRING STRING STRING STRING IF VAR VAR EXPR FUNC_C... |
Recently, you found a bot to play "Rock paper scissors" with. Unfortunately, the bot uses quite a simple algorithm to play: he has a string $s = s_1 s_2 \dots s_{n}$ of length $n$ where each letter is either R, S or P.
While initializing, the bot is choosing a starting index $pos$ ($1 \le pos \le n$), and then it can ... | for _ in range(int(input())):
l = list(input())
d = {"R": 0, "S": 0, "P": 0}
for i in l:
d[i] += 1
mw = None
n = None
for i in d:
if n is None or n < d[i]:
n = d[i]
mw = i
op = {"R": "P", "P": "S", "S": "R"}
print(op[mw] * len(l)) | FOR VAR FUNC_CALL VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR DICT STRING STRING STRING NUMBER NUMBER NUMBER FOR VAR VAR VAR VAR NUMBER ASSIGN VAR NONE ASSIGN VAR NONE FOR VAR VAR IF VAR NONE VAR VAR VAR ASSIGN VAR VAR VAR ASSIGN VAR VAR ASSIGN VAR DICT STRING STRING STRING STRING ... |
Recently, you found a bot to play "Rock paper scissors" with. Unfortunately, the bot uses quite a simple algorithm to play: he has a string $s = s_1 s_2 \dots s_{n}$ of length $n$ where each letter is either R, S or P.
While initializing, the bot is choosing a starting index $pos$ ($1 \le pos \le n$), and then it can ... | from sys import stdin
TT = int(stdin.readline())
alp = "RPS"
dic = {}
dic["R"] = 0
dic["P"] = 1
dic["S"] = 2
for loop in range(TT):
s = stdin.readline()[:-1]
lis = [0, 0, 0]
for i in s:
lis[dic[i]] += 1
maxind = 0
for i in range(3):
if lis[i] > lis[maxind]:
maxind = i
... | ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR STRING ASSIGN VAR DICT ASSIGN VAR STRING NUMBER ASSIGN VAR STRING NUMBER ASSIGN VAR STRING NUMBER FOR VAR FUNC_CALL VAR VAR ASSIGN VAR FUNC_CALL VAR NUMBER ASSIGN VAR LIST NUMBER NUMBER NUMBER FOR VAR VAR VAR VAR VAR NUMBER ASSIGN VAR NUMBER FOR VAR FUNC_CALL VAR NUMBER... |
Recently, you found a bot to play "Rock paper scissors" with. Unfortunately, the bot uses quite a simple algorithm to play: he has a string $s = s_1 s_2 \dots s_{n}$ of length $n$ where each letter is either R, S or P.
While initializing, the bot is choosing a starting index $pos$ ($1 \le pos \le n$), and then it can ... | t = int(input())
for _ in range(t):
a, b, c = 0, 0, 0
for x in input():
if x == "P":
a += 1
elif x == "R":
b += 1
else:
c += 1
if a == max(a, b, c):
print("S" * (a + b + c))
elif b == max(a, b, c):
print("P" * (a + b + c))
e... | ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR FOR VAR FUNC_CALL VAR VAR ASSIGN VAR VAR VAR NUMBER NUMBER NUMBER FOR VAR FUNC_CALL VAR IF VAR STRING VAR NUMBER IF VAR STRING VAR NUMBER VAR NUMBER IF VAR FUNC_CALL VAR VAR VAR VAR EXPR FUNC_CALL VAR BIN_OP STRING BIN_OP BIN_OP VAR VAR VAR IF VAR FUNC_CALL VAR VAR VAR VAR EXPR FU... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.