본문 바로가기
728x90
반응형

백준/20001 - 2500031

[백준] 23292번 : 코딩 바이오리듬(JAVA) https://www.acmicpc.net/problem/23292 23292번: 코딩 바이오리듬 바이오리듬(biorhythm)이라는 이론을 들어본 적 있는가? 바이오리듬은 인체에 신체,감성,지성의 세가지 주기가 생년월일의 입력에 따라 어떤 패턴으로 나타나고, 이 패턴의 조합에 따라 능력이나 www.acmicpc.net 풀이 처음에 입력받은 날이랑 나중에 입력받은 n개랑 비교해서 가장 가까운 리듬을 가진 날짜를 출력하면 됩니다. 소스코드 import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; public class Main { public static void main(String[] args).. 2021. 10. 31.
[백준] 23335번 : Aliquot Sum(JAVA) https://www.acmicpc.net/problem/23335 23335번: Aliquot Sum A divisor of a positive integer n is an integer d where m = n d is an integer. In this problem, we define the aliquot sum s(n) of a positive integer n as the sum of all divisors of n other than n itself. For examples, s(12) = 1 + 2 + 3 + 4 + 6 = 16, s(21) www.acmicpc.net 풀이 s(n)은 n을 제외한 n의 약수들의 합입니다. 약수들의 합이 더 크면 "abundant", 같으면 "perfect".. 2021. 10. 31.
[백준] 23334번 : Olympic Ranking(JAVA) https://www.acmicpc.net/problem/23334 23334번: Olympic Ranking The first line of the input contains one positive integer n. Then n lines follow. Each of the following lines contains three non-negative integers g, s, b, and the name of a country or NOC. They are separated by blanks. www.acmicpc.net 풀이 금메달, 은메달, 동메달 나눠서 값을 비교한 후 answer를 바꿔주다가 마지막에 제출할 경우 800~900사이로 java11만 될겁니다(시간초과가 나올 수도 있음) 이러한 .. 2021. 10. 30.
[백준] 23336번 : A Sorting Problem(JAVA) https://www.acmicpc.net/problem/23336 23336번: A Sorting Problem You are given an array [p[1], p[2], ..., p[n]] where all the numbers in the array are distinct. In addition, the numbers are positive integers between 1 and n. You can only perform the following operations on the array: Pick two indices x and y such that | www.acmicpc.net 풀이 기본적인 2중 for문 버블정렬을 할 시 시간초과가 나온다. 분할정복으로 부분을 나눠서 체크해주면 된다... 2021. 10. 30.
728x90
반응형