为啥MLE
查看原帖
为啥MLE
347898
zhaoyitian楼主2022/3/6 16:52

大佬们帮我看看,为什么第9个点MLE!

#include <bits/stdc++.h>
using namespace std;
int n;

string decompress(char end)
{
	char c;
	string ans = "";
	while ((c = getchar()) != end)
		if (c != '[')
			ans += c;
		else
		{
			int ce;
			scanf("%d", &ce);
			string t = decompress(']');
			for (int i = 1; i <= ce; i++)
				ans += t;
		}
	return ans;
}

int main()
{
	cout << decompress('\n');
}
2022/3/6 16:52
加载中...