QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#617605#8046. Rock-Paper-Scissors PyramidtomatossWA 0ms3572kbC++14808b2024-10-06 16:24:192024-10-06 16:24:19

Judging History

你现在查看的是最新测评结果

  • [2024-10-06 16:24:19]
  • 评测
  • 测评结果:WA
  • 用时:0ms
  • 内存:3572kb
  • [2024-10-06 16:24:19]
  • 提交

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'