Learn/Algorithm(34)
-
2493 탑
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 import java.io.BufferedReader; import java.io.BufferedWriter; import java.io.IOException; import java.io.InputStreamReader; import java.io.OutputStreamWriter; import java.util.Stack; import java.util.StringTokenizer; public class Main { public static void main(String[] args) throws I..
2020.02.11 -
1861 정사각형 방
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 50 package com.java.first; import java.util.Arrays; import java.util.Scanner; public class Main { static int dx[] = {0,0,-1,1}; static int dy[] = {1,-1,0,0}; static int N = 0; public static void main(String[] args) { // TODO Auto-generated method stub Scanner ..
2020.02.10 -
1828 냉장고
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.util.Arrays; import java.util.Scanner; public class Main { public static void main(String[] args) { // TODO Auto-generated method stub Scanner sc = new Scanner(System.in); int N = sc.nextInt(); boolean[] arr = new boolean[10271]; // 1 ~ 10000 DOT[]..
2020.02.10 -
1873. 상호의 배틀필드
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 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 12..
2020.02.10 -
4408 자기방으로 돌아가기
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 import java.util.Scanner; public class Solution { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int Test = sc.nextInt(); for(int t = 1; tcs 겹치는 부분은 항상 다음 시간에 해야하기때문에 증가시켜서 최대수를 찾아주었다.
2020.02.10 -
14501번 퇴사코드 - DP
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 import java.util.Arrays; import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc= new Scanner(System.in); int N = sc.nextInt(); int T = 0; int P = 0; int pnt = 0; int max = 0; int trr[] = new int [N+1]; int prr[] = new int [N+1]; for(int i = 1; i
2020.02.07