QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#691114 | #7656. Eszett | VanLam# | WA | 0ms | 3720kb | C++14 | 2.4kb | 2024-10-31 09:56:51 | 2024-10-31 09:56:52 |
Judging History
answer
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define fi first
#define se second
#define vi vector<int>
#define vl vector<ll>
#define vb vector<bool>
#define vs vector<string>
#define pii pair<int, int>
#define pib pair<int, bool>
#define pdd pair<double, double>
#define mii map<int, int>
#define mib map<int, bool>
#define mil map<int, ll>
#define mli map<ll, int>
#define si set<int>
#define vvi vector<vi>
#define vvl vector<vl>
#define vvb vector<vb>
#define vpi vector<pii>
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define sub(x, l, r) (x).begin() + l, (x).begin() + r
#define rsub(x, l, r) (x).rbegin() + l, (x).rbegin() + r
#define FOR(i, a, b) for (int i = a, _b = b; i <= _b; i++)
#define FORD(i, a, b) for (int i = a, _b = b; i >= _b; i--)
#define yes cout << "YES\n";
#define no cout << "NO\n";
#define yn yes else no
#define ny no else yes
// #define int ll
#ifdef VanLam
#include <debug.h>
#define debug(...) cerr << "[" << #__VA_ARGS__ << "]:", debug_out(__VA_ARGS__)
#else
#define debug(...) 1205
#endif
const int INF = 1e9 + 7;
const int MOD = 1e9 + 7;
const int maxN = 1e6 + 5;
vb isChanged;
string s;
int n;
void get()
{
FOR(i, 0, n - 1)
{
if (isChanged[i])
{
cout << 'B';
i++;
}
else
{
cout << s[i];
}
}
cout << '\n';
}
void backTrack(int k, int num)
{
if (k == n)
{
get();
return;
}
if (s[k] == 's')
{
backTrack(k + 1, num + 1);
} else {
backTrack(k + 1, 0);
}
if (num >= 2) {
isChanged[k - 2] = true;
backTrack(k + 1, num - 2);
isChanged[k - 2] = false;
}
}
void solve()
{
cin >> s;
n = s.length();
FOR(i, 0, n - 1)
s[i] = tolower(s[i]);
isChanged.assign(n, 0);
backTrack(0, 0);
}
signed main()
{
ios::sync_with_stdio(0);
cin.tie(0);
cout.tie(0);
if (fopen("input.txt", "r"))
{
freopen("input.txt", "r", stdin);
freopen("output.txt", "w", stdout);
}
int t = 1;
// cin >> t;
int testcase = 1;
while (t--)
{
cerr << "------ CASE: " << testcase++ << " ------\n";
solve();
cerr << "-------- END --------\n";
}
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: 3656kb
input:
MASSSTAB
output:
massstab masBtab maBstab
result:
ok correct
Test #3:
score: 0
Accepted
time: 0ms
memory: 3652kb
input:
EINDEUTIG
output:
eindeutig
result:
ok correct
Test #4:
score: 0
Accepted
time: 0ms
memory: 3656kb
input:
S
output:
s
result:
ok correct
Test #5:
score: 0
Accepted
time: 0ms
memory: 3708kb
input:
STRASSE
output:
strasse straBe
result:
ok correct
Test #6:
score: 0
Accepted
time: 0ms
memory: 3648kb
input:
M
output:
m
result:
ok correct
Test #7:
score: 0
Accepted
time: 0ms
memory: 3720kb
input:
MZ
output:
mz
result:
ok correct
Test #8:
score: 0
Accepted
time: 0ms
memory: 3588kb
input:
SE
output:
se
result:
ok correct
Test #9:
score: 0
Accepted
time: 0ms
memory: 3708kb
input:
BS
output:
bs
result:
ok correct
Test #10:
score: -100
Wrong Answer
time: 0ms
memory: 3588kb
input:
SS
output:
ss
result:
wrong output format Unexpected end of file - token expected