알고리즘 풀이

처음에는 Arrays.sort([array], Collections.ReverseOrder()) 이거로 Reverse하고 Delete하고 Reverse하고.. 이런 식으로 하는 건줄 알았는데 element의 양이 많고 삭제가 빈번하다는 점에서 LinkedList를 사용해야하는 것을 깨달았음 (바로 LinkedList를 써야겠군 이정도도 안되는 수준임 지금) 각 TestCase마다 결과 String을 출력할 수 있도록 부분적인 기능을 하는 함수들을 만듬 1. String을 Parsing해서 숫자를 추출해 LinkedList를 return하는 함수 2. 1번에서 return받은 LinkedList를 명령어(ex)"RDD", "DD", "RRD")에 맞게 LinkedList 양끝단을 잘라내는 함수 ※ 2번 함..
123456789101112131415161718192021222324252627282930313233import java.io.BufferedReader;import java.io.IOException;import java.io.InputStreamReader;import java.util.Stack; public class Main { private static BufferedReader br = new BufferedReader(new InputStreamReader(System.in));// private static BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(System.out)); public static void main(S..
BFS 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 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 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 Main { private ..
1234567891011121314151617181920212223242526272829303132333435363738394041424344import java.io.BufferedReader;import java.io.BufferedWriter;import java.io.IOException;import java.io.InputStreamReader;import java.io.OutputStreamWriter;import java.util.Arrays;import java.util.Comparator;import java.util.HashSet; public class Main { private static BufferedReader br = new BufferedReader(new InputStre..
1234567891011121314151617181920212223242526import java.io.BufferedReader;import java.io.BufferedWriter;import java.io.IOException;import java.io.InputStreamReader;import java.io.OutputStreamWriter; public class Main { private static BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); private static BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(System.out)); ..
123456789101112131415161718192021222324252627282930313233343536373839404142import java.io.BufferedReader;import java.io.BufferedWriter;import java.io.IOException;import java.io.InputStreamReader;import java.io.OutputStreamWriter; public class Main { private static BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); private static BufferedWriter bw = new BufferedWriter(new O..
123456789101112131415161718192021222324252627282930313233343536373839import java.io.BufferedReader;import java.io.BufferedWriter;import java.io.IOException;import java.io.InputStreamReader;import java.io.OutputStreamWriter;import java.util.Stack; public class Main { private static BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); private static BufferedWriter bw = new Buf..
1234567891011121314151617181920212223242526272829303132333435363738394041import java.io.BufferedReader;import java.io.BufferedWriter;import java.io.IOException;import java.io.InputStreamReader;import java.io.OutputStreamWriter; public class Main { private static BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); private static BufferedWriter bw = new BufferedWriter(new Out..
123456789101112131415161718192021import java.io.BufferedReader;import java.io.BufferedWriter;import java.io.IOException;import java.io.InputStreamReader;import java.io.OutputStreamWriter;import java.util.StringTokenizer; public class Solution { private static BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); private static BufferedWriter bw = new BufferedWriter(new Output..
12345678910111213141516171819202122232425262728293031323334import java.io.BufferedReader;import java.io.BufferedWriter;import java.io.IOException;import java.io.InputStreamReader;import java.io.OutputStreamWriter;import java.util.StringTokenizer; public class Solution { private static BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); private static BufferedWriter bw = new..
배게
'알고리즘 풀이' 카테고리의 글 목록 (14 Page)