Skip to content

Commit ff763a9

Browse files
committed
[ADD] BOJ 14625 냉동식품
- 구현
1 parent 80e32fb commit ff763a9

File tree

2 files changed

+38
-1
lines changed

2 files changed

+38
-1
lines changed

acmicpc.net/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -272,7 +272,7 @@
272272
| 203 | [알고리즘 수업 - 알고리즘의 수행 시간 4](https://www.acmicpc.net/problem/24265) | [cpp](source/24265.cpp) | 204 | [콘서트](https://www.acmicpc.net/problem/16466) | [cpp](source/16466.cpp) |
273273
| 205 | [저항](https://www.acmicpc.net/problem/1076) | [cpp](source/1076.cpp) | 206 | [공사장 표지판](https://www.acmicpc.net/problem/23055) | [cpp](source/23055.cpp) |
274274
| 207 | [Ресторан](https://www.acmicpc.net/problem/23738) | [cpp](source/23738.cpp) | 208 | [자동완성](https://www.acmicpc.net/problem/24883) | [cpp](source/24883.cpp) |
275-
| 209 | [팰린드롬](https://www.acmicpc.net/problem/10174) | [cpp](source/10174.cpp) | | | |
275+
| 209 | [팰린드롬](https://www.acmicpc.net/problem/10174) | [cpp](source/10174.cpp) | 210 | [냉동식품](https://www.acmicpc.net/problem/14625) | [cpp](source/14625.cpp) |
276276

277277
</details>
278278

acmicpc.net/source/14625.cpp

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
// 14625. 냉동식품
2+
// 2022.06.03
3+
// 구현
4+
#include<iostream>
5+
6+
using namespace std;
7+
8+
int main()
9+
{
10+
int h1, m1, h2, m2, n;
11+
cin >> h1 >> m1 >> h2 >> m2 >> n;
12+
13+
int start = h1 * 60 + m1;
14+
int end = h2 * 60 + m2;
15+
int cur = start;
16+
int ans = 0;
17+
while (1)
18+
{
19+
int h = cur / 60;
20+
int m = cur % 60;
21+
22+
if (h / 10 == n || h % 10 == n || m / 10 == n || m % 10 == n)
23+
{
24+
ans++;
25+
}
26+
27+
if (cur == end)
28+
{
29+
break;
30+
}
31+
32+
cur++;
33+
}
34+
35+
cout << ans << endl;
36+
return 0;
37+
}

0 commit comments

Comments
 (0)