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的更多相关文章

  1. codeforces 820 D. Mister B and PR Shifts(思维)

    题目链接:http://codeforces.com/contest/820/problem/D 题意:求.有一种操作 k = 0: shift p1, p2, ... pn, k = 1: shif ...

  2. codeforces 820 C. Mister B and Boring Game(找规律)

    题目链接:http://codeforces.com/contest/820/problem/C 题解:显然a<=b的规律很好找只要 例如a=2,b=5,只要这样排列就行abbbbbbabbbb ...

  3. 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 ...

  4. Codeforces Round #820 (Div. 3) A-G

    比赛链接 A 题解 知识点:模拟 时间复杂度 \(O(1)\) 空间复杂度 \(O(1)\) 代码 #include <bits/stdc++.h> #define ll long lon ...

  5. Codeforces Round #491 (Div. 2)

    Codeforces Round #491 (Div. 2) https://codeforces.com/contest/991 A #include<bits/stdc++.h> us ...

  6. 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 ...

  7. 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 ...

  8. codeforces 820A. Mister B and Book Reading 解题报告

    题目链接:http://codeforces.com/problemset/problem/820/A 坑爹题目,坑爹题目,坑爹题目....汗 = =!  后台还110个 test 有个地方需要注意下 ...

  9. 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 ...

随机推荐

  1. Extjs — Grid数据导出成Excel

    最近因为项目问题,需要解决Extjs导出成Excel的问题. 下面简单描述这个问题解决的步骤如下: 1.先在js文件里写了一个button的handler事件,通过点击按钮,来实现调用ExportEx ...

  2. java集合讲解干货集

    文章都来自网络,收集后便于查阅. 1.Java 集合系列01之 总体框架 2.Java 集合系列02之 Collection架构 3.Java 集合系列03之 ArrayList详细介绍(源码解析)和 ...

  3. JVM 什么时候会full gc

    除直接调用System.gc外,触发Full GC执行的情况有如下四种.1. 旧生代空间不足旧生代空间只有在新生代对象转入及创建为大对象.大数组时才会出现不足的现象,当执行Full GC后空间仍然不足 ...

  4. pkg-config设置

    pkg-config在一些源码管理中会被使用到. 介绍 上网查资料,知道了pkg-config这个东西,下面简单介绍一下. pkg-config提供了下面几个功能: 检查库的版本号.如果所需要的库的版 ...

  5. oracle数据库如何备份一张表

    --用户名:tms--创建表ts_dictionary的备份create table ts_dictionary_20160715 as select * from ts_dictionary; 补充 ...

  6. nodejs socket.io初探

    1.安装socket.io npm install socket.io 2.创建服务端代码server.js var app = require('http').createServer(handle ...

  7. 常见css兼容问题

    链接的虚线框问题 <!-- html --> <a class="noDashedBox" href="#"><img src=& ...

  8. codeforces 622E E. Ants in Leaves(贪心+dfs)

    题目链接: E. Ants in Leaves time limit per test 2 seconds memory limit per test 256 megabytes input stan ...

  9. CodeForces - 311B:Cats Transport (DP+斜率优化)

    Zxr960115 is owner of a large farm. He feeds m cute cats and employs p feeders. There's a straight r ...

  10. MySQL常用的数据类型及函数_20160920

    1.常用数据类型 针对创建数据表时候 需要指定字段的数据类型,我整理的是工作常用的几种 可以参考看下数据类型 http://www.w3school.com.cn/sql/sql_datatypes. ...