목록[IT]/백준 (58)
할껀하고놀자
문자열을 뒤집고자 할 때 팁 : java 언어 이용 시. Stringbuffer 사용하여 reverse().tostring() 사용하기. import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; public class Main { public static void main(String[] args) throws IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); String [] input = br.readLine().split(" "); int n1 = Integer.parseInt(new ..
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 package ssafy0401; import java.util.Scanner; public class sol15649 { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int N = sc.nextInt(); int M = sc.nextInt(); int [] arr = new int [N]; for (int i = 0; i < arr.length; i++) { arr[i] = i+1; } int [] output = new int[..
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 package ssafy0401; import java.util.Scanner; public class sol15649 { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int N = sc.nextInt(); int M = sc.nextInt(); int [] arr = new int [N]; for (int i = 0; i
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 import java.io.BufferedReader; import java.io.FileInputStream; import java.io.IOException; import java.io.InputStreamReader; import java.util.Arrays; public class sol1759 { static char [] arr; static boolean [] visited; static int N; static int M; public stati..
12345678910111213141516171819202122232425262728293031323334353637383940414243444546import java.util.Scanner; public class Main { static int min = Integer.MAX_VALUE; static boolean [] visited; // 배열 탐색하는 것. static int start = 0; // 시작점. static int [][] arr; static int n; public static void main(String[] args) { Scanner sc = new Scanner(System.in); n = sc.nextInt(); arr= new int [n][n]; for (int i..
1. 첫째 줄에 테스트 케이스 갯수를 입력받게 하는 점. 2. 두번째 줄 부터 하나씩 출력 가능해도 괜찮다는 점. 주의 123456789101112131415161718192021222324252627#includeusing namespace std; int input; int re() { int dp[11]; dp[1] = 1; dp[2] = 2; dp[3] = 4; for (int i = 4; i > test_case; for (int i = 0; i > input; cout
하나의 상황만 알면 일반화 가능합니다! 4개의 상황이라고 가정하고, 4개의 상황일 때, 즉, 2x4의 상황일 때 = 3개의 상황에서 막대 하나 추가하는 경우 + 2개의 상황에서 막대 두개 추가하는 경우 라고 생각하시면 됩니다. 1234567891011121314151617181920#includeusing namespace std; int main() { int dp[1000]; dp[0] = 0; dp[1] = 1; int n; cin >> n; for (int i = 2; i
문제"나는 요리사다"는 다섯 참가자들이 서로의 요리 실력을 뽐내는 티비 프로이다. 각 참가자는 자신있는 음식을 하나씩 만들어오고, 서로 다른 사람의 음식을 점수로 평가해준다. 점수는 1점부터 5점까지 있다.각 참가자가 얻은 점수는 다른 사람이 평가해 준 점수의 합이다. 이 쇼의 우승자는 가장 많은 점수를 얻은 사람이 된다.각 참가자가 얻은 평가 점수가 주어졌을 때, 우승자와 그의 점수를 구하는 프로그램을 작성하시오.입력총 다섯 개 줄에 각 참가자가 얻은 네 개의 평가 점수가 공백으로 구분되어 주어진다. 첫 번째 참가자부터 다섯 번째 참가자까지 순서대로 주어진다. 항상 우승자가 유일한 경우만 입력으로 주어진다.출력첫째 줄에 우승자의 번호와 그가 얻은 점수를 출력한다.예제 입력 1 복사5 4 4 5 5 4 ..