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. CodeForces 534D Program B

    Description On February, 30th n students came in the Center for Training Olympiad Programmers (CTOP) ...

  2. 从协议VersionedProtocol开始1

    Phase 0: Make a plan You must first decide what steps you're going to have in your process. It sound ...

  3. 踏着前人的脚印学Hadoop——结构、重点

    HDFS作为一个分布式文件系统,是所有这些项目的基础.分析好HDFS,有利于了解其他系统.由于Hadoop的HDFS和MapReduce是同一个项目,我们就把他们放在一块,进行分析. 如果把整个had ...

  4. Cisco IOS Debug Command Reference Command E through H

    debug eap through debug he-module subslot periodic debug eap : to display information about Extensib ...

  5. 安装eclipse for c/c++环境

    安装eclipse for c/c++环境:       1.启动eclipse,       2.选择Help->Install New Software...,在Work with的框框下复 ...

  6. zookeeper启动失败无法查看status-----用户权限

    最近一直在调试zookeeper,总是出现莫名其妙的问题 QuorumPeerMain 进程存在,但是无法查看status, JMX enabled by defaultUsing config: / ...

  7. uitabbarcontroller中 在设置tab bar item的image属性后不显示问题

    开始使用ios中的UITabBarController,在给Tab Bar Item设置自定义图片的时候,遇到了问题 按照如下配置: 出来的结果确是: 实际上test24.png应该是: 纠结了很久, ...

  8. Mysql 基本操作连接数据库读取信息内容

    <?php header("content-type:text/html; charset=utf-8"); // 数据库配置信息 define("DB_HOST& ...

  9. Android res/raw vs assets

    common: 1.两者目录下的文件在打包后会原封不动的保存在apk包中,不会被编译成二进制. difference: 1.res/raw中的文件会被映射到R.java文件中,访问的时候直接使用资源I ...

  10. php生成图片注释

    //生成验证码图片注释 <?php session_start(); $arr = array( 'a','b','c','d','e','f','g','h','i','j','k','l', ...