hdu 1.3.2 Moving Tables
这道题比较简单,就是用数组存取其路径。如101和102是对门,其过道号可以记为51. 1和2之间的为1.
今早突然收到操作系统停课的通知,哈哈 回来就做一下水题,开心
#include<cstdio>
#include<memory.h>
int main()
{
//freopen("input.txt","r",stdin);
int T,n,a,b;
int s[];
int max;
int t = ;
int temp;
scanf("%d",&T);
while(T--)
{
scanf("%d",&n);
memset(s,,sizeof(s));
while(n--)
{
scanf("%d%d",&a,&b);
if(a>b) {temp = a; a = b; b = temp;}
for(int i = (a+)/; i <= (b+)/; i++)
{
s[i]++;
}
}
max = ;
for(int i = ; i <= ; i++)
{
if(s[i] > s[max])
max = i;
}
printf("\n%d",s[max]*); //该题输出需要输出最后一个空行,才能过
} return ;
}
hdu 1.3.2 Moving Tables的更多相关文章
- POJ 1083 && HDU 1050 Moving Tables (贪心)
Moving Tables Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others) To ...
- 杭电 1150 moving tables
http://acm.hdu.edu.cn/showproblem.php? pid=1050 Moving Tables Time Limit: 2000/1000 MS (Java/Others) ...
- zstu.2512. Moving Tables(贪心)
Moving Tables Time Limit: 1 Sec Memory Limit: 64 MB Submit: 1182 Solved: 563 Description The famo ...
- Moving Tables(贪心或Dp POJ1083)
Moving Tables Time Limit: 1000MS Memory Limit: 10000K Total Submissions: 28304 Accepted: 9446 De ...
- HDOJ 1050 Moving Tables
Moving Tables Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Tot ...
- 1050 Moving Tables
Moving Tables Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others) To ...
- Moving Tables
Moving Tables Time Limit : 2000/1000ms (Java/Other) Memory Limit : 65536/32768K (Java/Other) Total ...
- hdoj 1050 Moving Tables【贪心区间覆盖】
Moving Tables Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Tot ...
- uvalive 2326 - Moving Tables(区间覆盖问题)
题目连接:2326 - Moving Tables 题目大意:在一个走廊上有400个教室, 先在有一些桌子要移动, 每次移动需要十分钟, 但是不同房间的桌子可以在同一个十分钟内移动,只要走廊没有被占用 ...
随机推荐
- abp项目中无法使用HttpContext.Current.Session[""]的问题
web项目Global.asax.cs中加入如下代码 public override void Init() { this.PostAuthenticateRequest += (sender, e) ...
- 解决ubuntu常见问题
cd /usr/local/hadoop 1. bash: cd: ~:Permission denied 报错:bash: cd: /usr/local/hadoop:Permission deni ...
- 【Linux】ApacheBench(ab)压力测试工具
AB的简介 ab是apachebench命令的缩写. ab是apache自带的压力测试工具.ab非常实用,它不仅可以对apache服务器进行网站访问压力测试,也可以对或其它类型的服务器进行压力测试.比 ...
- [C#]RichTextBox实现拖放
amespace WindowsFormsApplication1 { public partial class Form1 : Form { public Form1() { InitializeC ...
- render函数的简单使用
<!doctype html> <html lang="en"> <head> <meta charset="UTF-8&quo ...
- 在python中while
一.While循环 1.while循环格式 while 条件 : while循环体 当条件为Ture时,执行循环体,直到条件是假,停止循环. count = 1 # count 计数 一般用于计数 w ...
- 832. Flipping an Image
class Solution { public: vector<vector<int>> flipAndInvertImage(vector<vector<int& ...
- Java基础语法学习知识
基础概念 标识符1.由字母,数字,下划线,美元符组成2.首字母不能是数字3.不能是关键字和保留字4.能反映其作用 关键字1.有特定含义2.用于特定地方3.用来命名标识符 常量1.程序执行时值不变的量2 ...
- NETCLR via C#第四版(文摘)
第1部分 CLR基础 第1章 CLR的执行模型 第2章 生成,打包,部署和管理应用程序及类型 第3章 共享程序集和强命名程序集 第2部分 设计类型 第4章 类型 第5章 基元类型 引用类型和值类型 第 ...
- vue父传子
父组件传递数据给子组件用props,父组件中使用子组件,子组件用props接收父组件数据. Home父组件代码: <template> <div> {{test}} <! ...