随笔分类 - 基础算法 -- 模拟
摘要:题目传送门:https://codeforces.com/problemset/problem/5/C 题目大意: 给定一串括号序列,求最长合法括号序列的长度及出现次数 考虑将 '(' 变成 1,将 ')' 变成 -1,故合法括号序列的累加和必然为0 考虑求其前缀和,由于括号序列是一一匹配的,故我们
阅读全文
摘要:Description Farmer John is trying to figure out when his last shipment of feed arrived. Starting with an empty grain bin, he ordered and received F1 (
阅读全文