본문 바로가기
728x90
반응형

첫솔3

[백준] 23275번 : Knot Knowledge(JAVA) https://www.acmicpc.net/problem/23275 23275번: Knot Knowledge The first line of input consists of an integer $n$ ($2 \le n \le 50$), the number of knots Sonja needs to learn. This is followed by a line containing $n$ distinct integers $x_1, \ldots, x_n$ ($1 \le x_i \le 1\,000$), the knots that Sonja needs to learn. F www.acmicpc.net 풀이 첫 사이즈를 입력받고, 그 사이즈만큼 수를 입력받습니다. 그 후 사이즈 - 1 만큼 수를 입력받으면서 리스트의.. 2021. 10. 22.
[백준] 21176번 : Smoothie Stand(JAVA) https://www.acmicpc.net/problem/21176 21176번: Smoothie Stand The first line contains two integers $k$ and $r$, separated by a space. The value $k$ is the number of different ingredients Olivia uses in her smoothies and $r$ is the number of different recipes she makes. You may assume $1 \le k \le 100\,000$, $1 www.acmicpc.net 풀이 K(재료 갯수), R(레시피 갯수)를 입력받습니다. 첫줄은 소유하고 있는 재료의 갯수들, 다음줄부터 레시피에 필요한 재료의.. 2021. 7. 26.
[백준] 5489번 : Numbers(JAVA) https://www.acmicpc.net/problem/5489 5489번: Numbers You are to write a program, which, given N positive integer values X1, X2, ..., XN, computes the smallest number Xi that appears in the sequence at least as many times as any other number. www.acmicpc.net 풀이 N을 입력받고 N개의 숫자를 입력받았을 때 가장 작은 수 중 가장 많이 등장한 수를 찾는 문제입니다. 범위가 10000의 수중 가져오는 것이므로 10001크기의 배열을 구해주고 N번 입력받은 수의 위치를 1 더해줍니다. 배열의 크기만큼 for문을 .. 2021. 7. 24.
728x90
반응형