//入力チェック用 #include #include #include #include #include "assert.h" using namespace std; int main(){ vector A(3); vector B(3); cin >> A[0] >> A[1] >> A[2]; cin >> B[0] >> B[1] >> B[2]; string zero = "0"; string ub = "1"; ub.resize(10000+1, '0'); int max_len = max(A[1].size(), B[1].size()); max_len = max(max_len, (int)ub.size()); auto func = [&](string& s){ reverse(s.begin(), s.end()); s.resize(max_len, '0'); reverse(s.begin(), s.end()); }; func(A[1]); func(B[1]); func(zero); func(ub); assert(1 <= A[0].size() && A[0].size() <= 100); assert(zero <= A[1] && A[1] < ub); assert(A[2] == "R" || A[2] == "S" || A[2] == "P"); assert(1 <= B[0].size() && B[0].size() <= 100); assert(zero <= B[1] && B[1] < ub); assert(B[2] == "R" || B[2] == "S" || B[2] == "P"); assert(A[0] != B[0]); return 0; }