Skip to content

Instantly share code, notes, and snippets.

View dalcon10028's full-sized avatar
🐟

dalcon dalcon10028

🐟
View GitHub Profile
import java.util.*;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int N, C = sc.nextInt();
for(int i=0; i<C; i++){
N = sc.nextInt();
double[] students = new double[N];
import java.util.*;
public class Main {
static int count = 0, N;
static int[] queen;
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
N = sc.nextInt(); sc.close();
queen = new int[N];
nqueen(queen, 0);
import java.util.*;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int N, C = sc.nextInt();
for(int i=0; i<C; i++){
N = sc.nextInt();
double[] students = new double[N];
import java.util.*;
class Solution {
public int solution(int[] pri, int locat) {
ArrayList<int[]> list = new ArrayList<>();
int count = 0;
for(int i=0; i<pri.length; i++)
list.add(new int[] {i, pri[i]}); // μΈλ±μŠ€μ™€ μ€‘μš”λ„ μ‚½μž…
while(!list.isEmpty()){
boolean print = true;
import java.util.*;
class Solution {
public int[] solution(int[] answers) {
int[][] person = {{1, 2, 3, 4, 5},
{2, 1, 2, 3, 2, 4, 2, 5},
{3, 3, 1, 1, 2, 2, 4, 4, 5, 5}};
int[] count = {0, 0, 0}; // 각각 a, b, c의 λ§žμ€ 개수
for (int i=0; i<person.length; i++){ // μ‚¬λžŒ 수만큼
class Solution {
static int[] arr;
static int tar, count=0;
public int solution(int[] numbers, int target) {
arr = numbers; tar = target;
dfs(0);
return count;
}
static void dfs(int d){
if (d == arr.length) {
import java.util.*;
public class Main {
public static void main(String[] args) {
LinkedList<Integer> queue = new LinkedList<>();
Scanner sc = new Scanner(System.in);
int N = sc.nextInt();
for(int i=1; i<=N; i++)
queue.add(i);
while (queue.size()!=1) {
import java.util.*;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
while (true) {
String a = sc.nextLine();
if(a.equals(".")) break; // .은 μ’…λ£Œ
String[] input = a.split(""); // μž…λ ₯κ°’λ“€ μͺΌκ°œμ„œ λ„£κΈ°
Stack<String> stack = new Stack<>();
import java.util.*;
public class Main {
static long[] memo = new long[91];
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
System.out.print(fibo(sc.nextInt()));
}
static long fibo(int n){
if (n<=1) return n;
import java.util.*;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int [][] memo = new int[41][2]; // 각 μˆ«μžκ°€ 0κ³Ό 1이 λͺ‡ λ²ˆμ”© λ‚˜μ˜€λŠ”μ§€
memo[0][0]=1; memo[1][1]=1; // [0][1], [1][0]은 0으둜 μžλ™μ΄ˆκΈ°ν™” λ©λ‹ˆλ‹€.
int t = sc.nextInt();
for(int i=2; i<41; i++)
for(int j=0; j<2; j++)