A题

分析:把多面体和面数一一对应即可

 #include<iostream>
#include<map>
#include<cstring>
#include<cstdio>
using namespace std;
int main()
{
int T;
while(cin>>T){
map<string,int>mp;
mp["Tetrahedron"]=;
mp["Cube"]=;
mp["Octahedron"]=;
mp["Dodecahedron"]=;
mp["Icosahedron"]=;
long long sum=;
for(int i=;i<T;i++){
string s;
cin>>s;
sum+=mp[s];
}
cout<<sum<<endl;
}
return ;
}

B题

分析:分别统计最早的r1和最晚的l2,以及最早的r2和最晚的l1,求二者的最大值即可

 #include<iostream>
#include<cstdio>
#include<algorithm>
#include<cstring>
using namespace std;
const int maxn=+;
const int INF=;
typedef struct
{
long long l,r;
}point;
point p1[maxn],p2[maxn];
bool cmp1(point a,point b){
return a.r<b.r;
}
bool cmp2(point a,point b){
return a.l>b.l;
}
int n,m;
int main()
{
while(cin>>n){
long long minx=INF;
for(int i=;i<n;i++){
scanf("%I64d%I64d",&p1[i].l,&p1[i].r);
}
sort(p1,p1+n,cmp1);
cin>>m;
for(int i=;i<m;i++){
scanf("%I64d%I64d",&p2[i].l,&p2[i].r);
}
sort(p2,p2+m,cmp2);
int i=,j=;
long long ans=;
long long cnt=p2[j].l-p1[i].r;
ans=max(ans,cnt);
sort(p1,p1+n,cmp2);
sort(p2,p2+m,cmp1);
long long h=;
h=max(h,(p1[j].l-p2[i].r));
ans=max(h,ans);
cout<<ans<<endl;
}
return ;
}

C题

分析:若对于m>n,直接就是n天,若n>m,则前m天是必须的,后面相当于去寻找一个最小的x,使1+2+3+......+x>(n-m),所以二分答案即可

 #include "iostream"
#include "cstdio"
#include "cstring"
using namespace std;
long long n,m;
int main()
{
while(cin>>n>>m){
if(m>n){
cout<<n<<endl;
continue;
}
n-=m;
long long l=,r=2e9;
while(l<r){
long long mid=(l+r)>>;
long long ans=(+mid)*mid/;
if(ans>=n) r=mid;
else l=mid+;
}
cout<<m+l<<endl;
}
return ;
}

Codefroces #404 Div2的更多相关文章

  1. Codefroces Round#427 div2

    A. Key races time limit per test 1 second memory limit per test 256 megabytes input standard input o ...

  2. Register-SPWorkflowService 404

    最近需要做一个SharePoint 2013工作流演示环境. 于是在自己的本子上安装了一个虚拟机. 虚拟机操作系统是Windows Server 2012 R2,计划把AD.SQL Server 20 ...

  3. WinServer2008R2 + IIS 7.5 + .NET4.0 经典模式 运行WebAPI程序报404错误的解决方案

    在Windows Server 2008 R2系统下,IIS 7.5 + .NET Framework 4.0的运行环境,以经典模式(Classic Mode)部署一个用.NET 4.0编译的 Web ...

  4. sqoop:Failed to download file from http://hdp01:8080/resources//oracle-jdbc-driver.jar due to HTTP error: HTTP Error 404: Not Found

    环境:ambari2.3,centos7,sqoop1.4.6 问题描述:通过ambari安装了sqoop,又添加了oracle驱动配置,如下: 保存配置后,重启sqoop报错:http://hdp0 ...

  5. thinkphp访问不存在的模块或者方法跳转到404页面

    使用的thinkphp 版本是3.2.0, 在config.php中配置 404地址,即可: 'TMPL_EXCEPTION_FILE' => './Application/Home/View/ ...

  6. 网站设置404页面 --nginx

    有的时候根据域名要先知道用的什么web 服务器 最简单的 http://tool.chinaz.com/pagestatus/  输入域名,看返回的头部信息 用的那个web浏览器 下面的方法也是根据头 ...

  7. HTTP 错误 404.3 – Not Found 由于扩展配置问题而无法提供您请求的页面。如果该页面是脚本,请添加处理程序。如果应下载文件,请添加 MIME 映射。

    今天,在vs2013中新建了一个placard.json文件,当我用jq读取它的时候,去提示404,直接在浏览器访问这个文件,提示: HTTP 错误 404.3 – Not Found 由于扩展配置问 ...

  8. Windows Server 2008 R2 IIS7.5 部署 MVC HTTP 404.0 Not Found 错误

    如图 在Windows Server 2008 R2 IIS7.5 部署 MVC HTTP 404.0 Not Found 错误,在Win7环境下测试正常,在百度中查找相关解决方法,如修改配置文件等, ...

  9. ajax 后台正常执行 错误类型却是404

    后台执行importExcel,明明方法执行成功,但是前台却提示404 @RequestMapping("/import") public Json importExcel(@Re ...

随机推荐

  1. AC日记——接苹果 洛谷 P2690

    题目背景 USACO 题目描述 很少有人知道奶牛爱吃苹果.农夫约翰的农场上有两棵苹果树(编号为1和2), 每一棵树上都长满了苹果.奶牛贝茜无法摘下树上的苹果,所以她只能等待苹果 从树上落下.但是,由于 ...

  2. T3185 队列练习1 codevs

    http://codevs.cn/problem/3185/ 题目描述 Description 给定一个队列(初始为空),只有两种操作入队和出队,现给出这些操作请输出最终的队头元素. 操作解释:1表示 ...

  3. intellij idea springmvc web工程之helloworld

    1.新建java工程 2.设置项目 2.添加jar包 3.配置web.xml <?xml version="1.0" encoding="UTF-8"?& ...

  4. Tomcat服务器解析“GET /JavaWebDemo1/1.jsp HTTP/1.1”

    (2)服务器收到http请求报文,返回http响应报文 Tomcat服务器解析“GET /JavaWebDemo1/1.jsp HTTP/1.1” Tomcat服务器解析“GET /JavaWebDe ...

  5. javascript 在线文本编辑器

    javascript 在线文本编辑器实现代码. 效果例如以下: watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvcGhwZmVuZ2h1bw==/font/5 ...

  6. odoo写邮件添加收件人

    在任何可以写消息的地方点击鼠标     或者回复消息     写消息的框会聚焦并变大             点击撰写框右上角的弹出窗图标     弹出完整的撰写消息窗口     在红色的地方添加收件 ...

  7. Android 特别大的Activity和Fragment的生命周期图

    这么 这么大的图.不做太多解释,哈哈,真的是棒棒的. 代码測试下载:http://download.csdn.net/detail/pcaxb/8906085

  8. Intel Naming Strategy--1

    http://en.wikipedia.org/wiki/Mobile_Internet_device Computer sizes   Classes of computers   Larger S ...

  9. OpenStack源码系列---neutron-server

    在看过了nova模块的源码之后,再去看OpenStack其它模块的源码会轻松很多,因为框架也是大同小异的.自四月份开通博客写了几篇文章后,真心觉得写篇技术文章如果要把前前后后牵扯到的其它技术内容都做介 ...

  10. Android实现RecyclerView的下拉刷新和上拉载入很多其它

    需求 先上效果图, Material Design风格的下拉刷新和上拉载入很多其它. 源代码地址(欢迎star) https://github.com/studychen/SeeNewsV2 假设对于 ...