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

  • 分两种情况讨论:
  1. 两个矩形形成嵌套,那么假设\(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的方案数。
  2. 两个矩形构成十字形,满足\(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)的更多相关文章

  1. Hot Days Codeforces Round #132 (Div. 2) D(贪婪)

    Description The official capital and the cultural capital of Berland are connected by a single road ...

  2. Educational Codeforces Round 132 (Rated for Div. 2)

    Educational Codeforces Round 132 (Rated for Div. 2) A. Three Doors 简述 题意: 有三扇门(1~3), 其中两扇门后面有对应标号门的钥 ...

  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 ...

  4. Codeforces Round #354 (Div. 2) ABCD

    Codeforces Round #354 (Div. 2) Problems     # Name     A Nicholas and Permutation standard input/out ...

  5. Codeforces Round #368 (Div. 2)

    直达–>Codeforces Round #368 (Div. 2) A Brain’s Photos 给你一个NxM的矩阵,一个字母代表一种颜色,如果有”C”,”M”,”Y”三种中任意一种就输 ...

  6. cf之路,1,Codeforces Round #345 (Div. 2)

     cf之路,1,Codeforces Round #345 (Div. 2) ps:昨天第一次参加cf比赛,比赛之前为了熟悉下cf比赛题目的难度.所以做了round#345连试试水的深浅.....   ...

  7. Codeforces Round #279 (Div. 2) ABCDE

    Codeforces Round #279 (Div. 2) 做得我都变绿了! Problems     # Name     A Team Olympiad standard input/outpu ...

  8. 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 ...

  9. 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 ...

随机推荐

  1. 最大子段和-Program A

    最大子段和 Time Limit:1000MS     Memory Limit:32768KB     64bit IO Format:%I64d & %I64u Description G ...

  2. 使用Google API 下拉刷新或者增加数据 SwipeRefreshLayout

    贴出布局代码: <android.support.v4.widget.SwipeRefreshLayout android:id="@+id/id_swipe_ly" and ...

  3. win10系统的点评

    Windows 10 是美国微软公司所研发的新一代跨平台及设备应用的操作系统.在正式版本发布一年内,所有符合条件的Windows7.Windows 8.1的用户都将可以免费升级到Windows 10, ...

  4. git命令学习用

  5. MySQL数据类型(四)

    一.数据类型 二.整型类型 tinyInt: 1个字节:-128-127(有符号) 是否有符号,可以定义时,使用unsign标识,表示无符号的,不写表示有符号的 Create table studen ...

  6. poj1141 区间dp+路径

    //Accepted 176 KB 47 ms //感谢大神们为我们这群渣渣铺平前进的道路!! //用scanf("%s",s)!=EOF WA到死 #include <cs ...

  7. DirectX 总结和DirectX 9.0 学习笔记

    转自:http://www.cnblogs.com/graphics/archive/2009/11/25/1583682.html DirectX 总结 DDS DirectXDraw Surfac ...

  8. Oracle数据库中序列用法讲解

    序列(SEQUENCE)是序列号生成器,可以为表中的行自动生成序列号,产生一组等间隔的数值(类型为数字).其主要的用途是生成表的主键值,可以在插入语句中引用,也可以通过查询检查当前值,或使序列增至下一 ...

  9. (转)深入浅出 iOS 之生命周期

    原文:http://www.cocoachina.com/applenews/devnews/2011/0817/3129.html 深入浅出 iOS 之生命周期 发布于:2011-08-17 10: ...

  10. numpy中的broadcast

    关于broadcast,官方文档描述如下: Each universal function takes array inputs and produces array outputs by perfo ...