codeforces
文章平均质量分 59
ZhouHouQian
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
codeforces 839 C Journey
C. Journey time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output There are n cities and n - 1 roads in the Seven Kingdoms原创 2017-08-13 13:12:29 · 729 阅读 · 0 评论 -
codeforces 839 B Game of the Rows
B. Game of the Rows time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output Daenerys Targaryen has an army consisting of k gro原创 2017-08-13 12:55:07 · 886 阅读 · 0 评论 -
codeforces 835 C Star sky
先做一个预处理,求出sum[x][y][t],表示矩形(0,0)~(x,y) 在时间t时的所有点的亮度总和,sum[x][y][t] += sum[x-1][y][t] + sum[x][y-1][t] - sum[x-1][y-1][t]。 之后对于每个查询就可以在O(1)时间内求出,ans = sum[rx][ry][t] - sum[rx][ly-1][t] - sum[lx-1][ry][t] + sum[lx-1][ly-1][t]原创 2017-08-01 12:19:44 · 1002 阅读 · 0 评论 -
codeforces 834 C The Meaningless Game
题目:http://codeforces.com/contest/834/problem/C 大致题意: 有n轮比赛,每轮比赛有多个回合,每个回合规定一个自然数k,赢的人分数 * k^2 ,输的人分数 * k 。对于每轮比赛,输入 分数 a和b 判断是否是符合比赛规则的分数。 解法: 对于每轮比赛,如果 a * b == K * K * K ( K = k1 * k2 … km,m个回原创 2017-07-31 14:32:45 · 487 阅读 · 0 评论 -
codeforces 822 C Hacker, pack your bags!
题目:http://codeforces.com/contest/822/problem/C 大致题意: 给出n个区间和cost,以及一个数x,从n个区间取出两个不重合的区间使得他们的区间大小恰好为x, 并使得两个cost和最小 解法: 对于每个区间,一个区间起点之前的区间都与这个区间不重合,用一个数组动态记录这个区间之前的所有区间大小对应的cost最小值,那么就可以求出这个区间和之前区原创 2017-07-03 15:25:29 · 666 阅读 · 0 评论 -
codeforces 822 B Crossword solving
题目:http://codeforces.com/contest/822/problem/B 大致题意: 给出两个字符串,问第一个字符串变成第二个字符串的子串最少需要做多少次replace,并输出replace的位置。 解法: 直接暴力求解,中间记录replace的次数和位置,保留最小值和对于的位置 代码:#include <iostream> using namespace std;原创 2017-07-03 14:31:14 · 868 阅读 · 0 评论 -
codeforces 822 A I'm bored with life
题目:http://codeforces.com/contest/822/problem/A 大致题意: 给两个数求他们阶层的最大公约数。 解法: 显然答案是两个数最小值的阶层,因为其中一个数小于等于12,所以直接求最小值的阶层不会溢出。 代码: #include <iostream> using namespace std; int main(){ int n,m;原创 2017-07-03 14:23:55 · 1394 阅读 · 0 评论 -
codeforces 821 B Okabe and Banana Trees
题目:http://codeforces.com/contest/821/problem/B 大致题意: 给两个正整数m,b,画出一条直线y = -x/m + b,求直线下的一个矩形使得获取的香蕉数最多,每个点(x,y)的香蕉数目为 x+y。 解法: 可推得公式,矩形右上角为(x,y)的香蕉总数为 (x+1) * x / 2 * (y+1) + (y+1) * y /2 * (x+1)原创 2017-06-26 22:22:56 · 522 阅读 · 0 评论
分享