kingqiao

导航

2023年7月14日 #

SMU Summer 2023 Contest Round 3

摘要: [A. Curriculum Vitae](http://https://codeforces.com/group/L9GOcnr1dm/contest/450890/problem/A "A. Curriculum Vitae") 题意:给出一串01序列,可以删除任意个元素,使得1后面没有0 思路 阅读全文

posted @ 2023-07-14 18:22 kingqiao 阅读(17) 评论(0) 推荐(0) 编辑

SMU Summer 2023 Contest Round 2

摘要: [A. Treasure Hunt](http://https://codeforces.com/group/L9GOcnr1dm/contest/450889/problem/A "A. Treasure Hunt") 题意:给出船的出发位置和目的地,给出四种移动方式。 思路:路程要被整除。横移纵 阅读全文

posted @ 2023-07-14 15:38 kingqiao 阅读(18) 评论(0) 推荐(0) 编辑

SMU Summer 2023 Contest Round 1

摘要: [A. The Contest](http://https://codeforces.com/group/L9GOcnr1dm/contest/450888/problem/A "A. The Contest") 题意:要做n道题,每道题花费时间a[i],但是只有几个时间段可以提交,问最早什么时间可 阅读全文

posted @ 2023-07-14 15:07 kingqiao 阅读(9) 评论(0) 推荐(0) 编辑

2023年7月13日 #

codeforces-817 D. Imbalanced Array(单调栈)

摘要: ![image](https://img2023.cnblogs.com/blog/3070624/202307/3070624-20230712121051112-1667145400.png) 题意:求数组中每个连续子序列的的最大值-最小值之和。 思路:题意可以理解为加上每一个序列的最大值,减去 阅读全文

posted @ 2023-07-13 11:35 kingqiao 阅读(20) 评论(0) 推荐(1) 编辑

2023年6月28日 #

[CQOI2009]中位数图(前缀和)

摘要: 点击查看代码 ``` #include using namespace std; const int N = 1e5+10; int a[N]; map mp; int main(){ ios::sync_with_stdio(0),cin.tie(0),cout.tie(0); int n,b,p 阅读全文

posted @ 2023-06-28 13:38 kingqiao 阅读(2) 评论(0) 推荐(0) 编辑

2023年6月26日 #

NC235745 拆路 (并查集)

摘要: https://ac.nowcoder.com/acm/problem/235745 点击查看代码 ``` #include using namespace std; const int N = 1e5 + 10; int fa[N],cnt[N],st[N],en[N],a[N],b[N],ans 阅读全文

posted @ 2023-06-26 16:56 kingqiao 阅读(21) 评论(0) 推荐(0) 编辑

2023年6月14日 #

Codeforces Round 855 (Div. 3)

摘要: `https://codeforces.com/contest/1800` **E. Unforgivable Curse** 题意:输入两个字符串s,t , 每次修改可以交换相距k或k+1位置的字母,能否将将s修改为t。 方法:首先,两个字符串必须由相同元素,且每种元素的个数相等。其次,元素可以先 阅读全文

posted @ 2023-06-14 14:16 kingqiao 阅读(10) 评论(0) 推荐(0) 编辑

2023年6月7日 #

HDU - 2473 (并查集+设立虚父节点(马甲))

摘要: ![](https://img2023.cnblogs.com/blog/3070624/202306/3070624-20230607204313626-27703033.png) 涉及到并查集的删除操作,比较复杂,可以利用虚设父节点的方法: 例如 : 有n个节点,进行m次操作.首先将0 ~ n- 阅读全文

posted @ 2023-06-07 22:08 kingqiao 阅读(22) 评论(0) 推荐(0) 编辑