일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
- 자바
- 한정 분기
- php 프로그래밍 입문 예제
- php 프로그래밍 입문 3판
- php 프로그래밍
- php 프로그래밍 입문 문제풀이
- 스프링
- 플러터
- Java
- programmers
- 페이코 추천인코드
- php 프로그래밍 입문
- 페이코 추천인
- 페이코 친구코드
- spring
- php
- 최단 경로
- C
- 파이썬
- 플러터 개발환경 설정
- 자바 스프링
- Flutter
- SWEA
- php 프로그래밍 입문 솔루션
- JAVA SPRING
- 페이코 초대코드
- php 프로그래밍 입문 연습문제
- C언어
- 백준
- 배열
- Today
- Total
ImJay
[파이썬/Python] 백준 16099번 Larger Sport Facility 본문
[파이썬/Python] 백준 16099번 Larger Sport Facility
문제
In a lot of places in the world, elite universities come in pairs and their students like to challenge each other every year. In England, Oxford and Cambridge are famous for The Boat Race, an annual rowing race that opposes them. In Switzerland, students from Zürich and Lausanne battle in a famous annual ski challenge.
TelecomParisTech and Eurecom, two famous French schools, are also planning to organize a multi-sport tournament. They have already agreed on the choice of sports and the rules of the game, but the only point of disagreement is on where the contest should be hosted. Indeed, every school has been bragging for years about the wonderful sport facilities that they have.
At last, it was agreed that the competition would be hosted at the school which has the larger rectangular sports field. The only thing left is to determine which school this is: given the size of the fields, determine which school has the field with the larger surface.
해설
TelecomParisTech and Eurecom, two famous French schools, are also planning to organize a multi-sport tournament.
프랑스의 유명 학교인 TelecomParisTech와 Eurecom은 멀티 스포츠 토너먼트를 조직할 계획입니다.
At last, it was agreed that the competition would be hosted at the school which has the larger rectangular sports field.
더 큰 직사각형 운동장이 있는 학교에서 대회를 개최합니다.
given the size of the fields, determine which school has the field with the larger surface.
필드의 크기가 주어지면 더 큰 표면을 가진 필드가 있는 학교를 결정하십시오.
코드
test_case = int(input())
for _ in range (test_case):
LT, WT, LE, WE = map(int, input().split())
if LT * WT > LE * WE :
print("TelecomParisTech")
elif LT * WT < LE * WE :
print("Eurecom")
else :
print("Tie")
풀이
1. 테스트 케이스 수 test_case 값을 입력 받습니다.
The input consists of several test cases. The first line contains an integer indicating the number of test cases.
test_case = int(input())
2. test_case 만큼 반복하여 lt, wt, le, we 를 입력 받습니다.
( lt, wt 는 TelecomParisTech 운동장의 길이와 너비, le, we 는 Eurecom 운동장의 길이와 너비 )
Each test case follows. Each test case consists of a single line containing 4 integers 1 ≤ lt, wt, le, we ≤ 109 separated by single spaces: lt and wt represent the length and width of the sports field of TelecomParisTech, and le and we represent the length and width of the sports field at Eurecom.
for _ in range (test_case):
LT, WT, LE, WE = map(int, input().split())
3. 운동장의 넓이(LT * WT, LE * WE)를 비교하여 더 큰 운동장의 학교를 출력합니다. 같을 경우 Tie 를 출력합니다.
The contents of the line should be the name of the school that has the facility with the larger area: TelecomParisTech or Eurecom. In case of a tie, the contents of the line should be Tie. There should be no blank lines in your output.
for _ in range (test_case):
LT, WT, LE, WE = map(int, input().split())
if LT * WT > LE * WE :
print("TelecomParisTech")
elif LT * WT < LE * WE :
print("Eurecom")
else :
print("Tie")
'Solved.ac - Python > Bronze V' 카테고리의 다른 글
[파이썬/Python] 백준 16394번 홍익대학교 (0) | 2022.11.22 |
---|---|
[파이썬/Python] 백준 16170번 오늘의 날짜는? (0) | 2022.11.22 |
[파이썬/Python] 백준 15964번 이상한 기호 (0) | 2022.11.21 |
[파이썬/Python] 백준 15962번 새로운 시작 (0) | 2022.11.21 |
[파이썬/Python] 백준 15740번 A+B - 9 (0) | 2022.11.21 |