-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcomA_1125.cpp
More file actions
55 lines (46 loc) · 1.03 KB
/
comA_1125.cpp
File metadata and controls
55 lines (46 loc) · 1.03 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
#include <iostream>
#include <string>
#include <cmath>
#include <algorithm>
bool solve(std::string time) // 2021136089 À̰ü¿ì
{
time.erase(remove(time.begin(), time.end(), ':'), time.end());
int times[4]{};
int time_cnt{0};
int n{0};
for (int i = 0; i < time.length(); i++)
{
if (time[i] == ' ')
{
time_cnt = 0;
++n;
}
else
{
times[n] += pow(10, 3 - time_cnt) * int(time[i] - '0');
++time_cnt;
}
}
return ((times[1] >= times[2] && times[0] <= times[3]));
}
int main()
{
std::ios_base::sync_with_stdio(false);
std::cin.tie(nullptr);
std::cout.tie(nullptr);
int T;
std::cin >> T;
std::cin.ignore();
std::string time_arr[100];
bool result[100];
for (int t{0}; t < T; ++t)
{
getline(std::cin, time_arr[t]);
result[t] = solve(time_arr[t]);
}
for (int t{0}; t < T; ++t)
{
std::cout << std::boolalpha << result[t] << '\n';
}
return 0;
}