brute force search

A collection of 5 post

Kth Largest Number

Problem Hyeonsu has N cards with natural numbers between 1 and 100. There can be multiple cards of the same number. Hyeon-soo draws 3 of them and tries to record the sum of the numbers on each card. Record all three possible draws. Write a program that prints the Kth largest number among recorded…

Graduation Gift

Problem The teacher is going to give a graduation gift to the classmates who are graduating this year. Students were asked to choose a product they wanted from an online shopping mall and submit the price and shipping cost of that product. Teachers have a limited budget. Write a program to find out…

Mentoring

Problem Hyunsoo’s class teacher wants to create a mentoring system to improve the students’ math scores. Mentoring is a pair of mentors (students helping) and mentees (students receiving help), and the mentor helps the mentee study math. The teacher selects a mentor and a mentee based on the M…

Reverse Prime Number

Problem Write a program that flips each natural number when N natural numbers are input and outputs the prime number if the reversed number is prime. For example, flipping 32 is 23, and 23 is a prime number. Then it outputs 23. If you flip 910, you have to number it as 19. Consecutive zeros from the…

Sum of Digits

Problem Write a program that, when N natural numbers are input, finds the sum of the digits of each natural number, and outputs the natural number with the largest sum. If the sum of digits is the same, the answer is the number with the larger original number. If 235 and 1234 can be the answer at…