분류 전체보기
-
boj)12018 - Yonsei TOTOPS/boj 2020. 8. 31. 18:06
import java.io.*; import java.util.Arrays; import java.util.Collections; import java.util.StringTokenizer; public class Main { public static void main(String[] args) throws IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); int ans = 0; StringTokenizer st = new StringTokenizer(br.readLine()); int n = Integer.parseInt(st.nextToken()); // 과목 수 int m = Integer.p..
-
boj)2012 - 등수 매기기PS/boj 2020. 8. 31. 17:14
import java.io.*; import java.util.Arrays; 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]; long ans = 0; for (int i = 0; i < arr.length; i++) { arr[i] = Integer.parseInt(br.readLine()); } Arrays.sort(arr); for (int i = 0; i < a..
-
boj)1911 - 흙길 보수하기PS/boj 2020. 8. 31. 16:42
import java.io.*; import java.util.Arrays; import java.util.Comparator; 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 StringTokenizer(br.readLine()); int N = Integer.parseInt(st.nextToken()); // 웅덩이 갯수 int L = Integer.parseInt(st.n..
-
LinkedListAlgorithm 2020. 8. 31. 16:36
public class Node { public T data; public Node next; public Node(T data) { this.data = data; this.next = null; } } public class MySingleLinkedList { public Node head = null; public int size = 0; public MySingleLinkedList() {} public void addFirst(T item) { Node newNode = new Node(item); newNode.next = head; head = newNode; size++; } public void addAfter(Node before, T item) { Node newNode = new ..
-
boj)8958PS/boj 2020. 8. 29. 21:19
import java.io.*; 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)); int N = Integer.parseInt(br.readLine()); for (int i = 0; i < N; i++) { String str = br.readLine(); int point = 0; int ans = 0; for (int j = 0; j < str..
-
boj)4344PS/boj 2020. 8. 29. 20:55
import java.io.*; import java.util.StringTokenizer; 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)); int N = Integer.parseInt(br.readLine()); for (int i = 0; i < N; i++) { StringTokenizer st = new StringTokenizer(br.r..
-
boj)10996PS/boj 2020. 8. 29. 19:10
import java.io.*; 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)); int N = Integer.parseInt(br.readLine()); for (int i = 1; i
-
boj)2446PS/boj 2020. 8. 29. 18:27
import java.io.*; 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)); int N = Integer.parseInt(br.readLine()); int line = (2*N)-1; for (int i = 1; i