본문 바로가기

반응형

IT

(137)
기초 알고리즘(38번 치킨쿠폰 재귀) 영상 버젼: 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 algo.youtube.a38; import java.util.Scanner; public class Main { public static void doFunc(int coupon, int stamp, int k, int ans) { if(coupon > 0) { coupon--; stamp++; ans++; doFunc(coupon, stamp, k, ans); return; } else if(stamp > 0) { if(stamp/k > 0) { stamp -= k; coupon++; doFun..
백준 5단계(2562) 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 import java.io.BufferedReader; import java.io.BufferedWriter; import java.io.InputStreamReader; import java.io.OutputStreamWriter; public class Main { public static void main(String[] args) throws Exception{ BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); BufferedWriter bw = new Buffe..
백준 5단계(10818) 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 import java.io.BufferedReader; import java.io.BufferedWriter; import java.io.InputStreamReader; import java.io.OutputStreamWriter; import java.util.StringTokenizer; public class Main { public static void main(String[] args) throws Exception{ BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); Buff..
백준 4단계(11/23/19)(10952, 10951, 1110) 1. 10952 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 import java.io.BufferedReader; import java.io.BufferedWriter; import java.io.InputStreamReader; import java.io.OutputStreamWriter; public class Main { public static void main(String[] args) throws Exception{ BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); BufferedWriter bw = new BufferedWriter(new OutputS..
자바 메모리 구조 이넘, 상수, 메소드들은 메소드영역에 존재 객체는 heap, 참조안되면 garbage collector와서 지움 stack은 객체의 변수, 기본 변수
백준 3단계(11/23/19)(2739, 10950, 8393, 15552, 2741, 2742, 11021, 11022, 2438, 2439, 10871) 1. 2739 import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner scan = new Scanner(System.in); int number = scan.nextInt(); for(int i = 1; i import java.util.ArrayList; import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner scan = new Scanner(System.in); int caseNum = scan.nextInt(); int first = 0; int second = 0; Arr..
백준 2단계(11/23/19)(1330, 9498, 2753, 2884, 10817) 1. 1330 import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner scan = new Scanner(System.in); int first = scan.nextInt(); int second = scan.nextInt(); if(first > second) System.out.println(">"); else if(first import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner scan = new Scanner(System.in); int grade = scan.nextIn..
백준 1단계(11/23/19)(2557, 10718, 10171, 10172, 7287, 1000, 1001, 10998, 1008, 10869, 10430, 2588) 백준 시작! 유뷰브에서 현재까지 나온 알고리즘은 다 풀었으니까 이제 백준 알고리즘을 단계별로 풀어가겠습니다. 1. 2557 public class Main { public static void main(String[] args) { System.out.println("Hello World!"); } } 2. 10718 public class Main { public static void main(String[] args) { System.out.println("강한친구 대한육군"); System.out.println("강한친구 대한육군"); } } 3. 10171 public class Main { public static void main(String[] args) { System.out.println..

반응형