본문 바로가기

알고리즘 & 자료구조569

백준 1436 import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; public class Main1436 { public static void main(String[] args) throws IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); int N = Integer.parseInt(br.readLine()); for(int i=666;;i++) { String s = i+""; if(s.contains("666")) { N--; } if(N == 0) { System.out.println(i); .. 2022. 2. 25.
백준 2852 import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.util.StringTokenizer; public class Main2852 { public static void main(String[] args) throws IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); int N = Integer.parseInt(br.readLine()); //골 들어간 횟수 N int[] win = new int[2]; int team = 0; String str; int score.. 2022. 2. 24.
백준 3474 import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; public class Main3474 { public static void main(String[] args) throws IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); // 10 = 2와 5로 만들 수 있다. // N/(2의제곱) , N/(5의제곱) 의 최소값이 10을 만들 수 있는 갯수이다. int T = Integer.parseInt(br.readLine()); //테스트 케이스 T while(T-- > 0) { int N .. 2022. 2. 23.
백준 10709 import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.util.LinkedList; import java.util.Queue; import java.util.StringTokenizer; public class Main10709 { public static int[][] ans; public static int H,W; public static Queue q; public static void main(String[] args) throws IOException { BufferedReader br = new BufferedReader(new InputStreamReader.. 2022. 2. 22.
백준 2870 import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.math.BigInteger; import java.util.ArrayList; import java.util.Collections; import java.util.StringTokenizer; public class Main2870 { public static void main(String[] args) throws IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); StringTokenizer st; ArrayL.. 2022. 2. 21.
백준 4659 import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; public class Main4659 { public static void main(String[] args) throws IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); while(true) { String s = br.readLine(); if(s.equals("end")) { break; } if(check1(s) && check2(s) && check3(s)) { System.out.println(" is acceptable.. 2022. 2. 20.