ZOJ 3600 Taxi Fare

一道水题 因为精度卡了半天 也是醉了= =

#include<cstdio>
#include<cstring>
#include<stdlib.h>
#include<algorithm>
#include<iostream>
#include<math.h>
using namespace std;
int main()
{
    int kase;
    cin>>kase;
    while(kase--)
        {
            int n,t;
            scanf("%d%d",&n,&t);
            float ansa,ansb;
            if(n<=3)
            {
                ansa=11;
                ansb=11;
            }
            else if(3<n&&n<=10)
            {
                ansa=(n-3)*2.0;
                ansb=(n-3)*2.5;
            }
            else
            {
                ansa=14+(n-10)*3.0;
                ansb=17.5+(n-10)*3.75;
            }
            float  ta,tb;

            ta=2.0/5;
            tb=2.5/4;
            ta=t*ta;
            tb=t*tb;

            ansa+=ta;
            ansb+=tb;
            int aa=(int)(ansa+0.5);//费用向上进位
            int bb=(int)(ansb+0.5);
            printf("%d\n",bb-aa);
        }

    return 0;
}

  

ZOJ 3600 Taxi Fare

时间: 2024-11-18 04:28:26

ZOJ 3600 Taxi Fare的相关文章

ZOJ 3600 Taxi Fare(数学啊)

题目链接:http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemId=4703 Last September, Hangzhou raised the taxi fares. The original flag-down fare in Hangzhou was 10 yuan, plusing 2 yuan per kilometer after the first 3km and 3 yuan per kilometer after

ZOJ 3156 Taxi (二分匹配+二分查找)

题目链接:Taxi Taxi Time Limit: 1 Second      Memory Limit: 32768 KB As we all know, it often rains suddenly in Hangzhou during summer time.I suffered a heavy rain when I was walking on the street yesterday, so I decided to take a taxi back school. I foun

使用ML.NET进行自定义机器学习

ML.NET是Microsoft最近发布的用于机器学习的开源,跨平台,代码优先的框架.尽管对我们来说是一个新的框架,但该框架的根源是Microsoft Research,并且在过去十年中已被许多内部团队使用,包括那些您几乎肯定听说过的产品的开发人员-Microsoft Windows,Office和Bing,仅举几例. ML.NET使.NET开发人员可以轻松地将机器学习集成到其应用程序中,无论是控制台,桌面还是Web.它涵盖了机器学习活动的整个生命周期,从模型的训练和评估到使用和部署.支持许多典

[转]如何动态加载控件以及插件编程思想(C#) Zd0

Yann LeCun其人,Facebook AI研究院(FAIR)负责人,深度学习三架马车之一,卷积神经网络(CNN)之父,享受得了万人敬仰,也在无人问津的寒冬挣扎过. 他于1960年出生在巴黎,1987-1989年博士后期间拜在大神Geoffrey Hinton门下,1988年被Larry Jackel招入贝尔实验室,1989年提出在计算机视觉中使用卷积神经网络,其后此项技术被用于在自动取款机上读取支票,影响至今.1998年又提出基于梯度的学习. 或许是天性,又或许是经历过神经网络和深度学习备

图论 500题——主要为hdu/poj/zoj

转自——http://blog.csdn.net/qwe20060514/article/details/8112550 =============================以下是最小生成树+并查集======================================[HDU]1213   How Many Tables   基础并查集★1272   小希的迷宫   基础并查集★1325&&poj1308  Is It A Tree?   基础并查集★1856   More i

A cost-effective recommender system for taxi drivers

一个针对出租车司机有效花费的推荐系统 摘要 GPS技术和新形式的城市地理学改变了手机服务的形式.比如说,丰富的出租车GPS轨迹使得出做租车领域有新方法.事实上,最近很多工作是在使用出租车GPS轨迹数据来开发手机推荐系统.这些系统可以推荐一系列的载客点,为了使得在最短的驾驶距离里最大可能地找到一个乘客.然而,在现实世界中,出租车的收入和有效的驾驶时间息息相关.换句话说,对一个出租车司机来说,在找到一个乘客前知道一个确切地驾驶路径来缩短驾驶时间更加重要.最后,在本文中,我们提出了开发一个收益比高的推

URAL 1607. Taxi

1607. Taxi Time limit: 0.5 second Memory limit: 64 MB Petr likes going by taxi. For him, it is not only the pleasure of a fast and comfortable ride, but also the opportunity to bargain with the driver over the fare. The bargaining between Petr and ta

fare|gave it away|catch a glimpse |involve|rip|eternalstiff|

N-COUNT 旅费;路费;车费A fare is the money that you pay for a journey that you make, for example, in a bus, train, or taxi. He could barely afford the railway fare. 他几乎买不起火车票. to tell people something secret, often without intending to 泄露,暴露(秘密) The party w

概率dp ZOJ 3640

Help Me Escape Time Limit:2000MS     Memory Limit:32768KB     64bit IO Format:%lld & %llu Submit Status Practice ZOJ 3640 Appoint description:  System Crawler  (2014-10-22) Description Background     If thou doest well, shalt thou not be accepted? an