본문 바로가기

짱구 굴리기 (Q) - 52

[프로그래머스] 프린터 큐를 사용해 푸는 문제입니다 public class PrinterQueue { public static void main(String[] args) throws IOException{ int[] arr = new int[] {1, 1, 9, 1, 1, 1}; int location = 0; PrinterQueue pq = new PrinterQueue(); int result = pq.solution(arr, location); System.out.print("RESULT:"+result); } public int solution(int[] arr, int location) { int answer = 1; Queue queue = new LinkedList(); for(int i=0; i 2019. 4. 2.
[백준 11866] 조세퍼스 문제 0 큐를 사용해 문제를 해결했습니다 public class Q11866 { 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 k = Integer.parseInt(st.nextToken()); Queue q = new LinkedList(); for(int i=1; i 2019. 4. 1.
[백준 1065] 한수 출처 : https://www.acmicpc.net/problem/1065 소스코드 public class Q1065 { public static void main(String[] args) { Scanner in = new Scanner(System.in); int n = in.nextInt(); // 1 2019. 1. 29.
[백준 1920] 수 찾기 출처 : https://www.acmicpc.net/problem/1920 소스코드 public class Q1920 { public static void main(String[] args) throws IOException{ BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); StringTokenizer st; int numCnt; int[] arr; int searchCnt; int search; numCnt = Integer.parseInt(br.readLine()); arr = new int[numCnt]; st = new StringTokenizer(br.readLine()); for(int i=0; i 2019. 1. 25.