Skip to content

Commit 72889e6

Browse files
committed
[Bronze V] Title: Christmas Tree Adapter, Time: 8 ms, Memory: 69104 KB -BaekjoonHub
1 parent 89daebe commit 72889e6

2 files changed

Lines changed: 41 additions & 0 deletions

File tree

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
let ampere = Int(readLine()!)!
2+
let wattVolt = readLine()!.split { $0 == " " }.map { Int(String($0))! }
3+
let answer = wattVolt[0] / wattVolt[1] >= ampere ? 1 : 0
4+
print(answer)
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
# [Bronze V] Christmas Tree Adapter - 32314
2+
3+
[문제 링크](https://www.acmicpc.net/problem/32314)
4+
5+
### 성능 요약
6+
7+
메모리: 69104 KB, 시간: 8 ms
8+
9+
### 분류
10+
11+
사칙연산, 수학
12+
13+
### 제출 일자
14+
15+
2025년 2월 23일 21:33:59
16+
17+
### 문제 설명
18+
19+
<p>Adapters (Transformers) are used with many devices (e.g., cell phones) to convert the 110 volt coming out of the outlet. The adapter for Dr. Orooji's Christmas Tree broke and Dr. O could not find that model online or in stores. The tree adapter was showing the “ampere” but the adapters online were showing “watt” and “volt”! So, Dr. O had to refer to the “Electricity 101 Book” to figure out what to buy:</p>
20+
21+
<ul>
22+
<li>Watt: measure of power</li>
23+
<li>Volt: measure of electric potential</li>
24+
<li>Ampere: measure of current</li>
25+
<li>watt = ampere × volt → ampere = watt / volt</li>
26+
</ul>
27+
28+
<p>Given the ampere for Dr. O’s Christmas tree, and the watt and volt for a candidate adapter, determine if the candidate adapter will work with the tree. The adapter will work if its ampere is greater than or equal to the tree’s ampere.</p>
29+
30+
### 입력
31+
32+
<p>The first input line contains an integer, a (1 ≤ a ≤ 20), indicating the ampere for the Christmas tree. The second input line contains two integers: w (1 ≤ w ≤ 2000), indicating the watt for the candidate adapter and v (1 ≤ v ≤ 100), indicating the volt for the candidate adapter. Assume that the input will not result in fractions in divisions.</p>
33+
34+
### 출력
35+
36+
<p>Print 1 if the candidate adapter will work with the tree, 0 (zero) otherwise.</p>
37+

0 commit comments

Comments
 (0)