The Highest Mark 问题描述 2045年的SD省队选拔,赛制和三十年前已是完全不同.一场比赛的比赛时间有 tt 分钟,有 nn 道题目. 第 ii 道题目的初始分值为 A_i(A_i \leq 10^{6})A​i​​(A​i​​≤10​6​​) 分,之后每过一分钟这道题目的分值会减少 B_iB​i​​ 分,并且保证到比赛结束时分值不会减少为负值.比如,一个人在第 xx 分钟结束时做出了第 ii 道题目,那么他/她可以得到 A_i - B_i * xA​i​​−B​i​​∗x 分.…
Reorder the Books 问题描述 dxy家收藏了一套书,这套书叫<SDOI故事集>,<SDOI故事集>有n(n\leq 19)n(n≤19)本,每本书有一个编号,从11号到nn号. dxy把这些书按编号从小到大,从上往下摞成一摞.dxy对这套书极其重视,不允许任何人动这套书. 有一天Evensgn到dxy家玩,dxy因为和妹子有约会,就让Evensgn自己待在他家.Evensgn对这套书非常好奇,偷偷的看了一下,结果发现这里面竟然有当年小E和小Q的故事.Evensgn看…
Lie   问题描述 一个年级总共有N个学生,每个人属于唯一一个班级.现在他们站在一排,同班同学并不一定会站在一起,但每个人都会说一句话:“站在我左边的有Ai个同班同学,右边有Bi个同班同学”.然而并不是每个人都会说真话,老师也忘了他们说话的顺序,现在老师想知道最多有多少人的话同时不矛盾. 输入描述 输入有多组数据,不超过100组. 每组数据第一行包含一个整数N.(1\leq N\leq 1000 )(1≤N≤1000) 随后N行,每行包含两个数字Ai和Bi.(0\leq Ai,Bi\leq 1…
The Highest Mark Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 131072/131072 K (Java/Others)Total Submission(s): 630    Accepted Submission(s): 260 Problem Description The SDOI in 2045 is far from what it was been 30 years ago. Each competi…
Rikka with Phi  Accepts: 5  Submissions: 66  Time Limit: 16000/8000 MS (Java/Others)  Memory Limit: 131072/131072 K (Java/Others) Problem Description Rikka and Yuta are interested in Phi function (which is known as Euler's totient function). Yuta giv…
Baby Ming and Weight lifting Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 681    Accepted Submission(s): 280 Problem Description Baby Ming is fond of weight lifting. He has a barbell pole(the…
tree Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 863    Accepted Submission(s): 409 Problem Description There is a tree(the tree is a connected graph which contains n points and n−1 edges),t…
HDOJ5054 Alice and Bob Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 302    Accepted Submission(s): 229 Problem Description Bob and Alice got separated in the Square, they agreed that if they…
LCP Array  Accepts: 131  Submissions: 1352  Time Limit: 4000/2000 MS (Java/Others)  Memory Limit: 131072/131072 K (Java/Others) 问题描述 Peter有一个字符串s=s_{1}s_{2}...s_{n}s=s​1​​s​2​​...s​n​​, 令\text{suff}_i =s_{i}s_{i+1}...s_{n}suff​i​​=s​i​​s​i+1​​...s​n​…
Shortest Path  Accepts: 40  Submissions: 610  Time Limit: 4000/2000 MS (Java/Others)  Memory Limit: 131072/131072 K (Java/Others) 问题描述 有一条长度为nn的链. 节点ii和i+1i+1之间有长度为11的边. 现在又新加了3条边, 每条边长度都是1. 给出mm个询问, 每次询问两点之间的最短路. 输入描述 输入包含多组数据. 第一行有一个整数TT, 表示测试数据的组数…