목록데이터 엔지니어링 정복/Algorithm (159)
지구정복
-자바 import java.io.BufferedReader; import java.io.BufferedWriter; import java.io.IOException; import java.io.InputStreamReader; import java.io.OutputStreamWriter; import java.util.StringTokenizer; public class Main { private static BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(System.out)); public static void main(String[] args) throws NumberFormatException, IOException { Buffere..
-자바 import java.io.BufferedReader; import java.io.BufferedWriter; import java.io.IOException; import java.io.InputStreamReader; import java.io.OutputStreamWriter; public class Main { private static BufferedWriter bw = new BufferedWriter( new OutputStreamWriter(System.out)); private static int checkPal( int oe, StringBuilder word ) {//oe는 홀짝여부, word는 단어 int len = word.length();//문자 길이 //첫 번째 문자와 ..
-파이썬 N, M, K = input().split(" ") N = int(N) M = int(M) K = int(K) nums = input().split(" ") for i in range( 0, N ): nums[i] = int( nums[i] ) sum = 0 maxNum = max( nums ) nums.remove( maxNum ) maxNum2 = max( nums ) # 리스트안에 최대값이 중복일 때 for i in range( 0, N-1 ): if maxNum == nums[i]: sum = maxNum * M break; if sum == 0: for i in range( 1, M+1 ): if i % K == 0: sum += maxNum2 else: sum += maxNum pri..
-자바 package greedy; import java.io.BufferedReader; import java.io.BufferedWriter; import java.io.IOException; import java.io.InputStreamReader; import java.io.OutputStreamWriter; import java.util.StringTokenizer; public class DNA { private static BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(System.out)); private static char toChar( int a, int t, int g, int c, int max ) { if( max..