QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#172577 | #7218. The Ultimate Duel | gugg | WA | 1ms | 3816kb | C++14 | 1.1kb | 2023-09-09 19:48:45 | 2023-09-09 19:48:45 |
Judging History
answer
#include <iostream>
#include <algorithm>
#include <cstring>
#include <vector>
#include <queue>
#include <unordered_map>
#include <unordered_set>
#include <map>
#include <set>
#include <cmath>
#include <bitset>
#include <cassert>
using namespace std;
typedef long long ll;
void solve()
{
string s, t;
cin >> s >> t;
for (int i = 0; i < 3; i ++) s += s;
int j = 0;
int m = t.size();
int cnt0 = 0, cnt1 = 0;
for (int i = 0; s[i]; i ++)
{
if ((s[i] == 'R' && t[j] == 'S') || (s[i] == 'S' && t[j] == 'P') || (s[i] == 'P' && t[j] == 'R')) cnt0 ++;
else if ((t[j] == 'R' && s[i] == 'S') || (t[j] == 'S' && s[i] == 'P') || (t[j] == 'P' && s[i] == 'R')) cnt1 ++;
j ++;
j %= m;
}
if (cnt0 > cnt1) cout << "TankEngineer\n";
else if (cnt0 < cnt1) cout << "AngryBacon\n";
else cout << "Rowdark\n";
}
int main()
{
ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);
int tt = 1;
// cin >> tt;
while (tt --)
{
solve();
}
return 0;
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 1ms
memory: 3620kb
input:
R S
output:
TankEngineer
result:
ok "TankEngineer"
Test #2:
score: 0
Accepted
time: 1ms
memory: 3788kb
input:
RPSSPR RSR
output:
AngryBacon
result:
ok "AngryBacon"
Test #3:
score: 0
Accepted
time: 0ms
memory: 3616kb
input:
PPPSSSRRR R
output:
Rowdark
result:
ok "Rowdark"
Test #4:
score: 0
Accepted
time: 1ms
memory: 3552kb
input:
RRRSRPSRPP SSPRRSRSRR
output:
TankEngineer
result:
ok "TankEngineer"
Test #5:
score: 0
Accepted
time: 1ms
memory: 3816kb
input:
PRPRRRPPSSPSSPPSPPRS PSPPRRRPPP
output:
TankEngineer
result:
ok "TankEngineer"
Test #6:
score: 0
Accepted
time: 1ms
memory: 3620kb
input:
SPSSSSSPRPSRPRPPSRSRPRPSSPSSRS SRSRRRSSPRPSSRRRPSSR
output:
AngryBacon
result:
ok "AngryBacon"
Test #7:
score: -100
Wrong Answer
time: 1ms
memory: 3784kb
input:
SPSPPSSSRSSRPPPRRPSRSRRSPSRRRSRPSSPRRPPS PRPPPSPPPRRPPSPRPPSRSRSRPPSPRSSRPSPRRRSSPRRRSRRSSSPPPRRPPPRR
output:
AngryBacon
result:
wrong answer 1st words differ - expected: 'Rowdark', found: 'AngryBacon'