-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path24390.cpp
83 lines (70 loc) · 1.16 KB
/
24390.cpp
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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
#include <string>
#include <stdio.h>
#include <math.h>
#include <iostream>
#include <vector>
#include <algorithm>
#include <map>
#include <queue>
#include <stack>
#include <climits>
#include <set>
#define p(a, b) make_pair(a, b)
#define SWAP(a, b, type) do { \
type temp; \
temp = a; \
a = b; \
b = temp; \
} while (0)
#define INF 1000000000
#define endl '\n'
#define ll long long
using namespace std;
char c;
int m = 0;
int s = 0;
void input() {
cin>>c;
m+=(c - '0');
cin>>c;
m = m*10 + (c - '0');
cin>>c;
cin>>c;
s+=(c - '0');
cin>>c;
s = s*10 + (c - '0');
s+=m*60;
}
void init() {
}
void solution() {
/*
if(s==10){
cout<<2;
}else if(s == 20){
cout<<3;
}else{
}*/
int cnt = 0;
bool flag = false;
while(s){
if(s>=600) s-=600;
else if(s>=60) s-=60;
else if(s>=30){
s-=30;
flag = true;
}
else s-=10;
cnt++;
}
if(!flag) cnt++;
// cout<<s;
cout<<cnt;
}
int main()
{
ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
input();
solution();
return 0;
}