QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#172577#7218. The Ultimate DuelguggWA 1ms3816kbC++141.1kb2023-09-09 19:48:452023-09-09 19:48:45

Judging History

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

  • [2023-09-09 19:48:45]
  • 评测
  • 测评结果:WA
  • 用时:1ms
  • 内存:3816kb
  • [2023-09-09 19:48:45]
  • 提交

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

詳細信息

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'