QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#338480#7218. The Ultimate DuelKevin5307WA 0ms3504kbC++20598b2024-02-25 22:48:582024-02-25 22:48:58

Judging History

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

  • [2024-02-25 22:48:58]
  • 评测
  • 测评结果:WA
  • 用时:0ms
  • 内存:3504kb
  • [2024-02-25 22:48:58]
  • 提交

answer

#include<bits/stdc++.h>
using namespace std;
using ll=long long;
int table[256];
int main()
{
	table['R']=0;
	table['P']=1;
	table['S']=2;
	string s,t;
	cin>>s>>t;
	ll sum=0;
	int g=__gcd(s.length(),t.length());
	vector<array<int,3>> v1(g),v2(g);
	for(int i=0;i<s.length();i++)
		v1[i%g][table[s[i]]]++;
	for(int i=0;i<t.length();i++)
		v2[i%g][table[t[i]]]++;
	for(int i=0;i<g;i++)
		for(int j=0;j<3;j++)
			sum+=1ll*v1[i][j]*(v2[i][(j+1)%3]-v2[i][(j+2)%3]);
	if(sum>0)
		cout<<"TankEngineer";
	else if(sum<0)
		cout<<"AngryBacon";
	else
		cout<<"Rowdark";
	return 0;
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 0
Wrong Answer
time: 0ms
memory: 3504kb

input:

R
S

output:

AngryBacon

result:

wrong answer 1st words differ - expected: 'TankEngineer', found: 'AngryBacon'