zoj 3600 Taxi Fare
2012-04-15 10:09
337 查看
#include "iostream" using namespace std; int main() { int testcase; double s1, s2, ans, d, t; cin >> testcase; while (testcase--) { cin >> d >> t; s1 = s2 = ans = 0; if (d <= 3) { s1 = 10 + 1 + 2*t/5; s2 = 11 + 2.5*t/4; } else if (d > 3 && d <= 10) { s1 = 10 + 1 + 2*t/5 + (d-3)*2; s2 = 11 + 2.5*t/4 + (d-3)*2.5; } else { s1 = 10+ 1 + 2*t/5 + 7*2 + (d-10)*3; s2 = 11 + 2.5*t/4 + 7*2.5 + (d-10)*3.75; } s1 = (int)(s1 + 0.5); s2 = (int)(s2 + 0.5); ans = s2 - s1; cout << ans << endl; } }
相关文章推荐
- ZOJ 3600【Taxi Fare】模拟
- ZOJ 3600 Taxi Fare(精度误差)
- ZOJ 3600 Taxi Fare (数学)
- ZOJ 3600 Taxi Fare
- ZOJ 3600 Taxi Fare (细节题)
- ZOJ 3600 Taxi Fare
- ZOJ 3600 Taxi Fare
- ZOJ 3600 Taxi Fare(数学啊)
- ZOJ Problem Set - 3600||Taxi Fare
- zoj 3600 Taxi Fare
- ZOJ 3600 Taxi Fare
- ZOJ 3600 Taxi Fare(模拟)
- ZOJ 3600 Taxi Fare(模拟)
- ZOJ 3600 Taxi Fare【模拟】
- zoj 3600
- ZOJ 3600 & 3603
- Z0J 3600 Taxi Fare
- zjuoj 3600 Taxi Fare
- ZOJ-3600
- zoj 2674 Strange Limit——欧拉函数