※ 글쓴이는 취미로 코딩을 익혀보는 사람이라 정확하지 않은 내용을 담고 있을 수 있다 ※

 

이번에 볼 문제는 백준 24183번 문제인 Affischutskicket이다.
문제는 아래 링크를 확인하자.

https://www.acmicpc.net/problem/24183 

 

24183번: Affischutskicket

Indatan består av tre heltal mellan $50$ och $200$, ytvikterna i $\frac{\text{gram}}{\text{m}^2}$ för sorterna som används till kuvertet, affischerna respektive informationsbladet.

www.acmicpc.net

한 우편물은 C4용지 둘로 만든 봉투와, A3용지 둘과 A4용지 하나로 구성되어있다.

 

각 용지의 한 변의 길이는 mm단위로, 문제에서 주어지는 무게의 단위면적은 제곱미터임에 주의하여 우편물의 중량을 계산해 출력하자.

 

아래는 제출한 소스코드이다.

#include <iostream>
using namespace std;

int main() {
	ios::sync_with_stdio(0);
	cin.tie(0);

	cout << fixed;
	cout.precision(10);

	double C4 = 0.229 * 0.324, A3 = 0.297 * 0.420, A4 = 0.210 * 0.297;
	double X, Y, Z; cin >> X >> Y >> Z;

	cout << 2 * C4 * X + 2 * A3 * Y + A4 * Z;
}

 

728x90

+ Recent posts