- 博客(5)
- 收藏
- 关注
原创 1014 Waiting in Line (30分)
这篇博文记录下这题的解题过程,主要留由自己日后总结复习……Input Specification:Each input file contains one test case. Each case starts with a line containing 4 positive integers: N (≤20, number of windows), M (≤10, the maximum...
2020-03-26 10:25:46 209
原创 1007 Maximum Subsequence Sum (25分)
题目Given a sequence of K integers { N1, N2, …, NK }. A continuous subsequence is defined to be { Ni, Ni+1, …, Nj } where 1≤i≤j≤K. The Maximum Subsequence is the continuous subsequenc...
2020-03-22 15:52:38 145
原创 1021 Deepest Root (25分)
做了甲级的这道题,收获很多,特地记录下来留个自己日后总结回顾。题目A graph which is connected and acyclic can be considered a tree. The height of the tree depends on the selected root. Now you are supposed to find the root that resu...
2020-03-22 13:31:19 187
原创 L2-002 链表去重 (25分)
给定一个带整数键值的链表 L,你需要把其中绝对值重复的键值结点删掉。即对每个键值 K,只有第一个绝对值等于 K 的结点被保留。同时,所有被删除的结点须被保存在另一个链表上。例如给定 L 为 21→-15→-15→-7→15,你需要输出去重后的链表 21→-15→-7,还有被删除的链表 -15→15。输入格式:输入在第一行给出 L 的第一个结点的地址和一个正整数 N(≤105,为结点总数)...
2020-02-23 21:15:59 161
原创 L2-022 重排链表 (25分)
给定一个单链表 L1→L2→⋯→Ln−1→Ln,请编写程序将链表重新排列为 Ln→L1→Ln−1→L2→⋯。例如:给定L为1→2→3→4→5→6,则输出应该为6→1→5→2→4→3。输入格式:每个输入包含1个测试用例。每个测试用例第1行给出第1个结点的地址和结点总个数,即正整数N (≤105)。结点的地址是5位非负整数,NULL地址用−1表...
2020-02-23 20:59:30 288
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人