목록백준공부 (648)
문제 풀이 및 개발 공간

import java.io.*;import java.util.*;public class Main{ static HashMap dict=new HashMap(); static ArrayList arr; public static void main(String[] args) throws IOException{ BufferedReader br=new BufferedReader(new InputStreamReader(System.in)); StringTokenizer st=new StringTokenizer(br.readLine()); long s=Long.valueOf(st.nextToken()); long e=Long.valueOf(st.nex..

import java.io.*;import java.util.*;public class Main{ public static void main(String[] args) throws IOException{ BufferedReader br=new BufferedReader(new InputStreamReader(System.in)); int count=0; int depth=0; for(int i=1; i count+3; case 2-> count+2; case 3-> count+1; default -> 0; }; if(count%3==0){ if(c..

import java.io.*;import java.util.*;class Node { char color; int x; int y; public Node(char color, int x, int y){ this.color=color; this.x=x; this.y=y; }}public class Main{ static int n; static int m; static char[][] map; static Node red; static Node blue; //홀에 들어가면 +1, 파란공이면 -1을해서. 1일경우가 정상 종료. 외에는 불가. static int exit =0; //홀에 들어간 경우, ..

import java.io.*;import java.util.*;class Point{ int d; int xy; public Point(int d, int xy){ this.d=d; this.xy=xy; }}public class Main{ static int row,col; static int[][] map; //각 번호의 cctv마다 설치할 수 있는 방법의 수 static int[] direction={0,4,2,4,4,1}; static int min=Integer.MAX_VALUE; static ArrayList arr=new ArrayList(); public static void main(String[] ar..

import java.io.*;import java.util.*;//세그먼트를 이용한 간단한 문제class SegTree{ long[] tree; public SegTree(int n){ int height=(int)Math.ceil(Math.log(n)/Math.log(2)); tree=new long[(int)Math.pow(2,height+1)]; } public long init(int node, long[] arr, int start, int end){ if(start==end){ return tree[node]=arr[start]; } else{ return tree[no..

import java.io.*;import java.util.*;public class Main{ public static void main(String[] args)throws IOException{ BufferedReader br=new BufferedReader(new InputStreamReader(System.in)); BufferedWriter bw=new BufferedWriter(new OutputStreamWriter(System.out)); StringTokenizer st=new StringTokenizer(br.readLine()); int n=Integer.valueOf(st.nextToken()); int k=I..