본문 바로가기
  • Let's study

PS/백준56

[C++] 백준 25893: Majestic 10 문제 https://www.acmicpc.net/problem/25893 25893번: Majestic 10 The movie “Magnificent 7” has become a western classic. Well, this year we have 10 coaches training the UCF programming teams and once you meet them, you’ll realize why they are called the “Majestic 10”! The number 10 is actually special in many www.acmicpc.net 해결방법 1. 모두 10 미만이면 'zilch' 출력 2. 모두 10 이상이면 'triple-double' 출력 3. 두 개만 10 이.. 2023. 5. 19.
[C++] 백준 27880: Gahui and Soongsil University statio 문제 https://www.acmicpc.net/problem/27880 27880번: Gahui and Soongsil University station Soongsil University Station is famous as the deepest station on Seoul Subway Line 7. This station is so deep that the platform is on the B6. Gahui was surprised that she did not reach the platform after more than five minutes from the exit. Gahui wants to www.acmicpc.net 해결방법 에스컬레이터에서 1 step의 높이는 21cm, 계단에서 1 .. 2023. 5. 18.
[C++] 백준 22155: Простая задача 문제 https://www.acmicpc.net/problem/22155 22155번: Простая задача Первая строка содержит одно целое число n (1 ≤ n ≤ 121) — количество задач. Далее, в n строках задано по два целых числа i и f (0 ≤ i, f ≤ 10) www.acmicpc.net 해결방법 입력받은 i, f가 i i >> f; if ((i 2023. 5. 17.
[C++] 백준 27890: 특별한 작은 분수 문제 https://www.acmicpc.net/problem/27890 27890번: 특별한 작은 분수 첫 번째 줄에 $0$초에서의 분수의 높이 $x_0$와 $N$이 주어진다. $x_0$와 $N$은 모두 정수이다. www.acmicpc.net 해결방법 시간에 따라 낮아지는 분수의 높이를 구하는 문제이다. n-1초 때 분수의 높이가 바뀌는 계산을 하면 n초에서의 높이가 구해지기 때문에 0 ~ n-1초까지 계산을 한다. 분수의 높이(x)가 짝수면 ( x / 2 ) ^ 6으로, 홀수면 ( 2 * x ) ^ 6으로 분수의 높이를 바꿔주고 마지막으로 계산된 x를 출력한다. 코드 #include using namespace std; int main() { ios_base::sync_with_stdio(0); ci.. 2023. 5. 16.
[C++] 백준 5358: Football Team 문제 https://www.acmicpc.net/problem/5358 5358번: Football Team Print the same list of names with every ‘i’ replaced with an ‘e’, every ‘e’ replaced with an ‘i’, every ‘I’ replaced with an ‘E’, and every ‘E’ replaced with an ‘I’. www.acmicpc.net 해결방법 while문 안에 getline(cin, str) 함수를 사용하여 입력값이 없을 때 까지 입력받고 문자열을 for문으로 하나씩 보면서 e는 i로, E는 I로, i는 e로, I는 E로 변경 후 출력한다. 코드 #include #include using namespace .. 2023. 5. 15.
[C++] 백준 6825: Body Mass Index 문제 https://www.acmicpc.net/problem/6825 6825번: Body Mass Index The Body Mass Index (BMI) is one of the calculations used by doctors to assess an adult’s health. The doctor measures the patient’s height (in metres) and weight (in kilograms), then calculates the BMI using the formula BMI = weight/(height × height). www.acmicpc.net 해결방법 입력은 몸무게(w), 키(h) 순이며 w / (h * h)로 bmi를 구해 조건에 따라 출력한다. 코드 #inc.. 2023. 5. 14.