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. MyEclipse的 at com.genuitec.eclipse.ast.deploy.core.Deployment.<init>错误解决办法

    我们使用myeclipse自动部署web项目时会设置服务器的位置,而部署的相关配置会存储在myeclipse工作目录下的“/.metadata/.plugins/org.eclipse.core.ru ...

  2. include指令和<jsp:include>标准动作

    利用JSP的包含机制,可以有效的避免重复,把可重用的部分独立出去,使用include把它们包含到当前文件.JSP有两种包含机制:include指令和<jsp:include>标准动作. 1 ...

  3. Rhel6-heartbeat配置文档

    系统环境: rhel6 x86_64 iptables and selinux disabled 主机: 192.168.122.119 server19.example.com 192.168.12 ...

  4. Cisco IOS Debug Command Reference I through L

    debug iapp through debug ip ftp debug iapp : to begin debugging of IAPP operations(in privileged EXE ...

  5. C语言之强制类型转换与指针--#define DIR *((volatile unsigned int *) 0x0022)

    强制类型转换形式:(类型说明符) (表达式) 举例说明:1) int a; a = (int)1.9; 2)char *b; int *p; p = (int *) b; //将b的值强制转换为指向整 ...

  6. SharePoint 2010 BCS - 简单实例(一)数据源添加

    博客地址 http://blog.csdn.net/foxdave 本篇基于SharePoint 2010 Foundation. 我的数据库中有一个病人信息表Patient,现在我就想把这个表中的数 ...

  7. c# Winforms WebBrowser - Clear all cookies

    Hello,   I recently search for a method to delete all cookies from the build in .NET WinForms WebBro ...

  8. Dom操作html详细

    <p name='pn'>xxx</p> <p name='pn'>xxx</p> <p name='pn'>xxx</p> & ...

  9. 国内android帮助文档镜像网站---http://wear.techbrood.com/develop/index.html

    http://wear.techbrood.com/develop/index.html

  10. log4j之NDC、MDC

     NDC 介绍 NDC(Nested Diagnostic Context)是 Neil Harrison 在名为<Patterns for Logging Diagnostic Message ...