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 ...
随机推荐
- 【Leetcode-easy】Remove Duplicates from Sorted Array
题目要求:删除排好序的含有重复元素的数组.返回去除重复后的数组长度,并更新原始数组.不能使用额外空间. 思路:要不额外的使用内存空间,那么只有遍历数组,count保持下一个不重复的数字,遍历过程中如果 ...
- webpack-dev-server原理及要点笔记
webpack-dev-server启动了一个使用express的Http服务器,这个服务器与客户端采用websocket通信协议,当原始文件发生改变,webpack-dev-server会实时编译. ...
- haproxysocket 参数记录
haproxy的一些指标 pxname 组名 svname 服务器名 qcur 当前队列 qmax 最大队列 scur当前会话用户 smax最大会话用户 slim会话限制 stot会话 ...
- 农业公司flash动画模板
农业公司flash动画素材下载模板是一款绿色水果蔬菜种植企业的flash动画模板. 下载:http://www.huiyi8.com/sc/10576.html
- sublime 相关配置和快捷键
1.安装package control 点击sublime的菜单栏 view->show console :现在打开了控制台, 这个控制台有上下两栏, 上面一栏会实时显示sublime执行了什 ...
- IDEAL葵花宝典:java代码开发规范插件 lombok 插件
前言: lombok简介: lombok是暑假来到公司实习的时候发现的一个非常好用的小工具,刚见到的时候就感觉非常惊艳,有一种相见恨晚的感觉,用了一段时间之后感觉的确挺不错,所以特此来推荐一下. 那么 ...
- Go丨语言对MySQL数据库的增、删、改、查操作
1.建立数据库名为: go_test_db 2.建表名为:userinfo 字段: uid int username varchar language varchar created varchar ...
- LNMP安装(一)
前传: 环境介绍: Centos7.2-minimal 下载地址:http://mirrors.163.com/centos/7.2.1511/isos/x86_64/ (网易镜像站) 所需安装包:链 ...
- 小程序写tab和swiper切换结合效果
实现代码如下: wxml页面 <scroll-view scroll-x="true" class="weui-navbar"> <block ...
- codevs2821 天使之城
传送门 2821 天使之城 时间限制: 1 s 空间限制: 128000 KB 题目等级 : 黄金 Gold 题目描述 Description 天使城有一个火车站,每辆火车都从A方向驶入车站 ...