QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#338480 | #7218. The Ultimate Duel | Kevin5307 | WA | 0ms | 3504kb | C++20 | 598b | 2024-02-25 22:48:58 | 2024-02-25 22:48:58 |
Judging History
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'