Submission #63002636
Source Code Expand
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#define ll long long
#define ull unsigned long long
#define ld long double
#define int long long
#define nl "\n"
#define oo 1e9 + 1
#define OO 1e18 + 1
#define sp ' '
#define sz(x) (int)(x.size())
#define MOD 1000000007
#define fixed(n) fixed << setprecision(n)
#define sub_mod(a, b, m) ((((a) % m) - ((b) % m) + m) % m)
#define add_mod(a, b, m) ((((a) % m) + ((b) % m)) % m)
#define mult_mod(a, b, m) ((((a) % m) * ((b) % m)) % m)
#define EPS 1e-9
#define PI acos(-1)
using namespace __gnu_pbds;
using namespace std;
void solve(int tc)
{
string s;
cin >> s;
int n = sz(s);
for (int i = n - 2; i >= 0; i--){
if(s[i] == 'W' && s[i + 1] == 'A'){
s[i] = 'A';
s[i + 1] = 'C';
}
}
cout << s << nl;
}
signed main(void)
{
ios_base::sync_with_stdio(false), cin.tie(nullptr), cout.tie(nullptr);
int tc = 1;
//cin >> tc;
int i = 1;
while (tc--)
{
// cout<<"Case #"<<i<<": ";
solve(i++);
}
return 0;
}
Submission Info
| Submission Time | |
|---|---|
| Task | C - Debug |
| User | Mazen_Ghanayem |
| Language | C++ 23 (gcc 12.2) |
| Score | 300 |
| Code Size | 1151 Byte |
| Status | AC |
| Exec Time | 2 ms |
| Memory | 3760 KiB |
Compile Error
Main.cpp: In function ‘void solve(long long int)’:
Main.cpp:22:16: warning: unused parameter ‘tc’ [-Wunused-parameter]
22 | void solve(int tc)
| ^
Judge Result
| Set Name | Sample | All | ||||
|---|---|---|---|---|---|---|
| Score / Max Score | 0 / 0 | 300 / 300 | ||||
| Status |
|
|
| Set Name | Test Cases |
|---|---|
| Sample | example_00.txt, example_01.txt, example_02.txt |
| All | example_00.txt, example_01.txt, example_02.txt, hand_00.txt, hand_01.txt, hand_02.txt, hand_03.txt, hand_04.txt, hand_05.txt, hand_06.txt, random_00.txt, random_01.txt, random_02.txt, random_03.txt, random_04.txt, random_05.txt, random_06.txt, random_07.txt, random_08.txt, random_09.txt, random_10.txt, random_11.txt, random_12.txt, random_13.txt, random_14.txt, random_15.txt, random_16.txt, random_17.txt, random_18.txt, random_19.txt |
| Case Name | Status | Exec Time | Memory |
|---|---|---|---|
| example_00.txt | AC | 1 ms | 3600 KiB |
| example_01.txt | AC | 1 ms | 3380 KiB |
| example_02.txt | AC | 1 ms | 3528 KiB |
| hand_00.txt | AC | 2 ms | 3720 KiB |
| hand_01.txt | AC | 2 ms | 3688 KiB |
| hand_02.txt | AC | 2 ms | 3676 KiB |
| hand_03.txt | AC | 2 ms | 3732 KiB |
| hand_04.txt | AC | 1 ms | 3432 KiB |
| hand_05.txt | AC | 1 ms | 3460 KiB |
| hand_06.txt | AC | 2 ms | 3652 KiB |
| random_00.txt | AC | 2 ms | 3700 KiB |
| random_01.txt | AC | 2 ms | 3740 KiB |
| random_02.txt | AC | 2 ms | 3736 KiB |
| random_03.txt | AC | 2 ms | 3688 KiB |
| random_04.txt | AC | 2 ms | 3760 KiB |
| random_05.txt | AC | 2 ms | 3716 KiB |
| random_06.txt | AC | 2 ms | 3712 KiB |
| random_07.txt | AC | 2 ms | 3656 KiB |
| random_08.txt | AC | 2 ms | 3644 KiB |
| random_09.txt | AC | 2 ms | 3676 KiB |
| random_10.txt | AC | 2 ms | 3580 KiB |
| random_11.txt | AC | 2 ms | 3672 KiB |
| random_12.txt | AC | 2 ms | 3728 KiB |
| random_13.txt | AC | 2 ms | 3728 KiB |
| random_14.txt | AC | 2 ms | 3688 KiB |
| random_15.txt | AC | 2 ms | 3724 KiB |
| random_16.txt | AC | 2 ms | 3672 KiB |
| random_17.txt | AC | 2 ms | 3676 KiB |
| random_18.txt | AC | 2 ms | 3720 KiB |
| random_19.txt | AC | 2 ms | 3728 KiB |