摘要: set的比较函数必须写成仿函数(class、struct、lambda) 而不能写成函数 且operator()的参数和函数都需要用const修饰 举例: struct cmp { bool operator()(const pair<int, string>& p1,const pair<int, 阅读全文
posted @ 2022-07-24 10:53 80k 阅读(251) 评论(0) 推荐(0)
摘要: 一个序列是括号序列的条件是:在所有位置,前面(含当前位置)的左括号的数量大于等于右括号的数量,且最终相等。 例题: https://codeforces.com/contest/1709/problem/C #include<bits/stdc++.h> using namespace std; t 阅读全文
posted @ 2022-07-24 10:02 80k 阅读(47) 评论(0) 推荐(0)