목록기타/코딩테스트 (38)
변수의 기록

입출력 예 import java.util.*;class Solution { public int solution(int[][] targets) { int count = 0; //타겟 기준으로 [1]을 기준으로 오름차순으로 정렬 Arrays.sort(targets,Comparator.comparingInt(a ->a[1])); double lastIndex = -1; for(int[] target:targets){ int first = target[0] , second=target[1] ..
import java.util.*;class Solution { private static final int[] dx = {0, 0, 1, -1}; private static final int[] dy = {1, -1, 0, 0}; public int solution(String[] storage, String[] requests) { char[][] containers = new char[storage.length][]; for (int i = 0; i = containers.length || y >= containers[x].length || isVisited[x][y]) { return; } ..

package codingTest;import java.util.*;public class Backjun_testee { static int N; static int[][] map; static int[] dx = {-1, 0, 0, 1}; // 위, 왼, 오, 아래 (우선순위 맞추기 위함) static int[] dy = {0, -1, 1, 0}; static int sharkSize = 2, eatCount = 0; static int time = 0; static int sx, sy; // 상어 위치 static class Fish implements Comparable { int x, y, dist; public Fish(int ..

package codingTest;import java.util.*;import java.io.*;public class Backjun_11659 { public static void main(String[] args) throws IOException { // TODO Auto-generated method stub BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); StringTokenizer st = new StringTokenizer(br.readLine()); int N = Integer.parseInt(st.nextToken()); int M = Integer.parseInt(st.nextToken())..

package codingTest;import java.util.*;import java.io.*;public class Backjun_1516 { public static void main(String[] args) throws IOException { // TODO Auto-generated method stub BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); int N = Integer.parseInt(br.readLine()); int[] time = new int[N+1]; int[] indegree = new int[N+1]; int[] result = new int[N+1]; List> g..

import java.util.*;import java.io.*;public class Backjun_2252 { public static void main(String[] args) throws IOException { // 빠른 입력을 위한 BufferedReader BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); StringTokenizer st = new StringTokenizer(br.readLine()); // 학생 수 N, 비교 횟수 M int N = Integer.parseInt(st.nextToken()); int M = I..

package codingTest;import java.util.*;import java.io.*;public class Backjun_20040 { static int N,M; static int[] parents; static int count = 0; public static void main(String[] args) throws IOException{ // TODO Auto-generated method stub BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); StringTokenizer st = new StringTokenizer(br.readLine()); N = Integer.parseInt(s..

import java.util.*;import java.io.*;/*330 1 01 0 10 1 01 2 3 */public class Main { static int N,M; static int[] parents; static int[][] map; public static void main(String[] args) throws IOException{ // TODO Auto-generated method stub BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); StringTokenizer st = new StringTokenizer(br.readLine()); N = Integer.parseInt(st.nex..