QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#562895 | #7656. Eszett | V-ioleT | AC ✓ | 0ms | 3852kb | C++20 | 2.3kb | 2024-09-13 22:28:49 | 2024-09-13 22:28:54 |
Judging History
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' && s[i + 1] == '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: 3848kb
input:
AUFREISSEN
output:
aufreissen aufreiBen
result:
ok correct
Test #2:
score: 0
Accepted
time: 0ms
memory: 3484kb
input:
MASSSTAB
output:
massstab masBtab maBstab
result:
ok correct
Test #3:
score: 0
Accepted
time: 0ms
memory: 3596kb
input:
EINDEUTIG
output:
eindeutig
result:
ok correct
Test #4:
score: 0
Accepted
time: 0ms
memory: 3532kb
input:
S
output:
s
result:
ok correct
Test #5:
score: 0
Accepted
time: 0ms
memory: 3592kb
input:
STRASSE
output:
strasse straBe
result:
ok correct
Test #6:
score: 0
Accepted
time: 0ms
memory: 3592kb
input:
M
output:
m
result:
ok correct
Test #7:
score: 0
Accepted
time: 0ms
memory: 3844kb
input:
MZ
output:
mz
result:
ok correct
Test #8:
score: 0
Accepted
time: 0ms
memory: 3536kb
input:
SE
output:
se
result:
ok correct
Test #9:
score: 0
Accepted
time: 0ms
memory: 3504kb
input:
BS
output:
bs
result:
ok correct
Test #10:
score: 0
Accepted
time: 0ms
memory: 3592kb
input:
SS
output:
ss B
result:
ok correct
Test #11:
score: 0
Accepted
time: 0ms
memory: 3600kb
input:
MZN
output:
mzn
result:
ok correct
Test #12:
score: 0
Accepted
time: 0ms
memory: 3600kb
input:
SET
output:
set
result:
ok correct
Test #13:
score: 0
Accepted
time: 0ms
memory: 3484kb
input:
BSC
output:
bsc
result:
ok correct
Test #14:
score: 0
Accepted
time: 0ms
memory: 3576kb
input:
SSH
output:
ssh Bh
result:
ok correct
Test #15:
score: 0
Accepted
time: 0ms
memory: 3632kb
input:
HJS
output:
hjs
result:
ok correct
Test #16:
score: 0
Accepted
time: 0ms
memory: 3540kb
input:
SUS
output:
sus
result:
ok correct
Test #17:
score: 0
Accepted
time: 0ms
memory: 3776kb
input:
TSS
output:
tss tB
result:
ok correct
Test #18:
score: 0
Accepted
time: 0ms
memory: 3576kb
input:
SSS
output:
sss sB Bs
result:
ok correct
Test #19:
score: 0
Accepted
time: 0ms
memory: 3844kb
input:
QSSS
output:
qsss qsB qBs
result:
ok correct
Test #20:
score: 0
Accepted
time: 0ms
memory: 3604kb
input:
CWSF
output:
cwsf
result:
ok correct
Test #21:
score: 0
Accepted
time: 0ms
memory: 3592kb
input:
SKMS
output:
skms
result:
ok correct
Test #22:
score: 0
Accepted
time: 0ms
memory: 3852kb
input:
SSOSY
output:
ssosy Bosy
result:
ok correct
Test #23:
score: 0
Accepted
time: 0ms
memory: 3536kb
input:
SJTJS
output:
sjtjs
result:
ok correct
Test #24:
score: 0
Accepted
time: 0ms
memory: 3572kb
input:
KFQSS
output:
kfqss kfqB
result:
ok correct
Test #25:
score: 0
Accepted
time: 0ms
memory: 3640kb
input:
SSTBAS
output:
sstbas Btbas
result:
ok correct
Test #26:
score: 0
Accepted
time: 0ms
memory: 3600kb
input:
SEJWHS
output:
sejwhs
result:
ok correct
Test #27:
score: 0
Accepted
time: 0ms
memory: 3608kb
input:
VSSIVK
output:
vssivk vBivk
result:
ok correct
Test #28:
score: 0
Accepted
time: 0ms
memory: 3532kb
input:
SISDRKS
output:
sisdrks
result:
ok correct
Test #29:
score: 0
Accepted
time: 0ms
memory: 3604kb
input:
SSIIYRU
output:
ssiiyru Biiyru
result:
ok correct
Test #30:
score: 0
Accepted
time: 0ms
memory: 3536kb
input:
SVXSCSI
output:
svxscsi
result:
ok correct
Test #31:
score: 0
Accepted
time: 0ms
memory: 3580kb
input:
CSSUFKSA
output:
cssufksa cBufksa
result:
ok correct
Test #32:
score: 0
Accepted
time: 0ms
memory: 3536kb
input:
XYCXSUJW
output:
xycxsujw
result:
ok correct
Test #33:
score: 0
Accepted
time: 0ms
memory: 3540kb
input:
SSCCVGSE
output:
ssccvgse Bccvgse
result:
ok correct
Test #34:
score: 0
Accepted
time: 0ms
memory: 3600kb
input:
USODCFCQW
output:
usodcfcqw
result:
ok correct
Test #35:
score: 0
Accepted
time: 0ms
memory: 3600kb
input:
QSSYLGSUT
output:
qssylgsut qBylgsut
result:
ok correct
Test #36:
score: 0
Accepted
time: 0ms
memory: 3600kb
input:
SFSWSZFVG
output:
sfswszfvg
result:
ok correct
Test #37:
score: 0
Accepted
time: 0ms
memory: 3848kb
input:
ZDIISSFQBK
output:
zdiissfqbk zdiiBfqbk
result:
ok correct
Test #38:
score: 0
Accepted
time: 0ms
memory: 3596kb
input:
NASPGSYSLL
output:
naspgsysll
result:
ok correct
Test #39:
score: 0
Accepted
time: 0ms
memory: 3504kb
input:
TYSNSELISR
output:
tysnselisr
result:
ok correct
Test #40:
score: 0
Accepted
time: 0ms
memory: 3848kb
input:
SASIIFGXSPC
output:
sasiifgxspc
result:
ok correct
Test #41:
score: 0
Accepted
time: 0ms
memory: 3572kb
input:
BCSADCQJASS
output:
bcsadcqjass bcsadcqjaB
result:
ok correct
Test #42:
score: 0
Accepted
time: 0ms
memory: 3596kb
input:
SQSPSUXEOBV
output:
sqspsuxeobv
result:
ok correct
Test #43:
score: 0
Accepted
time: 0ms
memory: 3540kb
input:
GSKRZGXGJSES
output:
gskrzgxgjses
result:
ok correct
Test #44:
score: 0
Accepted
time: 0ms
memory: 3544kb
input:
DSSCJYYFKSZQ
output:
dsscjyyfkszq dBcjyyfkszq
result:
ok correct
Test #45:
score: 0
Accepted
time: 0ms
memory: 3544kb
input:
KLSZNDQRYSSK
output:
klszndqryssk klszndqryBk
result:
ok correct
Test #46:
score: 0
Accepted
time: 0ms
memory: 3800kb
input:
QNYSSOIOHKSPP
output:
qnyssoiohkspp qnyBoiohkspp
result:
ok correct
Test #47:
score: 0
Accepted
time: 0ms
memory: 3568kb
input:
KHFSGMSNZBSNA
output:
khfsgmsnzbsna
result:
ok correct
Test #48:
score: 0
Accepted
time: 0ms
memory: 3832kb
input:
YBSDSSCXQNYNW
output:
ybsdsscxqnynw ybsdBcxqnynw
result:
ok correct
Test #49:
score: 0
Accepted
time: 0ms
memory: 3636kb
input:
POGSVOPOZWSSBX
output:
pogsvopozwssbx pogsvopozwBbx
result:
ok correct
Test #50:
score: 0
Accepted
time: 0ms
memory: 3612kb
input:
BRGSUSVQWBYHSX
output:
brgsusvqwbyhsx
result:
ok correct
Test #51:
score: 0
Accepted
time: 0ms
memory: 3600kb
input:
XFTTSZJMJFMYST
output:
xfttszjmjfmyst
result:
ok correct
Test #52:
score: 0
Accepted
time: 0ms
memory: 3540kb
input:
PIRMPOSGPIMFBEK
output:
pirmposgpimfbek
result:
ok correct
Test #53:
score: 0
Accepted
time: 0ms
memory: 3608kb
input:
BHPGVKJMPQDSISS
output:
bhpgvkjmpqdsiss bhpgvkjmpqdsiB
result:
ok correct
Test #54:
score: 0
Accepted
time: 0ms
memory: 3576kb
input:
EGLSNBNSLLVWVPS
output:
eglsnbnsllvwvps
result:
ok correct
Test #55:
score: 0
Accepted
time: 0ms
memory: 3488kb
input:
ACTSFNGHJSNWSJJP
output:
actsfnghjsnwsjjp
result:
ok correct
Test #56:
score: 0
Accepted
time: 0ms
memory: 3644kb
input:
QUSSADXNLLJHXFXS
output:
qussadxnlljhxfxs quBadxnlljhxfxs
result:
ok correct
Test #57:
score: 0
Accepted
time: 0ms
memory: 3844kb
input:
RNEHZSVOPKIDSPJF
output:
rnehzsvopkidspjf
result:
ok correct
Test #58:
score: 0
Accepted
time: 0ms
memory: 3596kb
input:
RKXBCPXJSATTJMSSO
output:
rkxbcpxjsattjmsso rkxbcpxjsattjmBo
result:
ok correct
Test #59:
score: 0
Accepted
time: 0ms
memory: 3600kb
input:
XKSZJJHSVSHUAHTCE
output:
xkszjjhsvshuahtce
result:
ok correct
Test #60:
score: 0
Accepted
time: 0ms
memory: 3568kb
input:
SNGJTDICCSWLRDVBN
output:
sngjtdiccswlrdvbn
result:
ok correct
Test #61:
score: 0
Accepted
time: 0ms
memory: 3788kb
input:
BLSDETWYSWXSGKNPMO
output:
blsdetwyswxsgknpmo
result:
ok correct
Test #62:
score: 0
Accepted
time: 0ms
memory: 3592kb
input:
STJSQRSZPNHVLKILRO
output:
stjsqrszpnhvlkilro
result:
ok correct
Test #63:
score: 0
Accepted
time: 0ms
memory: 3764kb
input:
XSGLLGSMLDISWNXPWA
output:
xsgllgsmldiswnxpwa
result:
ok correct
Test #64:
score: 0
Accepted
time: 0ms
memory: 3600kb
input:
UASUWWGCTGGSKSNWLJX
output:
uasuwwgctggsksnwljx
result:
ok correct
Test #65:
score: 0
Accepted
time: 0ms
memory: 3772kb
input:
LXAWDLZSCRNEXSGGSKB
output:
lxawdlzscrnexsggskb
result:
ok correct
Test #66:
score: 0
Accepted
time: 0ms
memory: 3576kb
input:
XUKSIYXNSSOECOXMRXU
output:
xuksiyxnssoecoxmrxu xuksiyxnBoecoxmrxu
result:
ok correct
Test #67:
score: 0
Accepted
time: 0ms
memory: 3484kb
input:
VTRRKTFSWGBKHSRBSPVV
output:
vtrrktfswgbkhsrbspvv
result:
ok correct
Test #68:
score: 0
Accepted
time: 0ms
memory: 3548kb
input:
VHYYZSLSFAJXXRJSJRDF
output:
vhyyzslsfajxxrjsjrdf
result:
ok correct
Test #69:
score: 0
Accepted
time: 0ms
memory: 3544kb
input:
SSXLSMXANFXWGOTQVFVQ
output:
ssxlsmxanfxwgotqvfvq Bxlsmxanfxwgotqvfvq
result:
ok correct