QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#562893#7656. EszettV-ioleTWA 0ms3836kbC++202.3kb2024-09-13 22:27:312024-09-13 22:27:31

Judging History

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

  • [2024-09-13 22:27:31]
  • 评测
  • 测评结果:WA
  • 用时:0ms
  • 内存:3836kb
  • [2024-09-13 22:27:31]
  • 提交

answer

#include <bits/stdc++.h>
using namespace std;

#define endl '\n'
#define int long long
#define ull unsigned long long
typedef long long ll;
#define lowbit(x) ((x) & -(x))

const ll INF = 0x3f3f3f3f;
const ll mod = 998244353;
const int N = 2e5 + 5, M = 5e5 + 10;
typedef pair<int, int> PII;
double T = 1 >> 30;
// double PI = acos(-1);

int gcd(int a, int b)
{
    return b ? gcd(b, a % b) : a;
}

int lcm(int a, int b)
{
    return a / gcd(a, b) * b;
}

void solve()
{
    int i, j;

    string s;
    cin >> s;
    int n = s.size();
    s = '?' + s;

    int flag1 = 0, flag2 = 0;

    for (i = 1; i <= n; i++)
    {
        if (s[i] == 'S')
        {
            if (i < n && s[i + 1] == 'S')
            {
                flag1 = 1;
            }
            if (i < n - 1 && s[i + 2] == 'S')
            {
                flag2 = 1;
            }
        }
    }

    for (i = 1; i <= n; i++)
    {
        cout << (char)(s[i] + 32);
    }
    cout << endl;

    if (flag2)
    {
       // cout << "222222" << endl;
        for (i = 1; i <= n; i++)
        {
            if (s[i] != 'S')
            {
                cout << (char)(s[i] + 32);
            }
            else
            {
                cout << "sB";
                i += 2;
            }
        }
        cout << endl;
        for (i = 1; i <= n; i++)
        {
            if (s[i] != 'S')
            {
                cout << (char)(s[i] + 32);
            }
            else
            {
                cout << "Bs";
                i += 2;
            }
        }
    }
    else if (flag1)
    {
        for (i = 1; i <= n; i++)
        {
            if (s[i] != 'S')
            {
                cout << (char)(s[i] + 32);
            }
            else
            {
                if (i < n && s[i + 1] == 'S')
                {
                    cout << "B";
                    i += 1;
                }
                else
                {
                    cout << "s";
                }
            }
        }
    }
}

signed main()
{
    // ios_base::sync_with_stdio(false);
    // cin.tie(nullptr);
    // cout.tie(nullptr);
    int t = 1;

    // cin >> t;

    while (t--)
    {
        solve();
    }


    return 0;
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 100
Accepted
time: 0ms
memory: 3584kb

input:

AUFREISSEN

output:

aufreissen
aufreiBen

result:

ok correct

Test #2:

score: 0
Accepted
time: 0ms
memory: 3604kb

input:

MASSSTAB

output:

massstab
masBtab
maBstab

result:

ok correct

Test #3:

score: 0
Accepted
time: 0ms
memory: 3556kb

input:

EINDEUTIG

output:

eindeutig

result:

ok correct

Test #4:

score: 0
Accepted
time: 0ms
memory: 3548kb

input:

S

output:

s

result:

ok correct

Test #5:

score: 0
Accepted
time: 0ms
memory: 3532kb

input:

STRASSE

output:

strasse
straBe

result:

ok correct

Test #6:

score: 0
Accepted
time: 0ms
memory: 3616kb

input:

M

output:

m

result:

ok correct

Test #7:

score: 0
Accepted
time: 0ms
memory: 3552kb

input:

MZ

output:

mz

result:

ok correct

Test #8:

score: 0
Accepted
time: 0ms
memory: 3616kb

input:

SE

output:

se

result:

ok correct

Test #9:

score: 0
Accepted
time: 0ms
memory: 3556kb

input:

BS

output:

bs

result:

ok correct

Test #10:

score: 0
Accepted
time: 0ms
memory: 3600kb

input:

SS

output:

ss
B

result:

ok correct

Test #11:

score: 0
Accepted
time: 0ms
memory: 3836kb

input:

MZN

output:

mzn

result:

ok correct

Test #12:

score: 0
Accepted
time: 0ms
memory: 3612kb

input:

SET

output:

set

result:

ok correct

Test #13:

score: 0
Accepted
time: 0ms
memory: 3616kb

input:

BSC

output:

bsc

result:

ok correct

Test #14:

score: 0
Accepted
time: 0ms
memory: 3584kb

input:

SSH

output:

ssh
Bh

result:

ok correct

Test #15:

score: 0
Accepted
time: 0ms
memory: 3524kb

input:

HJS

output:

hjs

result:

ok correct

Test #16:

score: -100
Wrong Answer
time: 0ms
memory: 3604kb

input:

SUS

output:

sus
sB
Bs

result:

wrong output format Extra information in the output file