Codeforces Round #132 (Div. 2)
A. Bicycle Chain
- 统计\(\frac{b_j}{a_i}\)最大值以及个数。
B. Olympic Medal
- \(\frac{m_{out}=\pi (r_1^2-r_2^2)hp_1}{m_{in}=\pi r_2^2hp_2} = \frac{A}{B}\)
- \[r_2^2=\frac{r_1^2}{1+\frac{Ap_2}{Bp_1}}\]
- \(r_1,p_1\)取最大值,\(p_2\)取最小值。
C. Crosses
- 分两种情况讨论:
- 两个矩形形成嵌套,那么假设\(c \le a, d \le b\),如果找到一对\((a,b)\)满足\(ab=s\),那么对应的方案数有\[(n-a+1)(m-b+1)(2(a+1)(b+1)-1)\]\((n-a+1)(m-b+1)\)表示矩形的个数,\(2(a+1)(b+1)-1\)表示矩形ab包含cd以及cd包含ab的方案数。
- 两个矩形构成十字形,满足\(a \lt c, d \lt b\),枚举\(a,b,d\)之后可以求出\(c\),那么方案数有\((n-c+1)(m-b+1)\)。
D. Hot Days
- 每个地区单独考虑。
- 若\(t_i \ge T_i\),无论怎么都赔钱,那么只要租一辆车即可,代价\[cost_i+mx_i\]。
- 若\(t_i \lt T_i\),假设租了\(c\)辆车,代价为\[c\cdot cost_i+(n - c(T_i-t_i)+(T_i-t_i))\cdot x_i\]
- 这是一个关于\(c\)的线性函数,那么最小代价必然在两端。这个式子的前提是\(c\)辆车坐不下所有人的情况,所以加偏移量计算即可。
E. Periodical Numbers
- 考虑计算\((2^k, x]\)范围内满足题意的个数,\(2^{k+1} \gt x\)。
- 记长度为\(i\)构成串小于等于\(x\)的串的个数为\(g[i]\)。
- 设长度为\(l,n\ \%\ l =0\)前缀为\(t\),若\(p=tt\cdots t \le x\),则\(g[l]+=1\),显然如果一个前缀\(w \le t\),构成的串也会小于等于\(x\)。
- 当然,\(w\)不能是一个循环串,否则会重复计数,只要枚举\(l\)的约数\(j\),然后扣掉相应的方案数即可。
Codeforces Round #132 (Div. 2)的更多相关文章
- Hot Days Codeforces Round #132 (Div. 2) D(贪婪)
Description The official capital and the cultural capital of Berland are connected by a single road ...
- Educational Codeforces Round 132 (Rated for Div. 2)
Educational Codeforces Round 132 (Rated for Div. 2) A. Three Doors 简述 题意: 有三扇门(1~3), 其中两扇门后面有对应标号门的钥 ...
- Codeforces Round #366 (Div. 2) ABC
Codeforces Round #366 (Div. 2) A I hate that I love that I hate it水题 #I hate that I love that I hate ...
- Codeforces Round #354 (Div. 2) ABCD
Codeforces Round #354 (Div. 2) Problems # Name A Nicholas and Permutation standard input/out ...
- Codeforces Round #368 (Div. 2)
直达–>Codeforces Round #368 (Div. 2) A Brain’s Photos 给你一个NxM的矩阵,一个字母代表一种颜色,如果有”C”,”M”,”Y”三种中任意一种就输 ...
- cf之路,1,Codeforces Round #345 (Div. 2)
cf之路,1,Codeforces Round #345 (Div. 2) ps:昨天第一次参加cf比赛,比赛之前为了熟悉下cf比赛题目的难度.所以做了round#345连试试水的深浅..... ...
- Codeforces Round #279 (Div. 2) ABCDE
Codeforces Round #279 (Div. 2) 做得我都变绿了! Problems # Name A Team Olympiad standard input/outpu ...
- Codeforces Round #262 (Div. 2) 1003
Codeforces Round #262 (Div. 2) 1003 C. Present time limit per test 2 seconds memory limit per test 2 ...
- Codeforces Round #262 (Div. 2) 1004
Codeforces Round #262 (Div. 2) 1004 D. Little Victor and Set time limit per test 1 second memory lim ...
随机推荐
- SeGue 多控制器跨界面传递数据原理
多控制器跨界面传递数据原理
- BPM与OA,选择好烦恼!
企业在信息化建设的过程中 难免遭遇BPM和OA之争, 难!难!难! 选择BPM吧, 有人觉得你“打肿脸充胖子”: 选择OA嘛, “行业大哥”们已经在BPM的路上越走越远… 其实, OA和BPM从某种意 ...
- CodeForces 534D Program B
Description On February, 30th n students came in the Center for Training Olympiad Programmers (CTOP) ...
- ubuntu 添加源
edit file : /etc/apt/sources.list add: deb http://mirrors.163.com/ubuntu/ intrepid main restricted ...
- 微软发布Windows Phone 8.1 Update 和中文版Cortana“小娜”
Windows Phone 8.1 尚在推送进程中,它的第一个 GDR 更新就发布了.今天微软正式发布 Windows Phone 8.1 Update 和中文版 Cortana ——“小娜”. Wi ...
- Oracle Data Integrator与OWB的集成及迁移
v\:* {behavior:url(#default#VML);} o\:* {behavior:url(#default#VML);} w\:* {behavior:url(#default#VM ...
- hdu4417 划分树+二分
//Accepted 14796 KB 453 ms //划分树 //把查询的次数m打成n,也是醉了一晚上!!! //二分l--r区间第k大的数和h比较 #include <cstdio> ...
- IOS9适配 MARK
最近做了iOS 9的适配,程序出现大量警告也做了些处理,写出来分先给大家. 一.iOS 9适配 问题一: <Error>: CGContextSaveGState: invalid con ...
- ubuntu命令chmod755
使用方式 : 在终端切换到文件目录 输入 chmod775 hello.py 这样就将hello.py变成了可执行文件 当然作为 python文件 还需要再开头加上 #!/usr/bin/env py ...
- BZOJ 3439 Kpm的MC密码
倒着建trie,然后主席树来求子树第k大. #include<iostream> #include<cstdio> #include<cstring> #inclu ...