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())
for _ in range(t):
s = input()
c = 0
d = {"R": 0, "P": 0, "S": 0}
for i in s:
for x in d:
c = 0
if x == "R":
if i == "R":
pass
elif i == "P":
pass
else:
... | ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR FOR VAR FUNC_CALL VAR VAR ASSIGN VAR FUNC_CALL VAR ASSIGN VAR NUMBER ASSIGN VAR DICT STRING STRING STRING NUMBER NUMBER NUMBER FOR VAR VAR FOR VAR VAR ASSIGN VAR NUMBER IF VAR STRING IF VAR STRING IF VAR STRING VAR NUMBER IF VAR STRING IF VAR STRING IF 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 ... | for _ in range(int(input())):
str = input()
ans = ""
freq = {"R": 0, "S": 0, "P": 0}
for i in str:
if i == "R":
freq["R"] += 1
elif i == "S":
freq["S"] += 1
else:
freq["P"] += 1
k = max(freq["R"], freq["S"], freq["P"])
if k == freq["R"]... | FOR VAR FUNC_CALL VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR ASSIGN VAR STRING 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 FUNC_CALL VAR VAR STRING VAR STRING VAR STRING IF 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 ... | t = int(input())
for i in range(t):
m = input()
d = {}
x = ""
r, s, p = 0, 0, 0
for j in range(len(m)):
if m[j] == "R":
r += 1
elif m[j] == "S":
s += 1
else:
p += 1
f = len(m)
if r >= s and r >= p:
print("P" * f)
elif s ... | ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR FOR VAR FUNC_CALL VAR VAR ASSIGN VAR FUNC_CALL VAR ASSIGN VAR DICT ASSIGN VAR STRING ASSIGN VAR VAR VAR NUMBER NUMBER 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 FUNC_CALL VAR VAR IF VAR 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 ... | n = int(input())
for i in range(0, n):
st = input()
r = st.count("R")
s = st.count("S")
p = st.count("P")
if r >= p and r >= s:
ans = "P" * len(st)
elif p >= r and p >= s:
ans = "S" * len(st)
else:
ans = "R" * len(st)
print(ans) | 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 STRING ASSIGN VAR FUNC_CALL VAR STRING ASSIGN VAR FUNC_CALL VAR STRING IF VAR VAR VAR VAR ASSIGN VAR BIN_OP STRING FUNC_CALL VAR VAR IF VAR VAR VAR VAR ASSIGN VAR BIN_OP STRING FUNC_CALL VAR VAR 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 ... | t = int(input())
while t != 0:
t -= 1
string = input()
r = 0
p = 0
s = 0
for x in string:
if x == "R":
r += 1
elif x == "P":
p += 1
else:
s += 1
if r == max([r, p, s]):
print("P" * len(string))
elif p == max([r, p, s]):
... | ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR WHILE VAR NUMBER VAR NUMBER ASSIGN 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 VAR NUMBER IF VAR FUNC_CALL VAR LIST VAR VAR VAR EXPR FUNC_CALL VAR BIN_OP STRING FUNC_CALL VAR VAR IF VAR FUNC_... |
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 ... | k = int(input())
for c in range(k):
l = [i for i in input()]
total = {"R": 0, "P": 0, "S": 0}
for i in l:
total[i] += 1
mais_aparece = max(total, key=total.get)
otimo = {"R": "P", "P": "S", "S": "R"}
resposta = "".join([otimo[mais_aparece]] * len(l))
print(resposta) | ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR FOR VAR FUNC_CALL VAR VAR ASSIGN VAR VAR 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 ASSIGN VAR DICT STRING STRING STRING STRING STRING STRING ASSIGN VAR FUNC_CALL STRING BIN_OP LIST 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())
while t:
t += -1
r, p, s = 0, 0, 0
ss = input()
for i in ss:
if i == "R":
r -= -1
if i == "P":
p -= -1
if i == "S":
s -= -1
if r >= p and r >= s:
print("P" * len(ss))
elif p >= r and p >= s:
print("S" * ... | ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR WHILE VAR VAR NUMBER ASSIGN VAR VAR VAR NUMBER NUMBER NUMBER ASSIGN VAR FUNC_CALL VAR FOR VAR VAR IF VAR STRING VAR NUMBER IF VAR STRING VAR NUMBER IF VAR STRING 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 ... |
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 optimizeWin(s):
counter = {"R": 0, "S": 0, "P": 0}
complement = {"R": "P", "P": "S", "S": "R"}
for i in s:
counter[i] += 1
botOpt = "a"
max = 0
for i in counter:
if counter[i] > max:
max = counter[i]
botOpt = i
c = complement[botOpt] * len(s)
r... | FUNC_DEF 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 STRING ASSIGN VAR NUMBER FOR VAR VAR IF VAR VAR VAR ASSIGN VAR VAR VAR ASSIGN VAR VAR ASSIGN VAR BIN_OP VAR VAR FUNC_CALL VAR VAR RETURN VAR ASSIGN VAR FUNC_... |
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 input():
return sys.stdin.readline().rstrip()
def input_split():
return [int(i) for i in input().split()]
testCases = int(input())
answers = []
for _ in range(testCases):
s = input()
counts = {"R": 0, "P": 0, "S": 0}
for i in s:
counts[i] += 1
defeats = {"R": "P", "P... | IMPORT FUNC_DEF RETURN FUNC_CALL FUNC_CALL VAR FUNC_DEF RETURN FUNC_CALL VAR VAR VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR LIST 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 DICT 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())
for i in range(t):
inputs = input()
s = 0
p = 0
r = 0
for i in range(len(inputs)):
if inputs[i] == "P":
s += 1
elif inputs[i] == "R":
p += 1
elif inputs[i] == "S":
r += 1
if s >= r and s >= p:
print((s + p + r) ... | 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 IF VAR VAR VAR VAR EXPR FUNC_CALL VAR BIN_OP 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 ... | import sys
ii = lambda: sys.stdin.readline().strip()
idata = lambda: [int(x) for x in ii().split()]
def solve():
s1 = ii()
r, s, p = 0, 0, 0
for i in range(len(s1)):
r += 1 if s1[i] == "R" else 0
s += 1 if s1[i] == "S" else 0
p += 1 if s1[i] == "P" else 0
if s >= max(r, p):
... | IMPORT ASSIGN VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR VAR VAR FUNC_CALL FUNC_CALL VAR FUNC_DEF ASSIGN VAR FUNC_CALL VAR ASSIGN VAR VAR VAR NUMBER NUMBER NUMBER FOR VAR FUNC_CALL VAR FUNC_CALL VAR VAR VAR VAR VAR STRING NUMBER NUMBER VAR VAR VAR STRING NUMBER NUMBER VAR VAR VAR STRING NUMBER NUMBER IF 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())
r = {}
m = -1
ans = ""
for i in s:
r[i] = r.get(i, 0) + 1
if r[i] > m:
m = r[i]
ans = i
if ans == "S":
ans = "R"
elif ans == "R":
ans = "P"
else:
ans = "S"
print(ans * len(... | FOR VAR FUNC_CALL VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR DICT ASSIGN VAR NUMBER ASSIGN VAR STRING FOR VAR VAR ASSIGN VAR VAR BIN_OP FUNC_CALL VAR VAR NUMBER NUMBER IF VAR VAR VAR ASSIGN VAR VAR VAR ASSIGN VAR VAR IF VAR STRING ASSIGN VAR STRING IF VAR STRING 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 ... | t = int(input())
l = []
l1 = []
for i in range(0, t):
s = input()
R = 0
S = 0
P = 0
l = []
l1 = []
l = list(s)
le = len(l)
for j in range(0, le):
if l[j] == "P":
P = P + 1
elif l[j] == "R":
R = R + 1
elif l[j] == "S":
S = S ... | ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR LIST ASSIGN VAR LIST FOR VAR FUNC_CALL VAR NUMBER VAR ASSIGN VAR FUNC_CALL VAR ASSIGN VAR NUMBER ASSIGN VAR NUMBER ASSIGN VAR NUMBER ASSIGN VAR LIST ASSIGN VAR LIST ASSIGN VAR FUNC_CALL VAR VAR ASSIGN VAR FUNC_CALL VAR VAR FOR VAR FUNC_CALL VAR NUMBER VAR IF VAR VAR STR... |
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):
l = input()
n = len(l)
k = 0
no = 0
b = 0
for j in range(n):
if l[j] == "R":
k += 1
elif l[j] == "S":
no += 1
else:
b += 1
if max(k, no, b) == b:
for i2 in range(n):
print("S",... | 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 FUNC_CALL VAR VAR IF VAR VAR STRING VAR NUMBER IF VAR VAR STRING VAR NUMBER VAR NUMBER IF FUNC_CALL VAR VAR VAR VAR VAR FOR VAR FUNC_CALL 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 ... | t = int(input().split()[0])
for case in range(t):
s = input().split()[0]
r, p, sc = 0, 0, 0
ans = ""
for l in s:
if l == "R":
r += 1
elif l == "P":
p += 1
else:
sc += 1
if sc >= r and sc >= p:
ans = "R" * len(s)
elif p >= sc and... | ASSIGN VAR FUNC_CALL VAR FUNC_CALL FUNC_CALL VAR NUMBER FOR VAR FUNC_CALL VAR VAR ASSIGN VAR FUNC_CALL FUNC_CALL VAR NUMBER ASSIGN VAR VAR VAR NUMBER NUMBER NUMBER ASSIGN VAR STRING FOR VAR VAR IF VAR STRING VAR NUMBER IF VAR STRING VAR NUMBER VAR NUMBER IF VAR VAR VAR VAR ASSIGN 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 ... | t = int(input())
l = []
for i in range(t):
n = input()
l.append(n)
for x in l:
rcount = 0
pcount = 0
scount = 0
for a in x:
if a == "R":
rcount += 1
if a == "S":
scount += 1
if a == "P":
pcount += 1
h = [rcount, scount, pcount]
... | ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR LIST FOR VAR FUNC_CALL VAR VAR ASSIGN VAR FUNC_CALL VAR EXPR FUNC_CALL VAR VAR FOR 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 LIST VAR 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 ... | from sys import stdin
inp = lambda: stdin.readline().strip()
t = int(inp())
for _ in range(t):
s = inp()
count = [0] * 3
for i in s:
if i == "R":
count[0] += 1
if i == "S":
count[1] += 1
if i == "P":
count[2] += 1
if count[0] == max(count):
... | ASSIGN VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR FOR VAR FUNC_CALL VAR 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 IF VAR STRING VAR NUMBER NUMBER IF VAR NUMBER FUNC_CALL 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 ... | t = int(input())
for k in range(t):
a = input()
r, s, p = a.count("R"), a.count("S"), a.count("P")
now = max(r, s, p)
if r == now:
ans = "".join(["P" for i in range(len(a))])
elif s == now:
ans = "".join(["R" for i in range(len(a))])
else:
ans = "".join(["S" for i in rang... | ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR FOR VAR FUNC_CALL VAR VAR ASSIGN VAR FUNC_CALL 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 ASSIGN VAR FUNC_CALL STRING STRING VAR FUNC_CALL VAR FUNC_CALL VAR VAR IF VAR 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 ... | for _ in range(int(input())):
a = list(input())
str1 = ""
r = 0
p = 0
s = 0
d = {}
for i in a:
if i == "R":
r = r + 1
elif i == "P":
p = p + 1
else:
s = s + 1
if max(r, p, s) == r:
str1 = "P" * len(a)
elif max(r, p, ... | FOR VAR FUNC_CALL VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR STRING ASSIGN VAR NUMBER ASSIGN VAR NUMBER ASSIGN VAR NUMBER ASSIGN VAR DICT FOR VAR VAR IF VAR STRING ASSIGN VAR BIN_OP VAR NUMBER IF VAR STRING ASSIGN VAR BIN_OP VAR NUMBER ASSIGN VAR BIN_OP VAR NUMBER 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 test_case in range(int(input())):
string = input()
ans = ""
r = 0
p = 0
s = 0
for x in string:
if x == "R":
r += 1
elif x == "P":
p += 1
else:
s += 1
arr = [r, p, s]
arr2 = ["P", "S", "R"]
ans = arr2[arr.index(max(arr))]... | 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 ASSIGN VAR LIST VAR VAR VAR ASSIGN VAR LIST STRING STRING STRING ASSIGN VAR VAR FUNC_CALL 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 ... | def solve(s1):
sign = [0, 0, 0]
for c in s1:
if c == "R":
sign[0] += 1
elif c == "S":
sign[1] += 1
elif c == "P":
sign[2] += 1
highest_count = sign.index(max(sign))
ret = None
if highest_count == 0:
ret = "P"
elif highest_count ... | FUNC_DEF 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 ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR VAR ASSIGN VAR NONE IF VAR NUMBER ASSIGN VAR STRING IF VAR NUMBER ASSIGN VAR STRING ASSIGN VAR STRING FOR 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())
for _ in range(t):
s = input()
arr = [x for x in list(s)]
n = len(arr)
choice = {"R": "P", "S": "R", "P": "S"}
l = ""
dic = {}
for i in arr:
if i not in dic:
dic[i] = 1
else:
dic[i] += 1
d = list(dic.items())
d.sort(key=lambda ... | ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR FOR VAR FUNC_CALL VAR VAR ASSIGN VAR FUNC_CALL VAR ASSIGN VAR VAR VAR FUNC_CALL VAR VAR ASSIGN VAR FUNC_CALL VAR VAR ASSIGN VAR DICT STRING STRING STRING STRING STRING STRING ASSIGN VAR STRING ASSIGN VAR DICT FOR VAR VAR IF VAR VAR ASSIGN VAR VAR NUMBER VAR VAR 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 ... | from sys import *
input = stdin.readline
T = int(input())
for case in range(T):
Combs = list(input().rstrip())
L = len(Combs)
r, s, p = 0, 0, 0
for i in Combs:
if i == "R":
p += 1
elif i == "S":
r += 1
elif i == "P":
s += 1
if p == max([r,... | ASSIGN VAR VAR ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR FOR VAR FUNC_CALL VAR VAR ASSIGN VAR FUNC_CALL 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 IF VAR STRING VAR NUMBER IF VAR FUNC_CALL VAR LIST VAR 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 ... | tests = int(input())
sol = []
while tests:
tests -= 1
s = input()
n = len(s)
d = {}
d["S"] = 0
d["R"] = 0
d["P"] = 0
cuv = ""
for i in s:
d[i] += 1
d = [(i, d[i]) for i in d.keys()]
d.sort(key=lambda a: a[1], reverse=True)
d = d[0][0]
if d == "S":
cuv ... | ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR LIST WHILE VAR VAR NUMBER ASSIGN VAR FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR VAR ASSIGN VAR DICT ASSIGN VAR STRING NUMBER ASSIGN VAR STRING NUMBER ASSIGN VAR STRING NUMBER ASSIGN VAR STRING FOR VAR VAR VAR VAR NUMBER ASSIGN VAR VAR VAR VAR VAR FUNC_CALL 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 ... | t = int(input())
for i in range(t):
map = {"R": 0, "S": 0, "P": 0}
seq = str(input())
n = len(seq)
for s in seq:
map[s] += 1
if map["R"] >= map["S"] and map["R"] >= map["P"]:
maxs = "P"
elif map["S"] >= map["R"] and map["S"] >= map["P"]:
maxs = "R"
elif map["P"] >= ma... | ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR FOR VAR FUNC_CALL VAR VAR ASSIGN VAR DICT STRING STRING STRING NUMBER NUMBER NUMBER ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR VAR FOR VAR VAR VAR VAR NUMBER IF VAR STRING VAR STRING VAR STRING VAR STRING ASSIGN VAR STRING IF VAR STRING VAR STRING VAR STRING 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())):
stk = input()
srt = "".join(list(set([x for x in stk])))
mx = 0
for i in range(len(srt)):
if stk.count(srt[i]) > mx:
mx = stk.count(srt[i])
k = srt[i]
if k == "R":
print("P" * len(stk))
elif k == "P":
print("S" * len(s... | FOR VAR FUNC_CALL VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR ASSIGN VAR FUNC_CALL STRING FUNC_CALL VAR FUNC_CALL VAR VAR VAR VAR ASSIGN VAR NUMBER 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 VAR VAR IF VAR STRING 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 ... | import sys
def input():
return sys.stdin.readline().strip()
def list2d(a, b, c):
return [([c] * b) for i in range(a)]
def list3d(a, b, c, d):
return [[([d] * c) for j in range(b)] for i in range(a)]
def list4d(a, b, c, d, e):
return [[[([e] * d) for j in range(c)] for j in range(b)] for i in ran... | IMPORT FUNC_DEF RETURN FUNC_CALL FUNC_CALL VAR FUNC_DEF RETURN BIN_OP LIST VAR VAR VAR FUNC_CALL VAR VAR FUNC_DEF RETURN BIN_OP LIST VAR VAR VAR FUNC_CALL VAR VAR VAR FUNC_CALL VAR VAR FUNC_DEF RETURN BIN_OP LIST VAR VAR VAR FUNC_CALL VAR VAR VAR FUNC_CALL VAR VAR VAR FUNC_CALL VAR VAR FUNC_DEF NUMBER RETURN 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 ... | import sys
for _ in range(int(sys.stdin.readline().rstrip())):
s = sys.stdin.readline().rstrip()
re = ""
cnt = {}
for i in s:
if i not in cnt:
cnt[i] = 1
else:
cnt[i] += 1
max_v = -1
re = ""
for i, v in cnt.items():
if max_v < v:
m... | IMPORT FOR VAR FUNC_CALL VAR FUNC_CALL VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR STRING ASSIGN VAR DICT FOR VAR VAR IF VAR VAR ASSIGN VAR VAR NUMBER VAR VAR NUMBER ASSIGN VAR NUMBER ASSIGN VAR STRING FOR VAR VAR FUNC_CALL VAR IF VAR VAR ASSIGN VAR VAR ASSIGN VAR VAR IF 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 _ in range(int(input())):
s = input()
most_signs = max(set(s), key=s.count)
sign = "R"
if most_signs == "P":
sign = "S"
elif most_signs == "R":
sign = "P"
result = sign * len(s)
print(result) | FOR VAR FUNC_CALL VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR VAR VAR ASSIGN VAR STRING IF VAR STRING ASSIGN VAR STRING IF VAR STRING ASSIGN VAR STRING ASSIGN VAR BIN_OP 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())
def rec(mn, ind, l, b):
if ind == 0:
return 0
elif mn[ind - 1][0] < l and mn[ind - 1][1] < b:
return max(
rec(mn, ind - 1, l, b),
mn[ind - 1][2] + rec(mn, ind - 1, mn[ind - 1][0], mn[ind - 1][1]),
)
else:
return rec(mn, ind - 1, l, b... | ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR FUNC_DEF IF VAR NUMBER RETURN NUMBER IF VAR BIN_OP VAR NUMBER NUMBER VAR VAR BIN_OP VAR NUMBER NUMBER VAR RETURN FUNC_CALL VAR FUNC_CALL VAR VAR BIN_OP VAR NUMBER VAR VAR BIN_OP VAR BIN_OP VAR NUMBER NUMBER FUNC_CALL VAR VAR BIN_OP VAR NUMBER VAR BIN_OP VAR NUMBER NUMBER 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 _ in range(t):
a = input()
counts = {"R": 0, "S": 0, "P": 0}
wins = {"R": "P", "S": "R", "P": "S"}
for i in a:
counts[i] += 1
print(wins[max(counts.items(), key=lambda x: x[1])[0]] * len(a)) | 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 ASSIGN VAR DICT STRING STRING STRING STRING STRING STRING FOR VAR VAR VAR VAR NUMBER EXPR FUNC_CALL VAR BIN_OP VAR FUNC_CALL VAR FUNC_CALL VAR VAR NUMBER NUMBER FUNC_CALL 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 ... | from sys import stdin, stdout
def universal_solution(s):
n = len(s)
R = P = S = 0
for c in s:
if c == "R":
R += 1
elif c == "P":
P += 1
else:
S += 1
if R >= P and R >= S:
return ["P"] * n
elif P >= R and P >= S:
return ["S... | FUNC_DEF 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 IF VAR VAR VAR VAR RETURN BIN_OP LIST STRING VAR IF VAR VAR VAR VAR RETURN BIN_OP LIST STRING VAR RETURN BIN_OP LIST STRING VAR ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR FOR 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 ... | n = int(input())
for _ in range(n):
s = input()
num_dict = {}
for i in s:
if i in num_dict.keys():
num_dict[i] += 1
else:
num_dict[i] = 1
final = ""
key = max(num_dict, key=num_dict.get)
value = num_dict[key]
if key == "P":
final += "S" * len(s... | ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR FOR VAR FUNC_CALL VAR VAR ASSIGN VAR FUNC_CALL VAR ASSIGN VAR DICT FOR VAR VAR IF VAR FUNC_CALL VAR VAR VAR NUMBER ASSIGN VAR VAR NUMBER ASSIGN VAR STRING ASSIGN VAR FUNC_CALL VAR VAR VAR ASSIGN VAR VAR VAR IF VAR STRING VAR BIN_OP STRING FUNC_CALL VAR VAR IF VAR STRING VAR BIN_OP... |
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
def rps(arr):
r = 0
p = 0
s = 0
for ele in arr:
if ele == "R":
r += 1
elif ele == "P":
p += 1
else:
s += 1
m = max(r, p, s)
if m == r:
return "P" * (len(arr) - 1)
elif m == p:
... | IMPORT ASSIGN VAR VAR FUNC_DEF ASSIGN VAR NUMBER ASSIGN VAR NUMBER ASSIGN 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 RETURN BIN_OP STRING BIN_OP FUNC_CALL VAR VAR NUMBER IF VAR VAR RETURN BIN_OP STRING BIN_OP FUNC_CALL 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())
beating = {"R": "P", "P": "S", "S": "R"}
for _ in range(t):
s = input()
counts = [s.count("R"), s.count("P"), s.count("S")]
if counts[0] == max(counts):
print(beating["R"] * len(s))
elif counts[1] == max(counts):
print(beating["P"] * len(s))
else:
print(beati... | 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 LIST FUNC_CALL VAR STRING FUNC_CALL VAR STRING FUNC_CALL VAR STRING IF VAR NUMBER FUNC_CALL VAR VAR EXPR FUNC_CALL VAR BIN_OP VAR STRING FUNC_CALL VAR VAR 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 ... | a = int(input())
for x in range(a):
b = input()
n = len(b)
j = []
j.append(b.count("P"))
j.append(b.count("R"))
j.append(b.count("S"))
l = j.index(max(j))
if l == 0:
for x in range(n):
if x == n - 1:
print("S")
else:
print("... | 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 EXPR FUNC_CALL VAR FUNC_CALL VAR STRING EXPR FUNC_CALL VAR FUNC_CALL VAR STRING EXPR FUNC_CALL VAR FUNC_CALL VAR STRING ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR VAR IF VAR NUMBER FOR 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 ... | tc = int(input())
for _ in range(tc):
str1 = input()
dic = {}
for c in str1:
if c not in dic:
dic[c] = 1
continue
dic[c] += 1
keys = list(dic.keys())
values = list(dic.values())
ma = index = 0
for i in range(len(values)):
if values[i] > ma:
... | ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR FOR VAR FUNC_CALL VAR VAR ASSIGN VAR FUNC_CALL VAR 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 FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR VAR NUMBER FOR VAR FUNC_CALL VAR FUNC_CALL VAR VAR 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 ... | numberOfTc = int(input())
for ctr in range(1, numberOfTc + 1):
a = input().strip()
rCount = a.count("R")
sCount = a.count("S")
pCount = a.count("P")
f = [rCount, sCount, pCount]
k = ["P", "R", "S"]
ind = k[f.index(max(f))]
print(ind * len(a)) | ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR FOR VAR FUNC_CALL VAR NUMBER BIN_OP VAR NUMBER ASSIGN VAR FUNC_CALL FUNC_CALL 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 ASSIGN VAR LIST STRING STRING STRING ASSIGN VAR VAR FUNC_CALL 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 ... | I = input
for _ in range(int(I())):
s = list(I())
d = dict()
for i in s:
if i in d:
d[i] += 1
else:
d[i] = 1
m = 0
c = ""
for i in d:
if d[i] > m:
m = d[i]
c = i
d1 = {"R": "P", "S": "R", "P": "S"}
print(d1[c] * len(... | ASSIGN VAR VAR FOR VAR FUNC_CALL VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR FOR VAR VAR IF VAR VAR VAR VAR NUMBER ASSIGN VAR VAR NUMBER ASSIGN VAR NUMBER ASSIGN VAR STRING FOR VAR VAR IF VAR VAR VAR ASSIGN VAR VAR VAR ASSIGN VAR VAR ASSIGN VAR DICT STRING STRING 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 x in range(int(input())):
s = input()
s = list(s)
a = [0, 0, 0]
b = ["R", "P", "S"]
for i in range(len(s)):
if s[i] == "R":
a[0] += 1
elif s[i] == "P":
a[1] += 1
else:
a[2] += 1
l = ""
k = max(a)
if len(set(a)) == 1:
... | FOR VAR FUNC_CALL VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR VAR ASSIGN VAR LIST NUMBER NUMBER NUMBER ASSIGN VAR LIST STRING STRING STRING FOR VAR FUNC_CALL VAR FUNC_CALL VAR VAR IF VAR VAR STRING VAR NUMBER NUMBER IF VAR VAR STRING VAR NUMBER NUMBER VAR NUMBER NUMBER ASSIGN VAR S... |
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())):
st = list(input())
n = len(st)
ans = str()
for i in range(n):
if st[i] == "R":
ans += "P"
if st[i] == "P":
ans += "S"
if st[i] == "S":
ans += "R"
t = ans.count("P")
y = ans.count("R")
w = ans.count("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 VAR ASSIGN VAR FUNC_CALL VAR FOR VAR FUNC_CALL VAR VAR IF VAR VAR STRING VAR STRING IF VAR VAR STRING VAR STRING IF VAR VAR STRING VAR STRING ASSIGN VAR FUNC_CALL VAR STRING ASSIGN VAR 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 ... | for _ in range(int(input())):
n = input()
ans, tmp = 0, ""
l = len(n)
d = {"R": 0, "P": 0, "S": 0}
for letter in n:
d[letter] += 1
if d[letter] > ans:
ans = d[letter]
if letter == "P":
tmp = "S"
if letter == "R":
tmp... | FOR VAR FUNC_CALL VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR ASSIGN VAR VAR NUMBER STRING ASSIGN VAR FUNC_CALL VAR VAR ASSIGN VAR DICT STRING STRING STRING NUMBER NUMBER NUMBER FOR VAR VAR VAR VAR NUMBER IF VAR VAR VAR ASSIGN VAR VAR VAR IF VAR STRING ASSIGN VAR STRING IF VAR STRING ASSIGN VAR STRING IF 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 ... | t = int(input())
while t > 0:
t -= 1
a = input()
a = list(a)
l = len(a)
r = 0
s = 0
p = 0
ans = ""
for i in a:
if i == "R":
r += 1
if i == "S":
s += 1
if i == "P":
p += 1
m = max(r, s, p)
if m == r:
i = 0
... | ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR WHILE VAR NUMBER VAR NUMBER ASSIGN VAR FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR VAR ASSIGN VAR FUNC_CALL VAR VAR ASSIGN VAR NUMBER ASSIGN VAR NUMBER ASSIGN VAR NUMBER ASSIGN VAR STRING FOR VAR VAR IF VAR STRING VAR NUMBER IF VAR STRING VAR NUMBER IF VAR STRING VAR NUMBER 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 ... | t = int(input())
i = 0
while i < t:
s = input("")
n = len(s)
rn = s.count("R")
sn = s.count("S")
pn = s.count("P")
if max(rn, pn, sn) == rn:
print(n * "P")
elif max(rn, pn, sn) == sn:
print(n * "R")
elif max(rn, pn, sn) == pn:
print(n * "S")
i += 1 | ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR NUMBER WHILE VAR VAR ASSIGN VAR FUNC_CALL VAR STRING 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 FUNC_CALL VAR VAR VAR VAR VAR EXPR FUNC_CALL VAR BIN_OP VAR STRING IF FUNC_CALL VAR 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 ... | import sys
lines = []
for line in sys.stdin:
if "exit" == line.rstrip().lower():
break
lines.append(line)
t = int(lines[0])
for case in range(1, t + 1):
st = lines[case].strip()
s = 0
p = 0
r = 0
for char in st:
if char == "R":
r += 1
elif char == "P":
... | IMPORT ASSIGN VAR LIST FOR VAR VAR IF STRING FUNC_CALL FUNC_CALL VAR EXPR FUNC_CALL VAR VAR ASSIGN VAR FUNC_CALL VAR VAR NUMBER FOR VAR FUNC_CALL VAR NUMBER BIN_OP VAR NUMBER 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 ... |
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(t):
r = t.count("R")
s = t.count("S")
p = t.count("P")
if r >= max(s, p):
return "P" * len(t)
elif s >= max(r, p):
return "R" * len(t)
else:
return "S" * len(t)
T = int(input())
for _ in range(T):
print(solve(input())) | FUNC_DEF 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 RETURN BIN_OP STRING FUNC_CALL VAR VAR IF VAR FUNC_CALL VAR VAR VAR RETURN BIN_OP STRING FUNC_CALL VAR VAR RETURN BIN_OP STRING FUNC_CALL VAR VAR ASSIGN VAR FUNC_CALL VAR FUNC_CALL 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 ... | t = int(input())
for i in range(t):
s = input()
a = s.count("R")
b = s.count("S")
c = s.count("P")
if a == b == c:
print(s)
continue
if a == max(a, b, c):
c1 = "P"
elif b == max(a, b, c):
c1 = "R"
else:
c1 = "S"
print(c1 * len(s)) | 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 EXPR FUNC_CALL VAR VAR IF VAR FUNC_CALL VAR VAR VAR VAR ASSIGN VAR STRING IF VAR FUNC_CALL VAR VAR VAR VAR ASSIGN VAR S... |
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 kamane(s):
counter = {"R": 0, "P": 0, "S": 0}
for c in s:
counter[c] += 1
if counter["R"] >= counter["S"] and counter["R"] >= counter["P"]:
return "P" * len(s)
if counter["P"] >= counter["R"] and counter["P"] >= counter["S"]:
return "S" * len(s)
if counter["S"] >= counter... | FUNC_DEF ASSIGN VAR DICT STRING STRING STRING NUMBER NUMBER NUMBER FOR VAR VAR VAR VAR NUMBER IF VAR STRING VAR STRING VAR STRING VAR STRING RETURN BIN_OP STRING FUNC_CALL VAR VAR IF VAR STRING VAR STRING VAR STRING VAR STRING RETURN BIN_OP STRING FUNC_CALL VAR VAR IF VAR STRING VAR STRING VAR STRING VAR STRING RETURN ... |
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()
i = max(s.count("R"), max(s.count("S"), s.count("P")))
if i == s.count("R"):
print("P" * len(s))
elif i == s.count("P"):
print("S" * len(s))
else:
print("R" * len(s)) | FOR VAR FUNC_CALL VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR STRING FUNC_CALL VAR FUNC_CALL VAR STRING FUNC_CALL VAR STRING IF VAR FUNC_CALL VAR STRING EXPR FUNC_CALL VAR BIN_OP STRING FUNC_CALL VAR VAR IF VAR FUNC_CALL VAR STRING EXPR FUNC_CALL VAR BIN_OP STRING 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 ... | def find_ans(s):
q = [0] * 3
for i in s:
if i == "P":
q[0] += 1
elif i == "S":
q[1] += 1
else:
q[2] += 1
u = max(q)
if u == q[0]:
print("S" * len(s))
elif u == q[1]:
print("R" * len(s))
else:
print("P" * len(s))
... | FUNC_DEF 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 VAR IF VAR VAR NUMBER EXPR FUNC_CALL VAR BIN_OP STRING FUNC_CALL VAR VAR IF VAR VAR NUMBER EXPR FUNC_CALL VAR BIN_OP STRING FUNC_CALL 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 ... | import sys
t = int(sys.stdin.readline().strip())
for _ in range(t):
s = sys.stdin.readline().strip()
x, y, z = s.count("R"), s.count("S"), s.count("P")
if max(x, y, z) == x:
print("P" * len(s))
elif max(x, y, z) == y:
print("R" * len(s))
else:
print("S" * len(s)) | IMPORT ASSIGN VAR FUNC_CALL VAR FUNC_CALL FUNC_CALL VAR FOR VAR FUNC_CALL VAR VAR ASSIGN VAR FUNC_CALL 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 STRING FUNC_CALL VAR VAR IF FUNC_CALL VAR VAR VAR 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 ... | def solve():
string = input()
solution = {"R": "P", "S": "R", "P": "S"}
counts = {"R": 0, "S": 0, "P": 0}
for c in string:
if c == "R":
counts["R"] += 1
if c == "S":
counts["S"] += 1
if c == "P":
counts["P"] += 1
mx_count = max(counts.value... | FUNC_DEF 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 IF VAR STRING VAR STRING NUMBER IF VAR STRING VAR STRING NUMBER IF VAR STRING VAR STRING NUMBER ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR VAR STRING 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 ... | t = int(input())
for s in range(t):
string = input()
r, s, p = 0, 0, 0
for i in string:
if i == "R":
r += 1
elif i == "S":
s += 1
else:
p += 1
maxi = max(r, s, p)
add = r + s + p
x = 0
if maxi == r:
x = "P"
elif maxi == ... | ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR FOR VAR FUNC_CALL VAR 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 ASSIGN VAR FUNC_CALL VAR VAR VAR VAR ASSIGN VAR BIN_OP BIN_OP VAR VAR VAR ASSIGN VAR NUMBER IF VAR VAR ASSIGN VAR STR... |
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())):
data = list(input())
out = [0, 0, 0]
for i in range(len(data)):
if data[i] == "R":
out[0] += 1
elif data[i] == "P":
out[1] += 1
elif data[i] == "S":
out[2] += 1
m = out.index(max(out))
lett = 0
if m == 0:
... | FOR VAR FUNC_CALL 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 FUNC_CALL VAR VAR IF VAR VAR STRING VAR NUMBER NUMBER IF VAR VAR STRING VAR NUMBER NUMBER IF VAR VAR STRING VAR NUMBER NUMBER ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR VAR 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 ... | def solve(s):
n = len(s)
count = {}
count["R"] = 0
count["P"] = 0
count["S"] = 0
for c in s:
count[c] += 1
dpr = count["P"] - count["R"]
dsr = count["S"] - count["R"]
if dpr >= dsr and dsr >= 0:
s1, r1, p1 = n, 0, 0
elif dpr >= 0 and 0 >= dsr:
s1, r1, p1 =... | FUNC_DEF ASSIGN VAR FUNC_CALL VAR VAR ASSIGN VAR DICT ASSIGN VAR STRING NUMBER ASSIGN VAR STRING NUMBER ASSIGN VAR STRING NUMBER FOR VAR VAR VAR VAR NUMBER ASSIGN VAR BIN_OP VAR STRING VAR STRING ASSIGN VAR BIN_OP VAR STRING VAR STRING IF VAR VAR VAR NUMBER ASSIGN VAR VAR VAR VAR NUMBER NUMBER IF VAR NUMBER 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 ... | T = int(input())
for ii in range(T):
s = input()
n = len(s)
R = 0
P = 0
S = 0
for i in s:
if i == "R":
R += 1
elif i == "P":
P += 1
else:
S += 1
if max(R, P, S) == R:
result = "P" * n
elif max(R, P, S) == P:
resu... | 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 VAR NUMBER IF FUNC_CALL VAR VAR VAR VAR VAR ASSIGN VAR BIN_OP STRING VAR IF 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 _ in range(int(input())):
s = input()
d = {"R": "P", "P": "S", "S": "R"}
ans = ""
count = {}
for i in s:
count[i] = count.get(i, 0) + 1
maxChar = -1
charac = ""
for char in count.keys():
if count[char] > maxChar:
maxChar = count[char]
charac = ... | 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 STRING ASSIGN VAR DICT FOR VAR VAR ASSIGN VAR VAR BIN_OP FUNC_CALL VAR VAR NUMBER NUMBER ASSIGN VAR NUMBER ASSIGN VAR STRING FOR VAR FUNC_CALL VAR IF 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 ... | for _ in range(int(input())):
s = input()
d = {"R": 0, "P": 0, "S": 0}
max_pair = 0, "R"
for i in s:
d[i] += 1
if (d[i], i) > max_pair:
max_pair = d[i], i
if max_pair[1] == "R":
print("P" * len(s))
elif max_pair[1] == "P":
print("S" * len(s))
else:... | 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 NUMBER STRING FOR VAR VAR VAR VAR NUMBER IF VAR VAR VAR VAR ASSIGN VAR VAR VAR VAR IF VAR NUMBER STRING EXPR FUNC_CALL VAR BIN_OP STRING FUNC_CALL VAR VAR IF VAR NUMBER 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())):
ans = {}
lst = input()
for i in lst:
if i not in ans:
ans[i] = 1
else:
ans[i] += 1
count = 0
for i in ans:
if ans[i] > count:
count = ans[i]
final = i
if final == "R":
final = "P"
el... | FOR VAR FUNC_CALL VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR DICT ASSIGN VAR FUNC_CALL VAR FOR VAR VAR IF VAR VAR ASSIGN VAR VAR NUMBER VAR VAR NUMBER ASSIGN VAR NUMBER FOR VAR VAR IF VAR VAR VAR ASSIGN VAR VAR VAR ASSIGN VAR VAR IF VAR STRING ASSIGN VAR STRING IF VAR STRING ASSIGN VAR STRING ASSIGN VAR STRING EXPR 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())
def solve():
S = input()
count = {}
count["R"] = 0
count["P"] = 0
count["S"] = 0
for a in S:
count[a] += 1
build = []
for k in count:
v = count[k]
build.append((v, k))
build = sorted(build)
_, M = build[2]
if M == "R":
print(... | ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR 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 LIST FOR VAR VAR ASSIGN VAR VAR VAR EXPR FUNC_CALL VAR VAR VAR ASSIGN VAR FUNC_CALL VAR VAR ASSIGN VAR 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 ... | for _ in range(int(input())):
stg = input()
count = {"R": 0, "S": 0, "P": 0}
for i in stg:
count[i] += 1
if count["R"] >= count["S"] and count["R"] >= count["P"]:
print("P" * len(stg))
elif count["P"] >= count["S"] and count["P"] >= count["R"]:
print("S" * len(stg))
else:... | 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 IF VAR STRING VAR STRING VAR STRING VAR STRING EXPR FUNC_CALL VAR BIN_OP STRING FUNC_CALL VAR VAR IF VAR STRING VAR STRING VAR STRING VAR STRING 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 ... | for _ in range(int(input())):
s = input()
an = ""
dt = dict()
dt["R"] = "P"
dt["P"] = "S"
dt["S"] = "R"
mx = 0
for a in ["R", "P", "S"]:
if s.count(a) > mx:
mx = s.count(a)
an = dt[a]
an *= len(s)
print(an) | FOR VAR FUNC_CALL VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR ASSIGN VAR STRING ASSIGN VAR FUNC_CALL VAR ASSIGN VAR STRING STRING ASSIGN VAR STRING STRING ASSIGN VAR STRING STRING ASSIGN VAR NUMBER FOR VAR LIST STRING STRING STRING IF FUNC_CALL VAR VAR VAR ASSIGN VAR FUNC_CALL VAR VAR ASSIGN VAR 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 ... | t = int(input())
while t > 0:
t = t - 1
a = input()
q = len(a)
r = 0
p = 0
s = 0
for i in range(0, q):
if a[i] == "R":
r = r + 1
if a[i] == "P":
p = p + 1
if a[i] == "S":
s = s + 1
c = 0
if max(r, p, s) == r:
c = "P"... | ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR WHILE VAR NUMBER ASSIGN VAR BIN_OP VAR NUMBER 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 VAR IF VAR VAR STRING ASSIGN VAR BIN_OP VAR NUMBER IF VAR 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 ... | import sys
t = int(sys.stdin.readline().strip())
for _ in range(t):
ss = sys.stdin.readline().strip()
ans = {}
ans["S"] = ss.count("P")
ans["P"] = ss.count("R")
ans["R"] = ss.count("S")
inverse = [(value, key) for key, value in ans.items()]
aa = max(inverse)[1]
print("".join([aa for _ i... | IMPORT ASSIGN VAR FUNC_CALL VAR FUNC_CALL FUNC_CALL VAR FOR VAR FUNC_CALL VAR VAR ASSIGN VAR FUNC_CALL 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 VAR VAR VAR VAR VAR FUNC_CALL VAR ASSIGN 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:
s = input()
count1 = 0
count2 = 0
count3 = 0
for i in s:
if i == "R":
count1 = count1 + 1
elif i == "S":
count2 = count2 + 1
else:
count3 = count3 + 1
if max(count1, count2, count3) == count1:
print("P"... | ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR WHILE VAR ASSIGN VAR FUNC_CALL 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 ASSIGN VAR BIN_OP VAR NUMBER IF FUNC_CALL VAR VAR VAR VAR VAR EXPR FUNC_CALL VAR BIN_OP 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())):
def main():
s = input()
x, y, z = s.count("P"), s.count("S"), s.count("R")
if x == max(x, y, z):
print("S" * len(s))
elif y == max(x, y, z):
print("R" * len(s))
elif z == max(x, y, z):
print("P" * len(s))
... | FOR VAR FUNC_CALL VAR FUNC_CALL VAR FUNC_CALL VAR FUNC_DEF ASSIGN VAR FUNC_CALL VAR ASSIGN VAR VAR VAR FUNC_CALL VAR STRING FUNC_CALL VAR STRING FUNC_CALL VAR STRING IF VAR FUNC_CALL VAR VAR VAR VAR EXPR FUNC_CALL VAR BIN_OP STRING FUNC_CALL VAR VAR IF VAR FUNC_CALL VAR VAR VAR VAR EXPR FUNC_CALL VAR BIN_OP STRING FUNC... |
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
all_data = sys.stdin.read().split("\n")
for i in range(1, int(all_data[0]) + 1):
if all_data[i].count("R") == max(
all_data[i].count("R"), all_data[i].count("S"), all_data[i].count("P")
):
print("P" * len(all_data[i]))
elif all_data[i].count("S") == max(
all_data[i].count... | IMPORT ASSIGN VAR FUNC_CALL FUNC_CALL VAR STRING FOR VAR FUNC_CALL VAR NUMBER BIN_OP FUNC_CALL VAR VAR NUMBER NUMBER IF FUNC_CALL VAR VAR STRING FUNC_CALL VAR FUNC_CALL VAR VAR STRING FUNC_CALL VAR VAR STRING FUNC_CALL VAR VAR STRING EXPR FUNC_CALL VAR BIN_OP STRING FUNC_CALL VAR VAR VAR IF FUNC_CALL VAR VAR STRING 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 ... | try:
d = {"R": "P", "S": "R", "P": "S"}
for _ in range(int(input())):
arr = list(map(str, input()))
answer = []
count_R, count_P, count_S = 0, 0, 0
for item in arr:
if item == "R":
count_R += 1
if item == "S":
count_S += 1
... | 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 FUNC_CALL VAR VAR FUNC_CALL VAR ASSIGN VAR LIST 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 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 ... | def solve():
s = input()
d = {"R": 0, "S": 0, "P": 0}
for i in s:
d[i] += 1
x = float("-inf")
for i in d:
if d[i] > x:
k = i
x = d[i]
if k == "R":
print("P" * len(s))
elif k == "S":
print("R" * len(s))
else:
print("S" * len(... | 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 STRING FOR VAR VAR IF VAR VAR VAR ASSIGN VAR VAR ASSIGN VAR VAR VAR IF VAR STRING EXPR FUNC_CALL VAR BIN_OP STRING FUNC_CALL VAR VAR IF VAR STRING EXPR FUNC_CALL VAR BIN_OP STR... |
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):
r = 0
s = 0
p = 0
pro = input()
for i in range(len(pro)):
if pro[i] == "R":
r = r + 1
elif pro[i] == "S":
s = s + 1
else:
p = p + 1
max_ = max(r, s, p)
if max_ == r:
print("P" * len(pro))
... | ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR FOR VAR FUNC_CALL VAR VAR ASSIGN VAR NUMBER ASSIGN VAR NUMBER ASSIGN VAR NUMBER ASSIGN VAR FUNC_CALL VAR FOR VAR FUNC_CALL VAR FUNC_CALL VAR VAR IF VAR VAR STRING ASSIGN VAR BIN_OP VAR NUMBER IF VAR VAR STRING ASSIGN VAR BIN_OP VAR NUMBER ASSIGN VAR BIN_OP VAR NUMBER ASSIGN VAR 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 _ in range(int(input())):
s = input()
l = len(s)
c = {"R": 0, "S": 0, "P": 0}
for i in s:
c[i] += 1
mv = max(list(c.values()))
for i in c:
if c[i] == mv:
if i == "R":
print("P" * l)
break
elif i == "S":
p... | 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 NUMBER NUMBER NUMBER FOR VAR VAR VAR VAR NUMBER ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR FUNC_CALL VAR FOR VAR VAR IF VAR VAR VAR IF VAR STRING 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 ... | tests = int(input())
for t in range(tests):
input_str = input()
res = ""
count_r = 0
count_s = 0
count_p = 0
for i in input_str:
if i == "R":
count_r += 1
if i == "S":
count_s += 1
if i == "P":
count_p += 1
if count_r >= count_s and... | ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR FOR VAR FUNC_CALL VAR 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 IF VAR STRING VAR NUMBER IF VAR VAR VAR VAR ASSIGN VAR STRING VAR FUNC_CALL 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())):
d = {"R": 0, "P": 0, "S": 0}
for i in input():
d[i] += 1
t = max(d.values())
l = sum(d.values())
if d["R"] == t:
print("P" * l)
elif d["P"] == t:
print("S" * l)
else:
print("R" * l) | FOR VAR FUNC_CALL VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR DICT STRING STRING STRING NUMBER NUMBER NUMBER FOR VAR FUNC_CALL VAR VAR VAR NUMBER ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR IF VAR STRING VAR EXPR FUNC_CALL VAR BIN_OP STRING VAR IF VAR STRING 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 ... | y = int(input())
for i in range(y):
r = input()
s = ""
R = S = P = 0
for j in r:
if j == "R":
s += "P"
R += 1
elif j == "S":
s += "R"
S += 1
else:
s += "S"
P += 1
if P == R and S == R:
print("R" *... | ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR FOR VAR FUNC_CALL VAR VAR ASSIGN VAR FUNC_CALL VAR ASSIGN VAR STRING ASSIGN VAR VAR VAR NUMBER FOR VAR VAR IF VAR STRING VAR STRING VAR NUMBER IF VAR STRING VAR STRING VAR NUMBER VAR STRING VAR NUMBER IF VAR VAR VAR VAR EXPR FUNC_CALL VAR BIN_OP STRING FUNC_CALL VAR VAR 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 ... | def ri():
return int(input())
def rl():
return list(map(int, input().split()))
t = ri()
for _ in range(t):
word = input()
n = len(word)
r = word.count("R")
p = word.count("P")
s = word.count("S")
maxi = max(r, p, s)
if r == maxi:
print("P" * n)
elif p == maxi:
... | FUNC_DEF RETURN FUNC_CALL VAR FUNC_CALL VAR FUNC_DEF RETURN FUNC_CALL VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR ASSIGN 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 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 ... | for i in range(int(input())):
n = input()
a = n.count("R")
b = n.count("S")
c = n.count("P")
l = len(n)
print(
(a >= b and a >= c) * l * "P"
+ (b >= c and b > a) * l * "R"
+ (c > a and c > b) * l * "S"
) | FOR VAR FUNC_CALL VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN 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 EXPR FUNC_CALL VAR BIN_OP BIN_OP BIN_OP BIN_OP VAR VAR VAR VAR VAR STRING BIN_OP BIN_OP VAR VAR VAR VAR VAR STRING 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 i in range(0, t):
s = input()
R = 0
S = 0
P = 0
for item in s:
if item == "S":
S += 1
if item == "R":
R += 1
if item == "P":
P += 1
if S > R and S > P:
print("R" * (S + R + P))
elif R > P:
print(... | ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR FOR VAR FUNC_CALL VAR NUMBER VAR ASSIGN 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 VAR EXPR FUNC_CALL VAR BIN_OP STRING BIN_OP BIN_OP VAR VAR VAR IF 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 ... | T = input()
for t in range(int(T)):
S = input()
maxOccurrence = 0
myChoices = ""
rCount = S.count("R")
sCount = S.count("S")
pCount = S.count("P")
if rCount >= sCount and rCount >= pCount:
maxOccurrence = "R"
elif sCount >= rCount and sCount >= pCount:
maxOccurrence = "S"... | ASSIGN VAR FUNC_CALL VAR FOR VAR FUNC_CALL VAR FUNC_CALL VAR VAR ASSIGN VAR FUNC_CALL VAR ASSIGN VAR NUMBER ASSIGN VAR STRING ASSIGN VAR FUNC_CALL VAR STRING ASSIGN VAR FUNC_CALL VAR STRING ASSIGN VAR FUNC_CALL VAR STRING IF VAR VAR VAR VAR ASSIGN VAR STRING IF VAR VAR VAR VAR ASSIGN VAR STRING ASSIGN VAR STRING 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 ... | for _ in range(int(input())):
s = input()
dictio = {"R": 0, "P": 0, "S": 0}
for i in s:
if i == "R":
dictio["P"] += 1
elif i == "P":
dictio["S"] += 1
elif i == "S":
dictio["R"] += 1
x = list(dictio.keys())
y = list(dictio.values())
elem... | 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 IF VAR STRING VAR STRING NUMBER IF VAR STRING VAR STRING NUMBER IF VAR STRING VAR STRING NUMBER ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR FUNC_CALL 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 ... | from sys import stdin
input = stdin.readline
d = {"R": "P", "P": "S", "S": "R"}
for _ in range(int(input())):
s = input()[:-1]
cnt = {}
mx = 0
for i in s:
cnt[i] = cnt.get(i, 0) + 1
if cnt[i] > mx:
mx, ans = cnt[i], i
print(d[ans] * len(s)) | 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 NUMBER ASSIGN VAR DICT ASSIGN VAR NUMBER FOR VAR VAR ASSIGN VAR VAR BIN_OP FUNC_CALL VAR VAR NUMBER NUMBER IF VAR VAR VAR ASSIGN VAR VAR VAR VAR VAR 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 ... | import sys
all_data = sys.stdin.read().split("\n")
what_to_do = {"R": "P", "P": "S", "S": "R"}
countdict = {}
for i in range(1, int(all_data[0]) + 1):
countdict[str(all_data[i].count("R"))] = "R"
countdict[str(all_data[i].count("P"))] = "P"
countdict[str(all_data[i].count("S"))] = "S"
print(
wh... | IMPORT ASSIGN VAR FUNC_CALL FUNC_CALL VAR STRING ASSIGN VAR DICT STRING STRING STRING STRING STRING STRING ASSIGN VAR DICT FOR VAR FUNC_CALL VAR NUMBER BIN_OP FUNC_CALL VAR VAR NUMBER NUMBER ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR VAR STRING STRING ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR VAR STRING STRING ASSIGN VAR FUNC... |
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())):
str1 = input()
list1 = list(str1)
countR = 0
countP = 0
countS = 0
for i in range(len(list1)):
if list1[i] == "R":
countR += 1
elif list1[i] == "P":
countP += 1
elif list1[i] == "S":
countS += 1
newList... | FOR VAR FUNC_CALL VAR FUNC_CALL VAR FUNC_CALL 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 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 VAR VAR VAR 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 ans(z):
r, p, s = z.count("R"), z.count("P"), z.count("S")
if r >= max(p, s):
return "P" * len(z)
if p >= max(r, s):
return "S" * len(z)
if s >= max(p, r):
return "R" * len(z)
for i in range(int(input())):
print(ans(input())) | FUNC_DEF ASSIGN VAR VAR VAR FUNC_CALL VAR STRING FUNC_CALL VAR STRING FUNC_CALL VAR STRING IF VAR FUNC_CALL VAR VAR VAR RETURN BIN_OP STRING FUNC_CALL VAR VAR IF VAR FUNC_CALL VAR VAR VAR RETURN BIN_OP STRING FUNC_CALL VAR VAR IF VAR FUNC_CALL VAR VAR VAR RETURN BIN_OP STRING FUNC_CALL VAR VAR FOR 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 ... | n = int(input())
while n:
s = input()
R = 0
P = 0
S = 0
for i in s:
if i == "R":
R += 1
elif i == "P":
P += 1
else:
S += 1
if max(R, P, S) == R:
for _ in range(len(s)):
print("P", end="")
elif max(R, P, S) == P:
... | ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR WHILE VAR ASSIGN 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 VAR NUMBER IF FUNC_CALL VAR VAR VAR VAR VAR FOR VAR FUNC_CALL VAR FUNC_CALL VAR VAR EXPR FUNC_CALL VAR STRING STRING IF 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())
def fun(n, a):
s = {"R": 0, "S": 0, "P": 0}
for i in range(n):
s[a[i]] += 1
ans = ""
a = [s["R"], s["S"], s["P"]]
k = a.index(max(a))
fi = ["P", "R", "S"]
ans = fi[k] * n
print(ans)
while t:
t -= 1
a = input()
n = len(a)
fun(n, a) | ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR FUNC_DEF ASSIGN VAR DICT STRING STRING STRING NUMBER NUMBER NUMBER FOR VAR FUNC_CALL VAR VAR VAR VAR VAR NUMBER ASSIGN VAR STRING ASSIGN VAR LIST VAR STRING VAR STRING VAR STRING ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR VAR ASSIGN VAR LIST STRING STRING STRING ASSIGN VAR BIN_OP 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 sint():
return int(input())
def sints():
return map(int, input().split())
def sara():
return list(map(int, input().split()))
def sstr():
s = input()
return list(s[: len(s)])
def main():
tt = sint()
while tt:
tt -= 1
s = input()
cnt = {"P": 0, "R": 0, "S": ... | FUNC_DEF RETURN FUNC_CALL VAR FUNC_CALL VAR 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 FUNC_DEF ASSIGN VAR FUNC_CALL VAR RETURN FUNC_CALL VAR VAR FUNC_CALL VAR VAR FUNC_DEF ASSIGN VAR FUNC_CALL VAR WHILE VAR VAR NUMBER ASSIGN 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 ... | import sys
input = sys.stdin.readline
t = int(input())
for ii in range(t):
st = input()
ans = ""
r = st.count("S")
s = st.count("P")
p = st.count("R")
l = [[r, 1], [s, 2], [p, 3]]
l.sort()
if l[-1][1] == 3:
ans += "P" * (len(st) - 1)
if l[-1][1] == 2:
ans += "S" * (l... | IMPORT ASSIGN VAR VAR ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR FOR VAR FUNC_CALL VAR VAR ASSIGN VAR FUNC_CALL VAR ASSIGN VAR STRING ASSIGN VAR FUNC_CALL VAR STRING ASSIGN VAR FUNC_CALL VAR STRING ASSIGN VAR FUNC_CALL VAR STRING ASSIGN VAR LIST LIST VAR NUMBER LIST VAR NUMBER LIST VAR NUMBER EXPR FUNC_CALL VAR 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 ... | n = int(input())
for i in range(n):
s = input()
t = 1
r = 0
k = s.count("P")
l = s.count("S")
m = s.count("R")
y = max(k, l, m)
if y == k:
print("S" * len(s))
t = 0
r = 1
if y == l and t != 0:
print("R" * len(s))
r = 1
if y == m and r != 1:... | 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 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 EXPR FUNC_CALL VAR BIN_OP 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 ... | def rsp(string):
maxi = max(string.count("R"), string.count("S"), string.count("P"))
if string.count("R") == string.count("S") == string.count("P"):
return string
elif maxi == string.count("R"):
return "P" * len(string)
elif maxi == string.count("P"):
return "S" * len(string)
... | FUNC_DEF ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR STRING FUNC_CALL VAR STRING FUNC_CALL VAR STRING IF FUNC_CALL VAR STRING FUNC_CALL VAR STRING FUNC_CALL VAR STRING RETURN VAR IF VAR FUNC_CALL VAR STRING RETURN BIN_OP STRING FUNC_CALL VAR VAR IF VAR FUNC_CALL VAR STRING RETURN BIN_OP STRING FUNC_CALL VAR VAR IF VAR FUNC_... |
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())):
sT = input()
dic = {"R": "P", "P": "S", "S": "R"}
r, p, s = sT.count("R"), sT.count("P"), sT.count("S")
c = ""
if r >= p and r >= s:
c = "P" * len(sT)
elif r <= p and p >= s:
c = "S" * len(sT)
elif s >= p and r <= s:
c = "R" * len(sT)
... | 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 VAR VAR FUNC_CALL VAR STRING FUNC_CALL VAR STRING FUNC_CALL VAR STRING ASSIGN VAR STRING IF VAR VAR VAR VAR ASSIGN VAR BIN_OP STRING FUNC_CALL VAR VAR IF VAR VAR VAR VAR 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 tt in range(t):
s = input()
n = len(s)
foo = max(s.count("P"), s.count("R"), s.count("S"))
if s.count("P") == foo:
ans = "S" * n
elif s.count("R") == foo:
ans = "P" * n
else:
ans = "R" * n
print(ans) | 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 FUNC_CALL VAR STRING FUNC_CALL VAR STRING FUNC_CALL VAR STRING IF FUNC_CALL VAR STRING VAR ASSIGN VAR BIN_OP STRING VAR IF FUNC_CALL VAR STRING VAR ASSIGN 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 ... | import sys
input = lambda: sys.stdin.readline()
int_arr = lambda: list(map(int, input().split()))
str_arr = lambda: list(map(str, input().split()))
get_str = lambda: map(str, input().split())
get_int = lambda: map(int, input().split())
get_flo = lambda: map(float, input().split())
mod = 1000000007
def solve(s):
... | IMPORT ASSIGN VAR FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR VAR FUNC_CALL FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR VAR FUNC_CALL 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())
while t:
z = input()
n = len(z)
r, s, p = 0, 0, 0
for i in range(n):
if z[i] == "R":
r += 1
if z[i] == "P":
p += 1
if z[i] == "S":
s += 1
if r >= s and r >= p:
for i in range(n):
print("P", end="")
e... | ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR WHILE VAR ASSIGN VAR FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR VAR ASSIGN VAR VAR VAR NUMBER NUMBER NUMBER FOR VAR FUNC_CALL VAR VAR IF VAR VAR STRING VAR NUMBER IF VAR VAR STRING VAR NUMBER IF VAR VAR STRING VAR NUMBER IF VAR VAR VAR VAR FOR VAR FUNC_CALL 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 ... | t = int(input())
l = "RSP"
r = "PRS"
def solve():
s = input()
cnt = [0] * 3
for c in s:
for j in range(3):
if l[j] == c:
cnt[j] += 1
print(r[cnt.index(max(cnt))] * len(s))
for test in range(t):
solve() | ASSIGN VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR STRING ASSIGN VAR STRING FUNC_DEF ASSIGN VAR FUNC_CALL VAR ASSIGN VAR BIN_OP LIST NUMBER NUMBER FOR VAR VAR FOR VAR FUNC_CALL VAR NUMBER IF VAR VAR VAR VAR VAR NUMBER EXPR FUNC_CALL VAR BIN_OP VAR FUNC_CALL VAR FUNC_CALL VAR VAR FUNC_CALL VAR VAR FOR VAR 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 _ in range(int(input())):
ss = input()
count = {}
for e in ss:
if e not in count:
count[e] = 1
else:
count[e] += 1
s = 0
d = "R"
for e, f in count.items():
if f > s:
s = f
d = e
if d == "R":
ans = "P" * len(s... | 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 ASSIGN VAR VAR NUMBER VAR VAR NUMBER ASSIGN VAR NUMBER ASSIGN VAR STRING FOR VAR VAR FUNC_CALL VAR IF VAR VAR ASSIGN VAR VAR ASSIGN VAR VAR IF VAR STRING 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 ... | t = int(input())
for test in range(t):
s = input()
sL = list(s)
sS = set(sL)
if len(sS) == len(sL) or len(sS) == 1:
for i in s:
if i == "R":
print("P", end="")
if i == "S":
print("R", end="")
if i == "P":
print("... | 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 VAR IF FUNC_CALL VAR VAR FUNC_CALL VAR VAR FUNC_CALL VAR VAR NUMBER FOR VAR VAR IF VAR STRING EXPR FUNC_CALL VAR STRING STRING IF VAR STRING EXPR FUNC_CALL VAR STRING STRING 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 t in range(int(input())):
s = input()
a = ""
j = 0
num = [0, 0, 0]
for i in range(len(s)):
if s[i] == "R":
num[2] += 1
if num[2] > num[j]:
j = 2
a = "P"
elif s[i] == "S":
if num[0] + 1 > num[j]:
j... | FOR VAR FUNC_CALL VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR FUNC_CALL VAR ASSIGN VAR STRING ASSIGN VAR NUMBER ASSIGN VAR LIST NUMBER NUMBER NUMBER FOR VAR FUNC_CALL VAR FUNC_CALL VAR VAR IF VAR VAR STRING VAR NUMBER NUMBER IF VAR NUMBER VAR VAR ASSIGN VAR NUMBER ASSIGN VAR STRING IF VAR VAR STRING IF 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 ... | T = int(input())
moves = {"R": "P", "P": "S", "S": "R"}
for _ in range(T):
m = input()
ans = ""
r_count = m.count("R")
p_count = m.count("P")
s_count = m.count("S")
ls = [r_count, p_count, s_count]
mx = ls.index(max(ls))
if mx == 0:
ans += "P" * len(m)
if mx == 1:
ans... | 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 STRING ASSIGN VAR FUNC_CALL VAR STRING ASSIGN VAR FUNC_CALL VAR STRING ASSIGN VAR FUNC_CALL VAR STRING ASSIGN VAR LIST VAR VAR VAR ASSIGN VAR FUNC_CALL VAR FUNC_... |
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())):
s1 = input()
n = len(s1)
d = {"R": "P", "S": "R", "P": "S"}
r, s, p = s1.count("R"), s1.count("S"), s1.count("P")
if r >= s and r >= p:
res = d["R"] * n
elif s >= r and s >= p:
res = d["S"] * n
elif p >= r and p >= s:
res = d["P"] * 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 DICT STRING STRING STRING STRING STRING STRING ASSIGN VAR VAR VAR FUNC_CALL VAR STRING FUNC_CALL VAR STRING FUNC_CALL VAR STRING IF VAR VAR VAR VAR ASSIGN VAR BIN_OP VAR STRING VAR IF VAR VAR 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())):
d = {"R": "P", "S": "R", "P": "S"}
ans = ""
s = input()
d1 = {"P": s.count("P"), "R": s.count("R"), "S": s.count("S")}
max1 = 0
q1 = ""
for q, v in d1.items():
if v > max1:
max1 = v
q1 = q
print(d[q1] * len(s)) | FOR VAR FUNC_CALL VAR FUNC_CALL VAR FUNC_CALL VAR ASSIGN VAR DICT STRING STRING STRING STRING STRING STRING ASSIGN VAR STRING ASSIGN VAR FUNC_CALL VAR ASSIGN VAR DICT STRING STRING STRING FUNC_CALL VAR STRING FUNC_CALL VAR STRING FUNC_CALL VAR STRING ASSIGN VAR NUMBER ASSIGN VAR STRING FOR VAR VAR FUNC_CALL VAR IF VAR ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.