牛客小白月赛87

文章描述了一个编程挑战,涉及在C++代码中处理括号删除操作,解决输入字符串中I标识的括号对的问题。作者给出了一个解决方法,用于处理delete操作和保持括号平衡。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

C-小苯的IDE括号问题(easy)_牛客小白月赛87 (nowcoder.com) 


#include <iostream>
#include <algorithm>
#include <cstring>

#define x first
#define y second
using namespace std;
using LL = long long;

typedef pair<int, int> PII;

const int N = 200010;

int n, m;
char s[N];
void solve()
{
	int id = 0;
	cin >> n >> m;
	cin >> s + 1;
	for (int i = 1; i <= n; i++)
		if (s[i] == 'I')
		{
			id = i; break;
		}
	int l = id - 1, r = id + 1;
	string op;
	while (m--)
	{
		cin >> op;
		if (op == "delete")
		{
			if (r <= n )
			{
				s[r] = 0;
				r++;
			}
		}
		else
		{
            if (l == 0) continue;
			if (r <= n && s[l] == '(' && s[r] == ')')
			{
				s[l] = 0, s[r] = 0;
				l--; r++;
			}
			else
			{
					s[l] = 0;
					l--;
			}
		}
	}
	for (int i = 1; i <= n; i++)
		if (s[i] != 0) cout << s[i];
}

int main()
{
	ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);
	int _ = 1;
	while (_--) solve();
	return 0;
}

国外网友基于faketime做的burp loader的unlimited版本. 需要一堆dll或者so. 详情见如下描述,没有分的可以去github上找. ======================== BurpUnlimited version 1.7.26 release 1.0 + Created by: mxcx@fosec.vn + Email: mxcxvn@gmail.com + Based on: BurpLoader by larry_lau + Github: https://github.com/mxcxvn/BurpUnlimited it's opensource ======================== This project is NOT intended to replace BurpLoader. It just EXTENDS BurpLoader's license! To run the project from the command line: java -javaagent:BurpUnlimited.jar -agentpath:lib/libfaketime -jar BurpUnlimited.jar or double click on BurpUnlimited.jar (set permision before) ## Notes: - There are some requirements files in lib at current folder: + burpsuite_pro_v1.7.26.jar is main object + libfaketime* Lib for hook time activation. Sourcecode is at https://github.com/faketime-java/faketime - For windows, vcredist is required: https://www.microsoft.com/en-gb/download/details.aspx?id=48145 - The folder for_windows_if_you_dont_wanna_install_vcredist is for anyone who don't wana install vcredist, please chose the file for x64 or x86, rename to vcruntime140.dll and copy to BurpUnlimited.jar's folder - To have no unexpected error, please leave all file in the folders which have not any space character (including java binary file in case not run with default java). - This version is tested run stable on MACOSX 64 bit, Ubuntu 64 bit, Windows 64 and 32 bit. If you have any error in starting, please try some ways: + Change manually your datetime to before 01/10/2017 + Build your own libfaketime, sourcecode is at https://github.com/faketime-java/faketime + Or contact me mxcxvn@gmail.com ## Hash MD5 version release 1 BurpUnlimited.jar 5cf68ad0cc2d4ee265d0da1469decf21 lib/ burpsuite_pro_v1.7.26.jar 5d1cbbebc7fb59a399ae7bcacbe05f74 libfaketime32.dll e3842711a065b672dec322c4140b950f libfaketime32.jnilib d2b62d06a972035149bfdefe1605c041 libfaketime32.so 5c2baa272037207533d74faa4291e91d libfaketime64.dll 6659efeee9698609a9ffd9ea8c9d07d1 libfaketime64.jnilib ff3dbde6a28f1c59d829cf5665c8e628 libfaketime64.so 5c2baa272037207533d74faa4291e91d for_windows_if_you_dont_wanna_install_vcredist/ vcruntime140_x32.dll b77eeaeaf5f8493189b89852f3a7a712 vcruntime140_x64.dll 6c2c88ff1b3da84b44d23a253a06c01b
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值