QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#617610 | #8046. Rock-Paper-Scissors Pyramid | tomatoss | TL | 0ms | 3740kb | C++14 | 812b | 2024-10-06 16:24:56 | 2024-10-06 16:24:58 |
Judging History
answer
#include<bits/stdc++.h>
#define int long long
using namespace std;
int a[1010], b[1010];
int n;
double t = 0.3331321335578;
double ct = 0;
void solve() {
ct += t;
cout<<ct<<'\n';
}
signed main() {
int t; cin >> t;
while (t--) {
string s;
cin>>s;
int len = s.size();
for(int i = 1; i< len;i++){
string t;
for(int i = 1;i < s.size();i++){
if(s[i] == s[i - 1]){
t += s[i];
}
else{
if((s[i] == 'R' && s[i - 1] == 'P')||(s[i - 1] == 'R' && s[i] == 'P'))t += 'P';
if((s[i] == 'R' && s[i - 1] == 'S')||(s[i - 1] == 'R' && s[i] == 'S'))t += 'R';
if((s[i] == 'S' && s[i - 1] == 'P')||(s[i - 1] == 'S' && s[i] == 'P'))t += 'S';
}
}
s = t;
//for(int j = 0;j <= i/2;j++)cout<<" ";
//cout<<s<<'\n';
}
cout<<s<<'\n';
}
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 0ms
memory: 3740kb
input:
2 SPR SPSRRP
output:
S P
result:
ok 2 lines
Test #2:
score: -100
Time Limit Exceeded
input:
1 RPPSRPPRSRSRRRPPSPRPRSRRSRRPPPRSPSSRRRSPPPRRRPRRRSSRPSSRPRRPSRRRPRSRPSRPSRRSPPRPRRRSPRSSSRPRRRPPSRRRRPPSRSRRRPRPRPRPPRRSRRPSRPPSRRRSRRSRRSPSRPRPSPSSRRSPSPSRPRRRPPRSRSPSPPRRPRSRPPSSSRPSPRRPSSSPRRSRRSRRSRSPSSSSRSSPPRRRRPRRRSPSRSPRSSPRSPSPRPRRRPPRPPRPPPSRRRRSSPRRSRRRPRRRSSRRPSRPPRSPPSPPPSPSPSPPSSPRRR...