본문 바로가기

전체 글342

[백준] 10250번 ACM 호텔 #Java import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.util.StringTokenizer; public class Main { 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 = 0; i < N; i++) { StringTokenizer st = new StringTokenizer(br.re.. 2022. 5. 7.
[백준] 11650번 좌표 정렬하기 #Java class Point implements Comparable{ int x,y; public Point(int x,int y){ this.x = x; this.y = y; } @Override public int compareTo(Point o) { if(this.x == o.x){ return this.y - o.y; } return this.x - o.x; } @Override public String toString() { return x+" " + y; } } public class Main { public static void main(String[] args) throws IOException { BufferedReader br = new BufferedReader(new InputStreamR.. 2022. 5. 7.
[백준] 11866번 요세푸스 문제 #Java import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.util.Arrays; import java.util.LinkedList; import java.util.Queue; import java.util.StringTokenizer; public class Main { public static void main(String[] args) throws IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); StringTokenizer st = new StringTokenize.. 2022. 5. 7.
[백준] 10816 숫자카드 2 #Java package com.company; import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.util.Arrays; import java.util.StringTokenizer; public class Main { public static void main(String[] args) throws IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); int n = Integer.parseInt(br.readLine()); int [] arr = new int[n]; Strin.. 2022. 5. 7.