Notice
Recent Posts
Recent Comments
| 일 | 월 | 화 | 수 | 목 | 금 | 토 |
|---|---|---|---|---|---|---|
| 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 | 31 |
Tags
- 머신러닝
- Spring Data JPA
- Apache Kafka
- 백트래킹
- 쿠버네티스
- Spring Boot
- DFS
- 스프링 부트
- 백준
- 클라우드
- 스프링
- 코드업
- 카프카
- Docker
- Spring
- 스프링부트
- aws
- 개발
- 오일러프로젝트
- Kafka
- 자료구조
- VPC
- Elasticsearch
- 클라우드 컴퓨팅
- 알고리즘
- JPA
- springboot
- gcp
- 로드밸런서
- 프로그래밍문제
Archives
- Today
- Total
GW LABS
[Backjoon] 동혁 피자 본문
수학문제로 원 안에 내접할 수 있는 사각형에 대한 문제였다. 사각형의 대각선을 구해서 원의 지름과 비교하면 간단하게 풀이가 가능하다.
#include <iostream>
#include <vector>
#include <math.h>
using namespace std;
int main() {
int index = 1;
while (true) {
int r, w, l;
cin >> r;
if (r == 0) break;
cin >> w >> l;
double diagonal = sqrt(w*w + l*l);
if (2*r >= diagonal) {
cout << "Pizza " << index <<" fits on the table." << "\n";
}
else {
cout << "Pizza " << index <<" does not fit on the table." << "\n";
}
index++;
}
return 0;
}'Algorithm & DataStructure > Problems' 카테고리의 다른 글
| [Backjoon] 11586번 지영 공주님의 마법 거울 (0) | 2021.10.21 |
|---|---|
| [Backjoon] 순열 사이클 (0) | 2021.07.03 |
| [Backjoon] 희주의 수학시험 (0) | 2021.06.24 |
| [Backjoon] 케빈 베이컨의 6단계 법칙 (0) | 2021.05.15 |
| [Backjoon] 좌표 압축 (0) | 2021.04.24 |
Comments