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日记——草地排水 codevs 1993

    1993 草地排水 USACO  时间限制: 2 s  空间限制: 256000 KB  题目等级 : 钻石 Diamond 题解       题目描述 Description 在农夫约翰的农场上,每 ...

  2. slf4j 搭配 log4j2 处理日志

    目录 关于 log4j 关于 slf4j 案例使用 关于 log4j Log4j + Slf4j 的使用组合最为常见,但是我们知道 Log4j 目前已经停止更新了.Apache推出了新的 Log4j2 ...

  3. Android 集成支付宝支付详解

    一说到支付宝,相信没有人不知道,生活中付款,转账都会用到. 今天来详细介绍下在Android中如何集成支付宝支付到自己的APP中去.让APP能够拥有方便,快捷的支付功能. 准备工作: 商户在b.ali ...

  4. [Javascript] Replicate JavaScript Constructor Inheritance with Simple Objects (OLOO)

    Do you get lost when working with functions and the new keyword? Prototypal inheritance can be compl ...

  5. Solidworks 不能生成实体,因为这将导致厚度为零的零件怎么办

    如下图所示,我认为我长出一块东西根本不会对其他零件有什么影响.   去掉合并结果之后就好了.   钣金要比方钢高出1mm,这样焊接上去才方便.              

  6. iOS开发之UITabBarController和UICollectionView的使用

    这一篇要记录的是iOS开发中UITabBarController控件和UICollectionView控件的使用.APP跑起来之后的效果例如以下图: watermark/2/text/aHR0cDov ...

  7. a#x#i#o#s封装

    封装的js文件如下: /* 用于修改 axios 的一些公用配置,具体参看文档 */import axios from 'axios'import store from '@/store/index. ...

  8. 【转载】C#扫盲之:==/Equals /ReferenceEquals 异同的总结,相等性你真的知道吗?

    1.前言 == Equals ReferenceEquals 三个相等性测试,是.NET提供给程序员使用的三个方法,他们之间有什么联系和区别,你真的仔细研究过?虽然之前也多多少少知道一点,但是有时候又 ...

  9. Ubuntu 16.04 LTS安装Eclipse配置Pydev

    原材料: 下载 jdk-8u121-linux-x64.tar.gz 下载 eclipse-jee-neon-2-linux-gtk-x86_64.tar.gz 1.安装jdk sudo mkdir ...

  10. javascript return 跟 break区别

    break是跳出当前循环,return是中止函数的执行