随笔分类 -  基础算法 -- 模拟

摘要:题目传送门:https://codeforces.com/problemset/problem/5/C 题目大意: 给定一串括号序列,求最长合法括号序列的长度及出现次数 考虑将 '(' 变成 1,将 ')' 变成 -1,故合法括号序列的累加和必然为0 考虑求其前缀和,由于括号序列是一一匹配的,故我们 阅读全文
posted @ 2021-07-01 15:57 Wolfycz 阅读(33) 评论(0) 推荐(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 ( 阅读全文
posted @ 2018-02-03 23:01 Wolfycz 阅读(238) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示