본문 바로가기
  • Let's study

PS71

[C++] 백준 25828: Corona Virus Testing 문제 https://www.acmicpc.net/problem/25828 25828번: Corona Virus Testing Testing for Corona can be done individually, e.g., 100 people require 100 test kits. Alternatively, the test can be done in groups (pools), e.g., 100 people can be divided into five group of 20 people each and then using only one test kid per group. If one www.acmicpc.net 해결방법 그룹별 검사하는 데 사용되는 키트 수는 그룹 수 + 그룹별 인원수 * 양성인 그룹 수이고 .. 2023. 5. 22.
[C++] 백준 25881: Electric Bill 문제 https://www.acmicpc.net/problem/25881 25881번: Electric Bill The first input line contains two integers (each between 2 and 20, inclusive), indicating the rate/KWH for the first 1000 KWH and the rate/KWH for the additional usage, respectively. The next input line contains a positive integer, n, indicating the number www.acmicpc.net 해결방법 입력받은 고객의 에너지 소비량에서 1000은 기본 요율, 1000을 뺀 나머지는 추가 요율을 적용하여 .. 2023. 5. 21.
[C++] 백준 9772: Quadrants 문제 https://www.acmicpc.net/problem/9772 9772번: Quadrants Given the coordinates (x,y) of some points in 2-dimensional plane, find out which quadrant(Q1-Q4) the points are located. If a point is located on X-axis or Y-axis, print out AXIS instead. www.acmicpc.net 해결방법 x와 y가 양수인지 음수인지로 어느 사분면인지 출력하고 축이면 AXIS를 출력한다. 마지막 0 0일 때도 AXIS를 출력해야 한다. 코드 #include using namespace std; int main() { ios_base::s.. 2023. 5. 20.
[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.