목록문제/백준_자바 (102)
sm 기술 블로그
import java.util.*; import java.io.*; class Main { public static void main(String[] args) throws IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); int[] chessPiece = { 1, 1, 2, 2, 2, 8 }; String[] tmp = br.readLine().split(" "); List result = new ArrayList(); for (int i = 0; i < chessPiece.length; i++) { result.add(String.valueOf(chessPiece[i] - Integer.pars..
import java.util.*; import java.io.*; class Main { public static void main(String[] args) throws IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); StringBuilder sb = new StringBuilder(); while (true) { String[] tmpStr = br.readLine().split(" "); int n = Integer.parseInt(tmpStr[0]); if (n == 0) { break; } int[] h = new int[n]; for (int i = 1; i < tmpStr.lengt..
import java.util.*; import java.io.*; class Main { static int p = 1000000007; public static void main(String[] args) { Scanner sc = new Scanner(System.in); long N = sc.nextLong(); long[][] first = { { 1, 1 }, { 1, 0 } }; System.out.println(pow(first, N)[0][1]); } private static long[][] pow(long[][] A, long B) { if (B == 1) { int l = A.length; for (int i = 0; i < l; i++) { for (int j = 0; j < l;..
import java.util.*; import java.io.*; class Main { static int N; public static void main(String[] args) throws IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); StringBuilder sb = new StringBuilder(); String[] tmp1 = br.readLine().split(" "); N = Integer.parseInt(tmp1[0]); long B = Long.parseLong(tmp1[1]); long[][] A = new long[N][N]; for (int i = 0; i < N; ..