SGU276-Andrew's Troubles

原创 2013年12月02日 21:32:15
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;
}

 

HDU 2826 || The troubles of lmy(判断两个N边形是否相似

题目给出两个N边形的逆时针的N个顶点,求问两个N边形是否相似。 用这个定理就ok啦-> #include #include #include #include #include using na...
  • FXXKI
  • FXXKI
  • 2015年04月16日 21:44
  • 554

UVa10276 HDU1329 ZOJ1239 Hanoi Tower Troubles Again!【递推函数+打表】

Hanoi Tower Troubles Again! People stopped moving discs from peg to peg after they know the numbe...

HNU Judging Troubles (字典树)

Judging Troubles Time Limit: 5000ms, Special Time Limit:12500ms, Memory Limit:65536KB Tot...

CodeForces 283C Coin Troubles 背包问题 分析问题

汉化题意你有n种不同的硬币,每个硬币有一个价值ai(不同硬币价值可能相同) 我有这些硬币总价值为t,并且给出q对(b,c),告诉你第b种硬币的数量严格大于第c中硬币的数量。保证这q对(b,c)中所...

UVa Problem 10276 Hanoi Tower Troubles Again! (汉诺塔卷土重来!)

// Hanoi Tower Troubles Again! (汉诺塔卷土重来!) // PC/UVa IDs: 110908/10276, Popularity: B, Success rate: ...

joj 1031 Hanoi Tower Troubles Again!解题报告

  1031: Hanoi Tower Troubles Again!ResultTIME LimitMEMORY LimitRun TimesAC TimesJUDGE3s8192K1034606S...

HDU 1329 Hanoi Tower Troubles Again!

Description People stopped moving discs from peg to peg after they know the number of steps neede...

SGU 333 AC源码

  • 2009年12月05日 15:37
  • 8KB
  • 下载

SGU题库整合 Volume (200 - 299) pdf版

  • 2015年12月18日 19:34
  • 433KB
  • 下载

【Codeforces Round 276 (Div 2)D】【数论 正难则反 枚举倍数 二分 O(nlogn)】Maximum Value n个数大数mod小数找最大余数

D. Maximum Value time limit per test 1 second memory limit per test 256 megabytes i...
内容举报
返回顶部
收藏助手
不良信息举报
您举报文章:SGU276-Andrew's Troubles
举报原因:
原因补充:

(最多只允许输入30个字)