SGU276-Andrew's Troubles

本文介绍了一个ACM-ICPC竞赛团队中针对成员迟到行为制定的一套惩罚制度,具体规定了根据不同迟到时间成员需要补偿队友的茶水数量。
Famous Berland ACM-ICPC team Anisovka consists of three programmers: Andrew, Michael and Ilya. A long time ago, during the first few months the team was founded, Andrew was very often late to the trainings and contests. To stimulate Andrew to be more punctual, Ilya and Andrew decided to introduce a new rule for team participants. If somebody is late (i.e. comes at least one second after appointed time) he owes a cup of tea to other team members. If he is late for 5 minutes, he owes two cups of tea. If he is late for 15 minutes, he owes three cups of tea. And if he is late for 30 minutes or more, he owes 4 cups of tea.
The training starts at the time S (counted in seconds, from some predefined moment of time) and Andrew comes at the time P (also in seconds, counted from the same moment of time). 
Your task is to find how many cups of tea Andrew owes.

Input
The input file contains single line with integer numbers S and P (0 <= S,P <= 10^4).

Output
Write to the output file the number of cups Andrew owes.

Sample test(s)

Input
 
Test #1 10 10 Test #2 10 11 Test #3 0 300
Output
 
Test #1
0

Test #2
1

Test #3
2
 
 
按照ranklist按个做的,经常碰到大水。
 
#include<iostream>
#include<string.h>
#include<stdio.h>
#include<algorithm>
#include<stack>
#include<queue>
#include<set>
#include<math.h>
#include<vector>
#include<map>
#include<deque>
#include<list>
using namespace std;
int main()
{
    int m,n;
    scanf("%d %d",&m,&n);
    if(m==n)
        printf("0\n");
    if(n-m>=1800)
    {
        printf("4\n");
        return 0;
    }
    if(n-m>=900)
    {
        printf("3\n");
        return 0;
    }
    if(n-m>=300)
    {
        printf("2\n");
        return 0;
    }
    if(n>m)
    {
        printf("1\n");
        return 0;
    }
    return 0;
}

 
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值