前缀和
文章平均质量分 75
ryo_218
要努力成为别人的依赖呀!
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
第八届蓝桥杯省赛C++B组 k倍区间
标题: k倍区间给定一个长度为N的数列,A1, A2, ... AN,如果其中一段连续的子序列Ai, Ai+1, ... Aj(i <= j)之和是K的倍数,我们就称这个区间[i, j]是K倍区间。你能求出数列中总共有多少个K倍区间吗?输入-----第一行包含两个整数N和K。(1 <= N, K <= 100000)以下N行每行包含一个整数Ai。(1 &l...原创 2018-03-21 22:20:48 · 1248 阅读 · 0 评论 -
PAT 1046 Shortest Distance (20)
1046 Shortest Distance (20)(20 分)The task is really simple: given N exits on a highway which forms a simple cycle, you are supposed to tell the shortest distance between any pair of exits.Input Sp...原创 2018-08-07 18:00:01 · 139 阅读 · 0 评论 -
PAT 1044 Shopping in Mars (25)
1044 Shopping in Mars (25)(25 分)Shopping in Mars is quite a different experience. The Mars people pay by chained diamonds. Each diamond has a value (in Mars dollars M$). When making the payment, the...原创 2018-09-05 10:54:08 · 182 阅读 · 0 评论
分享