QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#617610#8046. Rock-Paper-Scissors PyramidtomatossTL 0ms3740kbC++14812b2024-10-06 16:24:562024-10-06 16:24:58

Judging History

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

  • [2024-10-06 16:24:58]
  • 评测
  • 测评结果:TL
  • 用时:0ms
  • 内存:3740kb
  • [2024-10-06 16:24:56]
  • 提交

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';
	}
}

详细

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...

output:


result: