Submission #63014844
Source Code Expand
Copy
#include<bits/stdc++.h>using namespace std;using ll=long long;int main(){ios::sync_with_stdio(false);cin.tie(0);cout.tie(0);string s;cin>>s;int n=s.length();for(int i=n-1;i>=0;i--){if(i>0&&s[i]=='A'&&s[i-1]=='W'){s[i]='C';s[i-1]='A';}}cout<<s;return 0;}
#include<bits/stdc++.h> using namespace std; using ll=long long; int main(){ ios::sync_with_stdio(false); cin.tie(0);cout.tie(0); string s; cin>>s; int n=s.length(); for(int i=n-1;i>=0;i--){ if(i>0&&s[i]=='A'&&s[i-1]=='W'){ s[i]='C';s[i-1]='A'; } } cout<<s; return 0; }
Submission Info
Submission Time | |
---|---|
Task | C - Debug |
User | Mint_Cat |
Language | C++ 17 (gcc 12.2) |
Score | 300 |
Code Size | 357 Byte |
Status | AC |
Exec Time | 3 ms |
Memory | 3768 KB |
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 | 2 ms | 3412 KB |
example_01.txt | AC | 1 ms | 3476 KB |
example_02.txt | AC | 2 ms | 3376 KB |
hand_00.txt | AC | 3 ms | 3652 KB |
hand_01.txt | AC | 3 ms | 3768 KB |
hand_02.txt | AC | 3 ms | 3688 KB |
hand_03.txt | AC | 3 ms | 3724 KB |
hand_04.txt | AC | 2 ms | 3528 KB |
hand_05.txt | AC | 2 ms | 3476 KB |
hand_06.txt | AC | 3 ms | 3712 KB |
random_00.txt | AC | 3 ms | 3688 KB |
random_01.txt | AC | 3 ms | 3656 KB |
random_02.txt | AC | 3 ms | 3724 KB |
random_03.txt | AC | 3 ms | 3728 KB |
random_04.txt | AC | 3 ms | 3656 KB |
random_05.txt | AC | 3 ms | 3660 KB |
random_06.txt | AC | 3 ms | 3696 KB |
random_07.txt | AC | 3 ms | 3672 KB |
random_08.txt | AC | 3 ms | 3736 KB |
random_09.txt | AC | 3 ms | 3732 KB |
random_10.txt | AC | 3 ms | 3768 KB |
random_11.txt | AC | 3 ms | 3676 KB |
random_12.txt | AC | 3 ms | 3668 KB |
random_13.txt | AC | 3 ms | 3676 KB |
random_14.txt | AC | 3 ms | 3768 KB |
random_15.txt | AC | 3 ms | 3660 KB |
random_16.txt | AC | 3 ms | 3708 KB |
random_17.txt | AC | 3 ms | 3684 KB |
random_18.txt | AC | 3 ms | 3656 KB |
random_19.txt | AC | 3 ms | 3708 KB |