본문 바로가기

반응형

IT

(137)
백준 7단계(11720) 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 import java.io.BufferedReader; import java.io.BufferedWriter; import java.io.InputStreamReader; import java.io.OutputStreamWriter; public class Main { public static void main(String[] args) throws Exception { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); BufferedWriter bw = new BufferedWriter(new ..
백준 7단계(11654) 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 import java.io.BufferedReader; import java.io.BufferedWriter; import java.io.InputStreamReader; import java.io.OutputStreamWriter; public class Main { public static void main(String[] args) throws Exception{ BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(Sys..
백준 6단계(1065) 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 import java.io.BufferedReader; import java.io.BufferedWriter; import java.io.InputStreamReader; import java.io.OutputStreamWriter; public class Main { public static void main(String[] args) throws Exception{ BufferedReader br = new BufferedReader(new InputStreamR..
백준 6단계(4673) 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.io.BufferedWriter; import java.io.OutputStreamWriter; public class Main { public static void main(String[] args) throws Exception{ BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(System.out)); boolean[] check = new boolean[10000]; for(int i = 0; i 9999) return 9999; return an..
백준 6단계(15596) 1 2 3 4 5 6 7 8 9 public class Test { long sum(int[] a) { long ans = 0; for(int i = 0; i
Various queries 1 1. select substring(datetime, 12, 2) as hour, count(datetime) from animal_outs group by hour having hour between 9 and 19 --- if you want to only get hours using datetime, use a substring where you can define the start point and the end point of a certain column/data. datetime is formatted as YYYY-MM-DD HH:MI:SS, so the twelfth starting value is H while ending is also H resulting in hours only -..
Garbage Collector Java.lang.OutOfMemoryError ==not able to use heap because heap is full, NEED TO CHECK FOR MEMORY LEAKS!!! Garbage collection has 3 steps: Mark- starts from root node of your application, walks object graph and marks objects that are reachable as live Sweep/delete – delete unreachable objects, sweeps from heap Compacting- Arranging everything in order, when unreachable objects are sweeped, there ..
Comparable vs Comparator Comparable is a interface you need to implement to a Object where a specific compare standard has to be defined by overriding compareTo method. compareTo needs to be returned as an int value, + for moving up a list, - for moving down, 0 for staying at the same place. Wrapper type data does NOT need comparable interface to be compared since all Wrapper class already has been implemented with a Co..

반응형