Learn/Algorithm(34)
-
2869번 달팽이는 올라가고 싶다.
1 2 3 4 5 6 7 8 9 10 11 12 13 public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); double A = sc.nextInt(); double B = sc.nextInt(); double V = sc.nextInt(); double value = (V - A) / (A - B); int va = (int) Math.ceil(value); System.out.println(va + 1); } } http://colorscripter.com/info#e" target="_blank" style="color:#4f4f4ftext-decoration:none">Color..
2020.02.03 -
2447 별찍기 -10
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 import java.util.Scanner; public class Main { static int arr[][]; public static void reculsive(int n, int w, int c) { if(c == 1){ arr[n][w] = 1; return; } for(int i = 0; i cs 맨 처음에는 단순한 반복 노가다 문제인줄 알았다. 그러나 문제를 잘 읽어보니 Divide & Conquer 를 이용하는 재귀 문제였다. 그래서 코드를 싹 갈아엎고 다시 문제에 접근해봤더니, ..
2020.02.02 -
11053 백준 가장 긴 증가하는 부분수열
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 package solution; import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int arr[] = new int [1001]; int arr2[] = new int [1001]; int cnt = 0; int max_count = 0; int testcase = sc.nextInt(); for(int i = 0; i
2020.02.02 -
552 : 반복제어문3 - 자가진단5
기본별찍기 손풀기용 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 import java.util.Scanner; public class 정올역피라미드 { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int a = sc.nextInt(); for (int i = 0; i cs
2020.01.31 -
1209. [S/W 문제해결 기본] 2일차 - Sum
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 package import java.util.Scanner; public class Solution { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int arr[][] = new int[101][101]; for(int t = 1; t temp2) temp2 = sumcross[2]; } System.out.println("#" + t + " " +Math.max(temp, temp..
2020.01.31 -
1223 계산기 2
후위연산식으로 바꾸고 다시 후위연산식을 계산하는 계산기를 만드는 문제. 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293import java.util.Scanner;import java.util.Stack; public class Solution { public static void main(String[] args) { Scanner sc = new Scanner(System.in); for(int t = 0; t = 0 && (stack..
2020.01.30