《数据结构编程实验》 2.1.2Ride to School
来源:互联网 发布:美图秀秀for mac 编辑:程序博客网 时间:2024/04/29 02:08
题目大意:
Charlay总是跟随着其他同学一起骑车,他跟随第一见到的同学和随后超越他的同学一起骑车去学校。求Charlay什么时候到学校。
题目地址:
POJ 1922 ZOJ 2229
题解:
水题一道,将题目转化为Charlay遇上的同学中最早到达的时间即可。
#include <iostream>#include <cstdio>#include <cmath>using namespace std;int main(){ int n,i; double v,t,min; while (scanf("%d",&n)&&n) { min=1e100; for (i=0;i<n;i++) { scanf("%lf%lf",&v,&t); if (t>=0&&t+4.5*3600/v<min) min=t+4.5*3600/v; } printf("%.0lf\n",ceil(min)); } return 0;}
0 0
- 《数据结构编程实验》 2.1.2Ride to School
- F - Ride to School(2.1.2)
- F - Ride to School(2.1.2)
- F - Ride to School(2.1.2)
- F - Ride to School(2.1.2)
- Ride to School
- POJ1922-Ride to School
- Ride to School(水题)
- POJ1992 Ride to School
- POJ1922 Ride to School
- Ride to School
- POJ1922 Ride to School
- Ride to School
- S-Ride to School
- POJ 1922 Ride to School
- fjnu 1007 Ride to School
- POJ 1922 Ride to School
- FOJ 1190 Ride to School
- 求职之路
- hdu 3974 Assign the task 线段树(时间戳)
- 指针的再认识
- JavaScript 事件模型 事件处理机制
- 1007 Financial Management
- 《数据结构编程实验》 2.1.2Ride to School
- 开发部程序员绩效考核办法
- 初识pthread(一)-线程管理之创建/结束线程
- 网络常识
- Linux程序设计(Linux shell编程三)
- Configuring Java CAPS for SSL Support - Index
- 九度OJ题目1034:寻找大富翁
- 又一版“畅通工程”
- hdu 2296 Ring (ac自动机+dp)