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. YTST_CX_0001(ALV栏位汇总)

    *********************************************************************** * Title           : X        ...

  2. oracle ORA-12514: TNS:listener does not currently know of service requested in connect descriptor

    ORA-12514: TNS:listener does not currently know of service requested in connect descriptor 1.看看是不是监听 ...

  3. 程序连接Oracle数据库出现未找到提供程序.该程序可能未正确安装错误提示

    好不容易使用plsql可以成功连上数据库了,应用程序连接数据库却出现了问题 其实解决这个问题也简单: 1.  查看oracle安装目录下的BIN目录,E:\app\Administrator\prod ...

  4. Python爬虫 —— 抓取美女图片

    代码如下: #coding:utf-8 # import datetime import requests import os import sys from lxml import etree im ...

  5. SpringBoot_Exception_01_No plugin found for prefix 'spring-boto' in the current project

    一.异常现象 spingbott项目在eclipse中执行maven命令:spring-boot:run, 出现异常: No plugin found for prefix 'spring-boto' ...

  6. Workerman安装流程

    第一步检测安装环境 curl -Ss http://www.workerman.net/check.php | php 操作结果显示 报错了  需要找到php.ini文件 解决办法如下: 打开 php ...

  7. leetcode 23. Merge k Sorted Lists(堆||分治法)

    Merge k sorted linked lists and return it as one sorted list. 题意:把k个已经排好序的链表整合到一个链表中,并且这个链表是排了序的. 题解 ...

  8. docker基础用法

    docker 架构: docker 安装前期准备: 安装centos7 ,不要在centos6  [root@node01 yum.repos.d]# uname -a Linux node01 -. ...

  9. ACM学习历程—HDU1584 蜘蛛牌(动态规划 && 状态压缩 || 区间DP)

    Description 蜘蛛牌是windows xp操作系统自带的一款纸牌游戏,游戏规则是这样的:只能将牌拖到比她大一的牌上面(A最小,K最大),如果拖动的牌上有按顺序排好的牌时,那么这些牌也跟着一起 ...

  10. AtCoder Grand Contest 004 C:AND Grid

    题目传送门:https://agc004.contest.atcoder.jp/tasks/agc004_c 题目翻译 给你一张网格图,指定的格子是紫色的,要求你构造出两张网格图,其中一张你可以构造一 ...