Submission #63030566
Source Code Expand
Copy
#include<bits/stdc++.h>#define ll long long#define ss second#define ff first#define pb push_back#define mod 1000000007#define endl "\n"using namespace std;ll n,m,a,b,c,d;string s;int main(){ios::sync_with_stdio(false);cin.tie(0);cout.tie(0);cin>>s;for (int i=0; i<s.size()-1; i++){if (s[i]=='W'&&s[i+1]=='A'){s[i]='A'; s[i+1]='C'; i-=2; if(i<0) i=-1;continue;}}cout<<s;}
#include<bits/stdc++.h> #define ll long long #define ss second #define ff first #define pb push_back #define mod 1000000007 #define endl "\n" using namespace std; ll n,m,a,b,c,d; string s; int main(){ ios::sync_with_stdio(false); cin.tie(0); cout.tie(0); cin>>s; for (int i=0; i<s.size()-1; i++) { if (s[i]=='W'&&s[i+1]=='A'){s[i]='A'; s[i+1]='C'; i-=2; if(i<0) i=-1;continue;} } cout<<s; }
Submission Info
Submission Time | |
---|---|
Task | C - Debug |
User | Tegshzaya |
Language | C++ 20 (gcc 12.2) |
Score | 300 |
Code Size | 433 Byte |
Status | AC |
Exec Time | 3 ms |
Memory | 3856 KB |
Compile Error
Main.cpp: In function ‘int main()’: Main.cpp:16:24: warning: comparison of integer expressions of different signedness: ‘int’ and ‘std::__cxx11::basic_string<char>::size_type’ {aka ‘long unsigned int’} [-Wsign-compare] 16 | for (int i=0; i<s.size()-1; i++) | ~^~~~~~~~~~~
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 | 3564 KB |
example_01.txt | AC | 1 ms | 3472 KB |
example_02.txt | AC | 1 ms | 3396 KB |
hand_00.txt | AC | 2 ms | 3712 KB |
hand_01.txt | AC | 2 ms | 3712 KB |
hand_02.txt | AC | 2 ms | 3736 KB |
hand_03.txt | AC | 2 ms | 3840 KB |
hand_04.txt | AC | 1 ms | 3496 KB |
hand_05.txt | AC | 1 ms | 3436 KB |
hand_06.txt | AC | 2 ms | 3688 KB |
random_00.txt | AC | 3 ms | 3704 KB |
random_01.txt | AC | 3 ms | 3764 KB |
random_02.txt | AC | 3 ms | 3724 KB |
random_03.txt | AC | 2 ms | 3692 KB |
random_04.txt | AC | 2 ms | 3728 KB |
random_05.txt | AC | 2 ms | 3708 KB |
random_06.txt | AC | 2 ms | 3720 KB |
random_07.txt | AC | 2 ms | 3704 KB |
random_08.txt | AC | 2 ms | 3692 KB |
random_09.txt | AC | 2 ms | 3712 KB |
random_10.txt | AC | 2 ms | 3652 KB |
random_11.txt | AC | 2 ms | 3856 KB |
random_12.txt | AC | 3 ms | 3716 KB |
random_13.txt | AC | 2 ms | 3720 KB |
random_14.txt | AC | 2 ms | 3700 KB |
random_15.txt | AC | 2 ms | 3752 KB |
random_16.txt | AC | 2 ms | 3620 KB |
random_17.txt | AC | 2 ms | 3752 KB |
random_18.txt | AC | 2 ms | 3720 KB |
random_19.txt | AC | 2 ms | 3716 KB |