2018牛客网暑期ACM多校训练营(第二场)I- car ( 思维)
2018牛客网暑期ACM多校训练营(第二场)I- car
链接:https://ac.nowcoder.com/acm/contest/140/I来源:牛客网
时间限制:C/C++ 1秒,其他语言2秒
空间限制:C/C++ 131072K,其他语言262144K
64bit IO Format: %lld
题目描述
White Cloud has a square of n*n from (1,1) to (n,n).
White Rabbit wants to know the maximum number of cars that can be put into to ensure that there is a way that allows all cars to perform their entire journey without damage.
(update: all cars should start at the edge of the square and go towards another side, cars which start at the corner can choose either of the two directions)
For example, in a 5*5 square
legal
illegal(These two cars will collide at (4,4))
illegal (One car will go into a damaged grid)
输入描述:
The first line of input contains two integers n and m(n <= 100000,m <= 100000)For the next m lines,each line contains two integers x,y(1 <= x,y <= n), denoting the grid which is damaged by White Cloud.
输出描述:
Print a number,denoting the maximum number of cars White Rabbit can put into.
示例1
输入
[复制](javascript:void(0)
2018牛客网暑期ACM多校训练营(第二场)I- car ( 思维)的更多相关文章
- 2018牛客网暑期ACM多校训练营(第一场)D图同构,J
链接:https://www.nowcoder.com/acm/contest/139/D来源:牛客网 同构图:假设G=(V,E)和G1=(V1,E1)是两个图,如果存在一个双射m:V→V1,使得对所 ...
- 2018 牛客网暑期ACM多校训练营(第一场) E Removal (DP)
Removal 链接:https://ac.nowcoder.com/acm/contest/139/E来源:牛客网 题目描述 Bobo has a sequence of integers s1, ...
- 2018牛客网暑期ACM多校训练营(第十场)A Rikka with Lowbit (树状数组)
链接:https://ac.nowcoder.com/acm/contest/148/A 来源:牛客网 Rikka with Lowbit 时间限制:C/C++ 5秒,其他语言10秒 空间限制:C/C ...
- 2018牛客网暑期ACM多校训练营(第十场)J Rikka with Nickname(二分,字符串)
链接:https://ac.nowcoder.com/acm/contest/148/J?&headNav=acm 来源:牛客网 Rikka with Nickname 时间限制:C/C++ ...
- 2018牛客网暑期ACM多校训练营(第二场)J Farm(树状数组)
题意 n*m的农场有若干种不同种类作物,如果作物接受了不同种类的肥料就会枯萎.现在进行t次施肥,每次对一个矩形区域施某种类的肥料.问最后枯萎的作物是多少. 分析 作者:xseventh链接:https ...
- 2018牛客网暑期ACM多校训练营(第一场)B Symmetric Matrix(思维+数列递推)
题意 给出一个矩阵,矩阵每行的和必须为2,且是一个主对称矩阵.问你大小为n的这样的合法矩阵有多少个. 分析 作者:美食不可负064链接:https://www.nowcoder.com/discuss ...
- 2018牛客网暑期ACM多校训练营(第三场) A - PACM Team - [四维01背包][四约束01背包]
题目链接:https://www.nowcoder.com/acm/contest/141/A 时间限制:C/C++ 1秒,其他语言2秒 空间限制:C/C++ 262144K,其他语言524288K ...
- 2018牛客网暑期ACM多校训练营(第五场) F - take - [数学期望][树状数组]
题目链接:https://www.nowcoder.com/acm/contest/143/F 时间限制:C/C++ 1秒,其他语言2秒 空间限制:C/C++ 262144K,其他语言524288K ...
- 2018牛客网暑期ACM多校训练营(第五场) E - room - [最小费用最大流模板题]
题目链接:https://www.nowcoder.com/acm/contest/143/E 时间限制:C/C++ 1秒,其他语言2秒 空间限制:C/C++ 262144K,其他语言524288K ...
随机推荐
- (1) laravel php artisan list make
php artisan list make Laravel Framework 5.4.36 Usage: command [options] [arguments] Options: -h, --h ...
- C#使用KingAOP实现AOP面向切面编程二
本文继续上篇讲述一下比较复杂点的AOP例子,先新建一个控制台项目,然后同样先在Nuget中搜索安装KingAop到项目中 1.项目结构 2 .定义一个登录实体类User和LoggingAspect切面 ...
- 2017年度好视频,吴恩达、李飞飞、Hinton、OpenAI、NIPS、CVPR、CS231n全都在
我们经常被问:机器翻译迭代了好几轮,专业翻译的饭碗都端不稳了,字幕组到底还能做什么? 对于这个问题,我们自己感受最深,却又来不及解释,就已经边感受边做地冲出去了很远,摸爬滚打了一整年. 其实,现在看来 ...
- python Django基础操作
Django常用命令 创建Django项目 Django-admin startprotect mysite 创建项目以后,以下生成的文件 最外层的file:mysite/ 根目录只是你的项目的容器 ...
- axios 发送post请求
目录 方案一 方案二 方案一 在node中使用axios以post的方式发送一张图片给某个server时: let data = fs.createReadStream(__dirname + '/t ...
- Kafka集群安装及prometheus监控
前提 zookeeper安装参考:https://www.cnblogs.com/JustinLau/p/11372782.html 其他安装参考:https://www.cnblogs.com/lu ...
- 将自定义dockerfile生成的image推送到仓库中
本文为以阿里云的案例方法,其他方法未尝试 1.注册阿里云账号 2.设置密码并通过docker登录 3.创建命名空间 4.创建镜像仓库 创建仓库时,需要选择代码源的仓库储存的方式,这里我用的是gitHu ...
- 日志(log4j2)
日志测试java代码如下: package com.learn.test; import org.apache.logging.log4j.LogManager; import org.apache. ...
- What's new in C# 7.0
1.数字分隔符(Digit Separators ) 数字分隔符使代码更具可读性.在声明变量时,可以将_添加到单独的数字中.编译器只删除_.以下代码片段在C#7中看起来更具可读性: In C# 6 l ...
- ASP.NET Core 入门(4)(IIS 部署前后端站点)
.NET Core发布部署的文章园内有很多了,大家可以自行百度,该篇主要想总结需要注意的地方,列举前后端(比如前段 Vue,后端 WebAPI)在同一台服务器上的主要两种方式. 两种方式: 1. 前后 ...