/*
* POJ_1922.cpp
*
* Created on: 2013年10月24日
* Author: Administrator
*/
#include <iostream>
#include <cstdio>
#include <cmath>
using namespace std;
int main(){
int n;
while(scanf("%d",&n)!=EOF,n){
int i;
double min = INT_MAX;
for(i = 0 ; i < n ; ++i){
int v,t;
scanf("%d%d",&v,&t);
double x;
if(t >= 0 && (x = t + 4.5/v*3600)<min ){//t < 0 时不能影响操作结果,因为他已经出发
min = x;
}
}
printf("%d\n",(int)ceil(min));
}
return 0;
}
(简单模拟2.1.2)POJ 1922 Ride to School(求最小值)
本文提供了一个针对POJ平台上的1922号问题的C++实现方案。该程序通过读取车辆的速度和时间输入,计算并输出所有车辆中最晚到达指定地点的时间。采用整数天花板函数确保时间计算的准确性。


被折叠的 条评论
为什么被折叠?



