목록전체 글 (159)
할껀하고놀자
#include #include #include using namespace std; void quick_sort(int * data, int start, int end) { if (start >= end) { return;// 원소가 1개인 경우. } int pivot = start; int i = pivot + 1; int j = end; int tmp; while (i j) { tmp = data[j]; data[j] = data[pivot]; data[pivot] = tmp; } else { tmp = data[i]; data[i] = data[j]; data[j] = tmp; } for (int i = 0; i < 10; i++) { cout
import java.util.LinkedList; import java.util.Queue; import java.util.Scanner; public class Main { static int [] dy = {0,0,1,-1}; static int [] dx = {1,-1,0,0}; public static void main(String[] args) { Scanner sc = new Scanner(System.in); int n = sc.nextInt(); int l = sc.nextInt(); int r = sc.nextInt(); int [][] a = new int [n][n]; for (int i = 0; i < n; i++) { for (int j = 0; j < n; j++) { a[i]..
import java.util.ArrayList; import java.util.LinkedList; import java.util.Queue; import java.util.Scanner; public class Main { static int [] dy = {0,0,1,-1}; static int [] dx = {1,-1,0,0}; static Shark bfs(int [][]a,int sy,int sx,int size) { int n = a.length; ArrayList arr = new ArrayList(); int [][] d = new int [n][n]; for (int i = 0; i < n; i++) { for (int j = 0; j < n; j++) { d[i][j] = -1; } ..