Difference between revisions of "2019 Multi-University,HDU Day 5"
Jump to navigation
Jump to search
Xiejiadong (talk | contribs) |
Xiejiadong (talk | contribs) |
||
Line 13: | Line 13: | ||
== Problem D == | == Problem D == | ||
− | Solved by Xiejiadong. 01:33:31 (+1) | + | Solved by Xiejiadong && Kilo_5723. 01:33:31 (+1) |
+ | |||
+ | 题意:求方程 $\sum_{i=1}^n |a_ix-b_i|=C$ 的所有解。 | ||
+ | |||
+ | 题解:显然,这是一个分段函数,分段函数的断点,显然就是所有的 $\frac{-b_i}{a_i}$ 。 | ||
+ | |||
+ | 从前往后枚举 $n+1$ 个区间,每次向后移动一个区间,都只有一项的符号变化会对系数和常数的变化产生影响,保留修改,求解答案看是否在当前定义域内就行了。 | ||
+ | |||
+ | 要注意特判区间重合的情况。 | ||
== Problem E == | == Problem E == |
Revision as of 11:03, 5 August 2019
Problem A
Unsolved.
Problem B
Unsolved. (-9)
Problem C
Unsolved.
Problem D
Solved by Xiejiadong && Kilo_5723. 01:33:31 (+1)
题意:求方程 $\sum_{i=1}^n |a_ix-b_i|=C$ 的所有解。
题解:显然,这是一个分段函数,分段函数的断点,显然就是所有的 $\frac{-b_i}{a_i}$ 。
从前往后枚举 $n+1$ 个区间,每次向后移动一个区间,都只有一项的符号变化会对系数和常数的变化产生影响,保留修改,求解答案看是否在当前定义域内就行了。
要注意特判区间重合的情况。
Problem E
Solved by Weaver_zhu. 00:57:42 (+)
Problem F
Solved by Xiejiadong. 00:26:00 (+)
题意:给一个字符串,求暴力做 $lcp$ 的时候的比较次数。
题意:大概看一下就能发现了:
- 如果 $lcp$ 是短串的全部,比较次数就是短串长度;
- 否则,比较次数就是 $lcp +1$ ;
于是,问题就变成求所有后缀和全串的 $lcp$ ,抄个 exkmp 就过了。
Problem G
Solved by Kilo_5723. 00:51:52 (+)
Problem H
Solved by Kilo_5723. 03:04:27 (+5)
Problem I
Unsolved.
Problem J
Unsolved.