Problems
文章平均质量分 77
inrence
这个作者很懒,什么都没留下…
展开
-
Matrix Power Series
DescriptionTime Limit: 3000MS Memory Limit: 131072K Given a n∗nn*n matrix AA and a positive integer kk, find the sum S=A+A2+A3+…+AkS = A + A^2 + A^3 + … + A^k.InputThe input contains exactly one tes原创 2016-06-27 16:41:33 · 353 阅读 · 0 评论 -
Goods transportation
DescriptionThere are n n cities located along the one-way road. Cities are numbered from 1 1 to n n in the direction of the road.The i i-th city had produced p i p_i units of goods. No more than s i原创 2016-10-21 21:48:21 · 407 阅读 · 0 评论 -
Donut Decoration
Solution & Code题意是用 1...K1...K 共 KK 种颜色对一行共 NN 个点染色,现给你染色的操作序列(按时间先后给定),每次操作对 [l,r][l, r] 区间的所有点染上一种颜色 xx,求所有操作完成后,共有多少个点合法(恰按序被染上 1...K1...K 这些颜色)。 这道题用带标记的线段树处理,对每个线段树节点记录三个标记:当前染色上界(lazy1)、当前染色下界(l原创 2016-07-09 13:19:21 · 325 阅读 · 1 评论 -
Balanced Number
DescriptionA balanced number is a non-negative integer that can be balanced if a pivot is placed at some digit. More specifically, imagine each digit as a box with weight indicated by the digit. When a原创 2016-06-23 11:39:27 · 838 阅读 · 0 评论 -
不知道名字的某题_20160622_2
Description已知规模为n∗nn*n的矩阵MM,处理TT次询问,对于每次询问给定矩阵VV,求Mk∗VM^k*VSolution传统做法用矩阵快速幂求出MkM^k,时间复杂度为O(T∗n3∗logk)O(T*n^3*logk)预处理对于询问次数较多的情况,快速幂的做法是较劣的,此时我们可以预先算出M0,M1,M2,...,M2iM^0, M^1, M^2, ..., M^{2^i} 答案矩阵原创 2016-06-22 23:28:06 · 292 阅读 · 0 评论 -
Fygon
DescriptionFrederick is a young programmer. He participates in all programming contests he can find and always uses his favorite programming language Fygon. Unfortunately, he often receives Time Limit原创 2016-07-07 10:38:18 · 362 阅读 · 0 评论 -
Pear Trees
http://acm.hust.edu.cn/vjudge/problem/viewProblem.action?id=45173 Time Limit: 1000MS Memory Limit: 65536KB 64bit IO Format: %I64d & %I64uDescriptionVova was walking along one of Shenzhen st原创 2016-07-05 18:09:30 · 620 阅读 · 0 评论 -
Longest Chain
DescriptionTime Limit : 8 sec, Memory Limit : 262144 KB Let us compare two triples a=(xa,ya,za)a = (x_a, y_a, z_a) and b=(xb,yb,zb)b = (x_b, y_b, z_b) by a partial order ∠∠ defined as follows. a∠b⇔原创 2016-07-02 21:24:56 · 634 阅读 · 0 评论 -
Hourai Jeweled
HDU - 4303 Hourai Jeweled Time Limit: 2000MS Memory Limit: 163840KB 64bit IO Format: %I64d & %I64u DescriptionKaguya Houraisan was once a princess of the Lunarians, a race of people living on the原创 2016-06-30 08:25:34 · 348 阅读 · 0 评论 -
不知道名字的某题_20160622_1
Description给定序列 a1,...,ana_1, ..., a_n,求序列 b1,...,bnb_1, ..., b_n 满足 bi=Σajb_i = \Sigma a_j 其中 j & i = j\text{j & i = j} 1≤n≤201 \le n \le 20SolutionFWTvoid ftw(int left, int rght){ int mid = (le原创 2016-06-22 13:13:58 · 221 阅读 · 0 评论