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 ...
随机推荐
- mysql忘记root密码或报错:ERROR 1044 (42000): Access denied for user ”@’localhost’ to database ‘xx‘
有的时候忘记了root密码或其他用户的密码,登录的时候报错:ERROR 1044 (42000): Access denied for user ”@’localhost’ to database ' ...
- .idea文件夹是干嘛的
question python为什么每次创建的文件目录下都含有.idea/文件夹,该文件夹又是用来干嘛的 answer 当使用pycharm作为IDE时,会自动生成.idea/文件夹来存放项目的配置信 ...
- Java基础教程:面向对象编程[1]
Java基础教程:面向对象编程 内容大纲 Java语言概述 Java语言特点 1.Java为纯面向对象的语言,它能够直接反映现实生活中的对象.总之,Everything is object! 2.平台 ...
- 用户态文件系统fuse学习【转】
本文转载自:https://blog.csdn.net/ty_laurel/article/details/51685193 FUSE概述 FUSE(用户态文件系统)是一个实现在用户空间的文件系统框架 ...
- matlab中的try...catch...end
我们知道,matlab的代码是按行执行的,如果碰到错误行,则程序中断.try..catch可以使得可能出错代码不影响后面代码的继续执行,也可以检查,排查,解决程序的一些错误,增强代码的鲁棒性和可靠性. ...
- excel根据数据源变化的动态图表
http://www.excelhome.net/lesson/article/excel/1798.html 这个链接讲的可以.
- ThreadPoolExecutor线程池进阶使用
一.简介 线程池类为 java.util.concurrent.ThreadPoolExecutor,常用构造方法为: ThreadPoolExecutor(int corePoolSize, int ...
- 疑难杂症:“代理 XP”组件已作为此服务器安全配置的一部分被关闭。系统管理员可以使用 sp_configure 来启用“代理 XP”。
“代理 XP”组件已作为此服务器安全配置的一部分被关闭.系统管理员可以使用 sp_configure 来启用“代理 XP”.有关启用“代理 XP”的详细信息,请参阅 SQL Server 联机丛书中的 ...
- 第十四章-MySQL
1 安装 MySQL常见的版本 GA: 广泛使用的版本 RC: 最接近正式版本 Alpha和Bean: 内测版本和公测版本 有两种安装方式: 安装包和压缩包 1) 安装msi文件 2) 解压zip文件 ...
- linux命令学习笔记(47):iostat命令
Linux系统中的 iostat是I/O statistics(输入/输出统计)的缩写,iostat工具将对系统的磁盘操作活动进行监视. 它的特点是汇报磁盘活动统计情况,同时也会汇报出CPU使用情况. ...