Experimental Educational Round: VolBIT Formulas Blitz
cf的一次数学场。。。
递推 C
题意:长度<=n的数只含有7或8的个数
分析:每一位都有2种可能,累加不同长度的方案数就是总方案数
组合 G
题意:将5个苹果和3个梨放进n个不同的盒子里的方案数。
分析:经典的组合题目:C(n+5-1, 5) * C(n+3-1, 3)。因为可以同一个盒子放多个苹果或梨,在n基础上多k-1个,看成每个盒子放一个。
组合 H
题意:将5个车放在n*n的棋盘上的方案数。
分析:也是经典的题目,先选行,再全排列,即C (n, 5) * A (n, 5)。
枚举 I
题意:有4种车和2*n-2个停车位,要求必须连续停n辆同种类的车,问将所有车位停满的方案数。
分析:枚举停n辆同种类车的起点,统计就好了。注意,n俩相邻的方案是3,其余是4。
数学 J
题意:问1-n里面能够被2-10全部整除的数有多少个?
分析:lcm(2, ... 10) = 2520。ans = n / lcm。
数学 K
题意:问1-n里面 能够不被[2, 10]里面任意一个数整除的数 有多少个?
分析:J题的变形,经典的容斥题目。容斥原理
import java.io.*;
import java.util.*; public class Main {
public static void main(String[] args) {
new Main ().run ();
}
void run() {
Scanner cin = new Scanner (new BufferedInputStream (System.in));
long n = cin.nextLong ();
long ans = n - n / 2 - n / 3 - n / 5 - n / 7;
ans = ans + n/(2*3) + n/(2*5) + n/(2*7) + n/(3*5) + n/(3*7) + n/(5*7);
ans = ans - n/(2*3*5) - n/(2*3*7) - n/(2*5*7) - n/(3*5*7);
ans = ans + n / (2 * 3 * 5 * 7);
System.out.println (ans);
}
}
数学 P
题意:问你n角形的面积。
分析:角度已知,只要算出蓝线占直线的比例,就能算出面积。

#include <bits/stdc++.h>
const double PI = acos (-1.0);
int main(void) {
int n;
double r;
scanf ("%d%lf", &n, &r);
double a = 2 * PI / n;
double ans = 0.5 * n * r * r * sin (a) * sin (a/4) / (cos (a/2) * sin (PI - a*3/4));
printf ("%.10f\n", ans);
return 0;
}
Experimental Educational Round: VolBIT Formulas Blitz的更多相关文章
- Experimental Educational Round: VolBIT Formulas Blitz K
Description IT City company developing computer games decided to upgrade its way to reward its emplo ...
- Experimental Educational Round: VolBIT Formulas Blitz N
Description The Department of economic development of IT City created a model of city development ti ...
- Experimental Educational Round: VolBIT Formulas Blitz J
Description IT City company developing computer games invented a new way to reward its employees. Af ...
- Experimental Educational Round: VolBIT Formulas Blitz F
Description One company of IT City decided to create a group of innovative developments consisting f ...
- Experimental Educational Round: VolBIT Formulas Blitz D
Description After a probationary period in the game development company of IT City Petya was include ...
- Experimental Educational Round: VolBIT Formulas Blitz C
Description The numbers of all offices in the new building of the Tax Office of IT City will have lu ...
- Experimental Educational Round: VolBIT Formulas Blitz B
Description The city administration of IT City decided to fix up a symbol of scientific and technica ...
- Experimental Educational Round: VolBIT Formulas Blitz A
Description The HR manager was disappointed again. The last applicant failed the interview the same ...
- Experimental Educational Round: VolBIT Formulas Blitz K. Indivisibility —— 容斥原理
题目链接:http://codeforces.com/contest/630/problem/K K. Indivisibility time limit per test 0.5 seconds m ...
随机推荐
- Mybatis 学习笔记1
---恢复内容开始--- 什么是 MyBatis ? MyBatis 是支持定制化 SQL.存储过程以及高级映射的优秀的持久层框架.MyBatis 避免了几乎所有的 JDBC 代码和手动设置参数以及获 ...
- Tomcat部署的时候 unpackWARs="true"
在部署项目到Tomcat的时候发现当Tomcat启动的时候,项目并没有解压出来,导致系统传照片的时候找不到路径,因为,系统没有解压,所以找不到路径, 进入地址==>C:\Users\ceshi\ ...
- iOS - 直播相关文章
直播相关文章 直播RTMP可用于测试的服务器地址 FFmpeg avdumpformat输出的tbn.tbc.tbr.PAR.DAR的含义 FFmpeg 3.0 计算视频时长 HLS Streamin ...
- Android源码-学习随笔
在线代码网站1:http://grepcode.com/project/repository.grepcode.com/java/ext/com.google.android/android/ 书籍: ...
- 重温WCF之构建一个简单的WCF(一)(2)通过Windows Service寄宿服务和WCF中实现操作重载
参考地址:http://www.cnblogs.com/zhili/p/4039111.html 一.如何在Windows Services中寄宿WCF服务 第一步:创建Windows 服务项目,具体 ...
- Delphi中怎么结束线程(这个线程是定时执行的)(方案二)
上篇博客中提出了一个问题:怎么结束一个定时循环执行的线程,并给出了一个解决方案,但是又出现了一个问题,详细去参考上一篇博客. 然后出去撒了个尿,突然脑子里出现了一个想法(看来工作和思考久了,出去走走, ...
- SQL高级查询之一
一,子查询 SELECT e.emp_id, e.fname, e.lname FROM (SELECT emp_id, fname, lname, start_date, title FROM em ...
- poj 1006:Biorhythms(水题,经典题,中国剩余定理)
Biorhythms Time Limit: 1000MS Memory Limit: 10000K Total Submissions: 110991 Accepted: 34541 Des ...
- CentOS下Apache安装SSL
https是一个安全的访问方式,数据在传输过程中是加密的.https基于ssl. 一.安装apache和ssl模块1.安装apacheyum install httpd2.安装ssl模块yum ins ...
- c中malloc的用法
转自:http://blog.sina.com.cn/s/blog_966f8e8501010if7.html Malloc 向系统申请分配指定size个字节的内存空间.返回类型是 void* 类型. ...