QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#617605 | #8046. Rock-Paper-Scissors Pyramid | tomatoss | WA | 0ms | 3572kb | C++14 | 808b | 2024-10-06 16:24:19 | 2024-10-06 16:24:19 |
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: 0
Wrong Answer
time: 0ms
memory: 3572kb
input:
2 SPR SPSRRP
output:
SP S S SSRRP SRRP RRP RP P P
result:
wrong answer 1st lines differ - expected: 'S', found: ' SP'