Chinaunix首页 | 论坛 | 博客
  • 博客访问: 34745
  • 博文数量: 13
  • 博客积分: 933
  • 博客等级: 军士长
  • 技术积分: 140
  • 用 户 组: 普通用户
  • 注册时间: 2009-11-11 21:01
文章分类

全部博文(13)

文章存档

2011年(1)

2010年(12)

最近访客

分类:

2010-05-24 11:08:20

/*
重要的不是会先遇到谁,而是会和谁走到最后

*/
#include
#include
#include
#include
#include
using namespace std;
struct xpoint{
 int speed;
 int offsettime;
 double finishtime;
};
bool isShorter(const xpoint &p1,const xpoint &p2)
{
 return p1.offsettime}
int main()
{
 int N;
 xpoint temp;
 while(scanf("%d",&N))
 {
  list indata;
  if(N==0)
   break;
  for(int i=0;i  {
   scanf("%d%d",&temp.speed,&temp.offsettime);
   temp.finishtime=temp.offsettime+16200.0/double(temp.speed);
   if(temp.offsettime>=0)
    indata.push_back(temp);
  }
  stable_sort(indata.begin(),indata.end(),isShorter);
  list::iterator iptr,iptr2,iptrtemp;
  iptr=indata.begin();
  for(iptr2=indata.begin();iptr2!=indata.end();iptr2++)
  {
   if(iptr2->finishtimefinishtime)
   {
    iptr=iptr2;
   }
  }
  printf("%d\n",(int)ceil(iptr->finishtime));
 }
 return 0;
}
阅读(1500) | 评论(1) | 转发(0) |
给主人留下些什么吧!~~

安何2010-05-24 12:20:37