CodeForces - 820
Mister B and Book ReadingCodeForces - 820A
题意:C,V0,V1,A,L。.总共有C页书,第一天以V0速度读,每天加A,但是不能超过V1,并且要从前一天的看到的当前页数的前L页开始读
#include<iostream>
#include<cstdio>
#include<cstring>
using namespace std;
int c,v0,v1,a,l,ans;
int main(){
scanf("%d%d%d%d%d",&c,&v0,&v1,&a,&l);
while(c>){
ans++;
if(ans!=)c+=l;
c-=v0;
v0=min(v0+a,v1);
}
printf("%d",ans);
return ;
}
AC 模拟
Mister B and Angle in Polygon CodeForces - 820B
在正n多边形内选三个点组成一个角,求最靠近t的这个角的大小三个点号码
/*
算出多边形能分出的最小角,得出角度a需要num个角,固定1,2,第三个点为num+2。
细节:1.多边形边数大,计算最小角用double。
2.考虑角小于最小角,角大于最大角。
*/
#include <iostream>
using namespace std;
double n,a;
int main(){
while(cin>>n>>a){
double ss=(double)(-/(double)n)/(n-);
int num=(int)a/ss;
if(!num) num++;
else if((a-ss*num)>(ss*(num+)-a))num++;
if(num+>n)num=n-;
cout<<<<" "<<<<" "<<num+<<endl;
}
}
AC 计算几何
CodeForces - 820的更多相关文章
- codeforces 820 D. Mister B and PR Shifts(思维)
题目链接:http://codeforces.com/contest/820/problem/D 题意:求.有一种操作 k = 0: shift p1, p2, ... pn, k = 1: shif ...
- codeforces 820 C. Mister B and Boring Game(找规律)
题目链接:http://codeforces.com/contest/820/problem/C 题解:显然a<=b的规律很好找只要 例如a=2,b=5,只要这样排列就行abbbbbbabbbb ...
- codeforces round 421 div2 补题 CF 820 A-E
A Mister B and Book Reading O(n)暴力即可 #include<bits/stdc++.h> using namespace std; typedef lon ...
- Codeforces Round #820 (Div. 3) A-G
比赛链接 A 题解 知识点:模拟 时间复杂度 \(O(1)\) 空间复杂度 \(O(1)\) 代码 #include <bits/stdc++.h> #define ll long lon ...
- Codeforces Round #491 (Div. 2)
Codeforces Round #491 (Div. 2) https://codeforces.com/contest/991 A #include<bits/stdc++.h> us ...
- Codeforces Round #412 (rated, Div. 2, base on VK Cup 2017 Round 3) A B C D 水 模拟 二分 贪心
A. Is it rated? time limit per test 2 seconds memory limit per test 256 megabytes input standard inp ...
- Codeforces Round #412 (rated, Div. 2, base on VK Cup 2017 Round 3) D - Dynamic Problem Scoring
地址:http://codeforces.com/contest/807/problem/D 题目: D. Dynamic Problem Scoring time limit per test 2 ...
- codeforces 820A. Mister B and Book Reading 解题报告
题目链接:http://codeforces.com/problemset/problem/820/A 坑爹题目,坑爹题目,坑爹题目....汗 = =! 后台还110个 test 有个地方需要注意下 ...
- Codeforces Round #412 Div. 2 补题 D. Dynamic Problem Scoring
D. Dynamic Problem Scoring time limit per test 2 seconds memory limit per test 256 megabytes input s ...
随机推荐
- python多进程编程常用到的方法
python中的多线程其实并不是真正的多线程,如果想要充分地使用多核CPU资源,在python中大部分情况需要使用多进程.python提供了非常好用的多进程包Multiprocessing,只需要定义 ...
- drawable canvas使用
/** * Drawable 就是一个可画的对象, * 其可能是一张位图(BitmapDrawable), * 也可能是一个图形(ShapeDrawable), * 还有可能是一个图层(LayerDr ...
- 4.2 《锋利的jQuery》jQuery中的动画
问题:queue()方法? tip0: jquery从1.9版本以上就不支持toggle()方法. // $("#panel h5.head").toggle(function() ...
- git删除远程分支【转】
本文转载自:https://my.oschina.net/tsingxu/blog/84601 如果不再需要某个远程分支了,比如搞定了某个特性并把它合并进了远程的 master 分支(或任何其他存放 ...
- SDUT 2766 小明传奇2
小明传奇2 Time Limit: 1000ms Memory limit: 65536K 有疑问?点这里^_^ 题目描述 小明不但创建了自己的商店而且选择了建立了自己的货币系统. 传统地,一个 ...
- Katalon Recorder 自动录制 Selenium 爬虫脚本
相信很多小伙伴都用过 Selenium 来完成爬虫工作,今天就给大家带来一个神器,可以录制你的浏览器动作,然后直接生成 Selenium 脚本,是不是心动了? 1 Selenium 简介 Seleni ...
- P1880 [NOI1995]石子合并[区间dp+四边形不等式优化]
P1880 [NOI1995]石子合并 丢个地址就跑(关于四边形不等式复杂度是n方的证明) 嗯所以这题利用决策的单调性来减少k断点的枚举次数.具体看lyd书.这部分很生疏,但是我还是选择先不管了. # ...
- boost库安装和使用
1. 下载最新的boost库:http://www.boost.org/本文使用的是boost_1_66_0.tar.gz, 2. Boost库安装步骤: > 解压下载文件,例如下载文件在~/D ...
- poj 2420 A Star not a Tree?——模拟退火
题目:http://poj.org/problem?id=2420 精度设成1e-17,做三遍.ans设成double,最后再取整. #include<iostream> #include ...
- 用Spring MVC开发简单的Web应用程序
1 工具与环境 借助Eclipse4.3 + Maven3.0.3构建Java Web应用程序.使用Maven内置的servlet 容器jetty,不需手工集成Web服务器到Eclipse.还帮我们自 ...