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. struts中拦截器的开发

    1.开发Interceptor类 用户自定义的拦截器一般需要继承AbstractInterceptor类,重写intercept方法 public class UserInterceptor exte ...

  2. [转]理解WSRF之一 使用WS-ResourceProperties (整理自IBM网站)

    理解 WSRF第1部分-使用 WS-ResourceProperties   本 教程是一个由 4 部分组成的系列文章中的第 1 部分,该系列介绍 WSRF(Web Services Resource ...

  3. SharePoint 跨域还原网站一则

    博客地址:http://blog.csdn.net/foxdave 源端:执行PowerShell命令备份网站集 Backup-SPSite http://server_name/sites/site ...

  4. python 接口开发(一)

    cmd中,提示pip版本太低,先升级pip   pip install --upgrade pip (pip,安装和管理python扩展包的工具) cmd下,pip,出现详细信息证明装成功了 pip ...

  5. win8系统 host文件无法修改解决之道

    host文件,路径为:C:\windows\system32\drivers\etc\hosts 方法/步骤: 方法1:用notepad++打开host文件,修改和保存 方法2:(1)首先用管理管权限 ...

  6. rcc

    一.在STM32中,有五个时钟源,为HSI.HSE.LSI.LSE.PLL.   全名: high  speed  external ①HSI是高速内部时钟,RC振荡器,频率为8MHz. ②HSE是高 ...

  7. paramiko堡垒机、线程及锁

    1.使用paramiko实现ssh连接和scp拷贝 开发堡垒机之前,先来学习Python的paramiko模块,该模块机遇SSH用于连接远程服务器并执行相关操作 1.1 SSHClient 用于连接远 ...

  8. error: Apostrophe not preceded by \

    解决方案为:在编译出错提示中找到相关的string.xml文档,在string标签中的字符串含有单引号(')前面,加上反斜杠(\)转义即可.

  9. Python的魔法方法 .

    基本行为和属性 __init__(self[,....])构造函数 . 在实例化对象的时候会自动运行 __del__(self)析构函数 . 在对象被回收机制回收的时候会被调用 __str__(sel ...

  10. webservice发布在外网上的在system.web中加入这个就好使了

    <webServices>         <protocols>            <add name="HttpSoap"/>      ...