1. 程式人生 > >CF868B Race Against Time

CF868B Race Against Time

mes esp against std == bsp puts fst spa

思路:

模擬。少寫了一個等號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