[파이썬][백준 8370번] Plane
1. 문제Permalink
[Bronze V] Plane - 8370Permalink
성능 요약Permalink
메모리: 30864 KB, 시간: 72 ms
분류Permalink
사칙연산(arithmetic), 수학(math)
문제 설명Permalink
Byteland Airlines recently extended their aircraft fleet with a new model of a plane. The new acquisition has n1 rows of seats in the business class and n2 rows in the economic class. In the business class each row contains k1 seats, while each row in the economic class has k2 seats.
Write a program which:
- reads information about available seats in the plane,
- calculates the sum of all seats available in that plane,
- writes the result.
입력Permalink
In the first and only line of the standard input there are four integers n1, k1, n2 and k2 (1 ≤ n1, k1, n2, k2 ≤ 1 000), separated by single spaces.
출력Permalink
The first and only line of the standard output should contain one integer - the total number of seats available in the plane.
출처: 백준, https://https://www.acmicpc.net/
2. 해결방법 시간복잡도Permalink
- 단순 코딩 O(1)
3. 문제 해결 및 코드Permalink
n1, k1, n2, k2 = map(int, input().split()) | |
print((n1 * k1) + (n2 * k2)) |
-
주석을 참고하면서 이해를 돕습니다.Permalink
4. 알고리즘 및 해설Permalink
- 받은 4개의 값을 위의 문제에서 제시한 조건에 맞게 출력해준다.