码迷,mamicode.com
首页 > 其他好文 > 详细

CF868B Race Against Time

时间:2017-10-05 19:59:59      阅读:178      评论:0      收藏:0      [点我收藏+]

标签:blog   fst   against   str   cin   while   max   its   ==   

思路:

模拟。少写了一个等号FST了,好气啊。

实现:

 1 #include <bits/stdc++.h>
 2 using namespace std;
 3 int main()
 4 {
 5     int h, m, s, t1, t2;
 6     while (cin >> h >> m >> s >> t1 >> t2)
 7     { 
 8         int cnt = 0;
 9         int x = min(t1, t2), y = max(t1, t2);
10         if (h >= x && h < y) cnt++;
11         if (m >= x * 5 && m < y * 5) cnt++;
12         if (s > x * 5 && s < y * 5) cnt++;
13         if (cnt == 0 || cnt == 3) puts("YES");
14         else puts("NO");
15     }
16     return 0;
17 }

 

CF868B Race Against Time

标签:blog   fst   against   str   cin   while   max   its   ==   

原文地址:http://www.cnblogs.com/wangyiming/p/7629852.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!