![](https://img-blog.csdnimg.cn/20201014180756738.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
codeforces
Marystl
这个作者很懒,什么都没留下…
展开
-
Educational Codeforces Round 49 (Rated for Div. 2) B. Numbers on the Chessboard
Examples input 4 5 1 1 4 4 4 3 3 2 2 4 output 1 8 16 13 4 input 5 4 2 1 4 2 3 3 3 4 output 16 9 7 20 题意:有一个n*n的方格,先给行(i)、列(j)相加为偶数的格子依次填上编号,再给行列相加为奇数的格子填上编号。现要求某行某列的方格中填的数是多少。 ...原创 2018-08-20 15:02:11 · 199 阅读 · 0 评论 -
Codeforces Round #245 (Div. 1) B.Working out
B. Working out Summer is coming! It’s time for Iahub and Iahubina to work out, as they both want to look hot at the beach. The gym where they go is a matrix a with n lines and m columns. Let number a...原创 2018-08-16 22:31:06 · 160 阅读 · 0 评论 -
Codeforces Round #510 (Div. 2) B. Vitamins(暴力)
Examples input 4 5 C 6 B 16 BAC 4 A output 15 input 2 10 AB 15 BA output -1 input 5 10 A 9 BC 11 CA 4 A 5 B output 13 input 6 100 A 355 BCA 150 BC 160 AC 180 B 190 CA output 250 input 2 5 BA ...原创 2018-09-17 20:54:22 · 204 阅读 · 0 评论 -
Codeforces Round #510 (Div. 2) C. Array Product(暴力模拟)
C. Array Product Examples input 5 5 -2 0 1 -3 output 2 3 1 1 2 1 2 4 1 4 5 input 5 5 2 0 4 0 output 1 3 5 2 5 1 1 2 1 2 4 input 2 2 -1 output 2 2 input 4 0 -10 0 0 output 1 1 2 1 2 3 1 3 4 in...原创 2018-09-17 22:13:25 · 191 阅读 · 0 评论 -
Codeforces Round #512 C - Vasya and Golden Ticket
Examples input 5 73452 output YES input 4 1248 output NO 水题= = 算一下前缀和,根据总和sum[n],从2->n枚举一下可以分成几段。 假设分成k段,则遍历一下前缀和数组,若有k个sum[i]满足sum[i]%(sum[n]/k)==0,则改分割方法可行。 还有就是要特判一下字符0的情况。 #include<iostr...原创 2018-10-01 22:16:58 · 247 阅读 · 0 评论 -
Lyft Level 5 Challenge 2018 - Final Round (Open Div. 2) B. Taxi drivers and Lyft
题意:根据就近原则为taxi分配乘客(且乘客与两辆taxi距离相同时,选择坐标位置小的taxi。最后计算每辆taxi需要搭载的乘客总数。 分析:按坐标位置从小到大遍历即可求出:每位乘客左边 (pos(taxi)< pos(people)) 距离最近的taxi的编号。 同样地按坐标位置从大到小遍历即可求出:每位乘客右边距离最近的taxi的编号。 代码 #include<bits/stdc...原创 2018-11-05 21:31:15 · 476 阅读 · 0 评论