Submission #63050908
Source Code Expand
Copy
#include <iostream> // 基本输入输出流#include <algorithm> // 通用算法(排序、查找、去重、二分查找等)#include <vector> // 动态数组(空间不够会自动扩容)#include <queue> // 队列(先进先出)#include <stack> // 栈(先进后出)#include <set> // 集合(有序不重复)#include <map> // 键值对容器(映射)#include <list> // 双向链表#include <math.h> // 数学函数#include <functional> // 通用的函数绑定和调用机制#define endl '\n'#define pii pair<int, int>#define pdd pair<double, double>#define fi first#define se second#define pb push_back#define eb emplace_back#define int long longusing namespace std;
#include <iostream> // 基本输入输出流 #include <algorithm> // 通用算法(排序、查找、去重、二分查找等) #include <vector> // 动态数组(空间不够会自动扩容) #include <queue> // 队列(先进先出) #include <stack> // 栈(先进后出) #include <set> // 集合(有序不重复) #include <map> // 键值对容器(映射) #include <list> // 双向链表 #include <math.h> // 数学函数 #include <functional> // 通用的函数绑定和调用机制 #define endl '\n' #define pii pair<int, int> #define pdd pair<double, double> #define fi first #define se second #define pb push_back #define eb emplace_back #define int long long using namespace std; const int inf = 1e9 + 7; const int mod = 998244353; const int N = 2e5 + 10, M = N << 1; void qwer(string s) { for(int i=1; i<s.size(); i++) { if(s[i]=='A'&&s[i-1]=='W') { s[i]='C'; s[i-1]='A'; break; } } bool ok=true; for(int i=1; i<s.size(); i++) { if(s[i]=='A'&&s[i-1]=='W') { ok=false; } } if(ok==true) { cout<<s<<endl; return; } qwer(s); } void solve() { string s; cin >> s; qwer(s); } signed main() { //重定向输入输出 // freopen("pow.in", "r", stdin); // freopen("pow.out", "w", stdout); ios::sync_with_stdio(0); cin.tie(0); cout.tie(0); int _ = 1; // cin >> _; // 非多组测试数据请注释该行 while(_--) solve(); return 0; } //WWA
Submission Info
Submission Time | |
---|---|
Task | C - Debug |
User | Digital_Enigma |
Language | C++ 20 (gcc 12.2) |
Score | 0 |
Code Size | 1486 Byte |
Status | TLE |
Exec Time | 2304 ms |
Memory | 1785452 KB |
Compile Error
Main.cpp: In function ‘void qwer(std::string)’: Main.cpp:27:23: warning: comparison of integer expressions of different signedness: ‘long long int’ and ‘std::__cxx11::basic_string<char>::size_type’ {aka ‘long unsigned int’} [-Wsign-compare] 27 | for(int i=1; i<s.size(); i++) { | ~^~~~~~~~~ Main.cpp:35:23: warning: comparison of integer expressions of different signedness: ‘long long int’ and ‘std::__cxx11::basic_string<char>::size_type’ {aka ‘long unsigned int’} [-Wsign-compare] 35 | for(int i=1; i<s.size(); i++) { | ~^~~~~~~~~
Judge Result
Set Name | Sample | All | ||||||
---|---|---|---|---|---|---|---|---|
Score / Max Score | 0 / 0 | 0 / 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 | 3412 KB |
example_01.txt | AC | 1 ms | 3484 KB |
example_02.txt | AC | 1 ms | 3512 KB |
hand_00.txt | TLE | 2279 ms | 1337852 KB |
hand_01.txt | AC | 2 ms | 3892 KB |
hand_02.txt | TLE | 2289 ms | 1537604 KB |
hand_03.txt | AC | 2 ms | 3836 KB |
hand_04.txt | AC | 1 ms | 3516 KB |
hand_05.txt | AC | 1 ms | 3532 KB |
hand_06.txt | TLE | 2297 ms | 1703496 KB |
random_00.txt | TLE | 2266 ms | 1123752 KB |
random_01.txt | TLE | 2267 ms | 1134416 KB |
random_02.txt | TLE | 2301 ms | 1775052 KB |
random_03.txt | TLE | 2303 ms | 1761348 KB |
random_04.txt | TLE | 2300 ms | 1762920 KB |
random_05.txt | TLE | 2300 ms | 1771432 KB |
random_06.txt | TLE | 2302 ms | 1781896 KB |
random_07.txt | TLE | 2301 ms | 1785360 KB |
random_08.txt | TLE | 2298 ms | 1729980 KB |
random_09.txt | TLE | 2294 ms | 1649868 KB |
random_10.txt | TLE | 2297 ms | 1703244 KB |
random_11.txt | TLE | 2294 ms | 1640584 KB |
random_12.txt | TLE | 2304 ms | 1783312 KB |
random_13.txt | TLE | 2298 ms | 1669416 KB |
random_14.txt | TLE | 2292 ms | 1546280 KB |
random_15.txt | TLE | 2292 ms | 1606128 KB |
random_16.txt | TLE | 2292 ms | 1613912 KB |
random_17.txt | TLE | 2284 ms | 1450800 KB |
random_18.txt | TLE | 2301 ms | 1785452 KB |
random_19.txt | TLE | 2296 ms | 1699652 KB |