SGU276-Andrew's Troubles
2013-12-02 21:32
218 查看
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按个做的,经常碰到大水。
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; }
相关文章推荐
- SGU - 276 - Andrew's Troubles
- SGU 276 Andrew's Troubles
- sgu - 276 - Andrew's Troubles
- SGU 104 Little Shop of Flowers (DP&打印路径)
- sgu220&sgu221 分类: sgu 2015-06-15 22:01 24人阅读 评论(0) 收藏
- Stanford Machine Learning (by Andrew NG) --- (week 9) Anomaly Detection&Recommende
- sgu208:Toral Tickets(Pólya定理)
- SGU 242 Student's Morning 网络流(水
- sgu220&sgu221
- YUM安装遇到问题:File"/usr/bin/yum", line 29, in <module> File"/usr/share/yum-cli/yummain.py", line 276, in
- SGU 246 Black & White(思考的转化)
- Andrew Stankevich's Contest #1 Solution
- sgu276:Andrew's Troubles(大大大水题)
- Andrew's Debian-nVidia HOWTO
- SGU 246: Black & White
- UVA 11922 Permutation Transformer && SGU 187. Twist and whirl - want to cheat(伸展树)
- SGU 242 Student's Morning 网络流(水
- sgu 193 Chinese Girls' Amusement
- (原创)Stanford Machine Learning (by Andrew NG) --- (week 3) Logistic Regression & Regularization
- sgu196:Matrix Multiplication(矩阵乘法-->图)