poj1083
来源:互联网 发布:centos 6.5安装telnet 编辑:程序博客网 时间:2024/05/22 02:28
http://poj.org/problem?id=1083
400个房间,1,2相对,3,4相对。。。共有400个房间。
任意两个房间移动桌子,每次移动时都要消耗10分钟,并且两个房间的范围内不能有其他桌子正在搬,
问最少需要多少时间能够搬完。
#include <cstdio>#include <iostream>#include <fstream>#include <stdlib.h>#include <string.h>#include <algorithm>using namespace std;int t;int n;int a,b;int vis[210];int main(){//ifstream cin("input.txt");cin>>t;while(t--){ int max=0;memset(vis,0,sizeof(vis));cin>>n;while(n--){cin>>a>>b;int temp;if(b<a) temp=b,b=a,a=temp; //这里要换一下,Wa了几次- -for(int i=(a-1)/2;i<=(b-1)/2;i++)vis[i]++;}for(int i=0;i<=202;i++) if(max<vis[i]) max=vis[i]; printf("%d\n",max*10);}return 0;}
0 0
- POJ1083
- poj1083
- poj1083
- poj1083
- POJ1083
- poj1083
- poj1083
- poj1083
- poj1083
- poj1083
- poj1083
- poj1083
- poj1083
- POJ1083
- POJ1083
- poj1083
- poj1083
- POJ1083
- HttpSession常见问题
- java Integer.valueOf()方法
- 随笔2014-2-11(2)关于vmware tools出现问题
- 开源74个项目
- Javascript面向对象编程:构造函数的继承
- poj1083
- c++的类型转换
- Qt多线程概述
- Qt 中sax方式 解析 xml文件
- ARC使用心得
- iOS设计模式之观察者模式
- 类型System.Double的对象无法转换为类型System.Single
- ExtJS4.2基础知识之事件机制
- mysqli_result:fetch_all() 不识别的解决办法