전체 글
-
boj)1654 - 랜선 자르기PS/boj 2020. 11. 17. 17:31
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 import java.io.*; import java.util.*; public class boj_1654 { static BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); static StringTokenizer st; static long[] len; static int k, n; public static void main(String[] args) throws IOException { st ..
-
boj)5525 - IOIOIPS/boj 2020. 11. 17. 11:44
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 import java.io.*; public class boj_5525 { static BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); static int n, m, ans; static int[] dp; static String s; public static void main(String[] args) throws IOException { n = Integer.parseInt(br.readLine()); m = Integer.parseInt(br.readLine()); s = br.readLi..
-
boj)15651 - N과 M (3)PS/boj 2020. 11. 16. 16:18
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 import java.io.*; import java.util.Scanner; public class boj_15651 { static Scanner sc = new Scanner(System.in); static BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(System.out)); static int[] numbers = new int[10]; static boolean[] v = new boolean[10]; static int n, m; pub..
-
boj)15650 - N과 M (2)PS/boj 2020. 11. 16. 11:22
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 import java.io.*; import java.util.Scanner; public class boj_15650 { static Scanner sc = new Scanner(System.in); static BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(System.out)); static int[] numbers = new int[10]; static boolean[] visited = new boolean[10]; static int ..
-
boj)15649 - N과 M (1)PS/boj 2020. 11. 16. 09:28
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 import java.util.Scanner; public class boj_15649 { static Scanner sc = new Scanner(System.in); static int n, m; static int[] arr = new int[10]; static boolean[] isUsed = new boolean[10]; public static void main(String[] args) { n = sc.nextInt(); m = sc.nextInt(); func(0); } static void func(int k) ..
-
11. PromiseJavaScript & TypeScript 2020. 11. 15. 15:22
Promise is a JavaScript object for asynchronous operation state: pending -> fulfilled or rejected Producer vs Consumer 1. Producer when new Promise is created, the executor runs automatically const promise = new Promise((resolve, reject) => { // doing some heavy work (network, read files) console.log('doing something....'); setTimeout(() => { // resolve('ellie'); reject(new Error('no network'));..
-
10. CallbackJavaScript & TypeScript 2020. 11. 15. 14:28
JavaScript is synchronous Execute the code block in order after hoisting hoisting : var, function declaration console.log('1'); setTimeout(() => console.log('2'), 1000); console.log('3'); // 1, 3, 2 Synchronous callback function printImmediately(print) { print(); } printImmediately(() => console.log('hello')); Asynchronous callback function printWithDelay(print, timeout) { setTimeout(print, time..
-
9. JSONJavaScript & TypeScript 2020. 11. 15. 13:21
JSON (JavaScript Object Notation) simplest data interchange format lightweight text-based structure easy to read key - value pairs used for serialization and transmission of data between the network and the network connection independent programming language and platform 1. Object to JSON stringify (obj) let json = JSON.stringify(true); console.log(json); // true json = JSON.stringify(["apple", ..