• 2024-09-13P1044 [NOIP2003 普及组] 栈
    include<bits/stdc++.h>usingnamespacestd;definexfirstdefineysecondtypedefpair<int,int>PII;typedeflonglongll;typedefunsignedlonglongull;typedefunsignedintuint;typedefvectorVS;typedefvectorVI;typedefvector<vect
  • 2024-05-22CSP历年复赛题-P1044 [NOIP2003 普及组] 栈
    原题链接:https://www.luogu.com.cn/problem/P1044题意解读:一组数入栈、出栈的方案数,如果了解卡特兰数,此题可以秒杀;如果不了解,也可以通过递归或者递推来解决;最次,可以通过DFS暴搜出方案数,当然对于n个数,一共有n次入栈、n次出栈,一共2n次,每次要么入栈要么出栈,总搜索次数在22n规模,n最
  • 2024-05-15P1044 [NOIP2003 普及组] 栈
    链接:https://www.luogu.com.cn/problem/P1044两种很好的思路:代码:#include<iostream>#include<vector>#include<algorithm>#include<math.h>#include<sstream>#include<string>#include<string.h>#include<iomanip>#incl