From 371e636d4c2db8b002fbff9f25a76d661f63a3ae Mon Sep 17 00:00:00 2001 From: songyc macbook Date: Tue, 19 Aug 2025 20:55:43 +0900 Subject: [PATCH] 20250819 baekjoon --- code_study/Baekjoon/python/10815.py | 5 +++++ code_study/Baekjoon/ts/10815.ts | 5 +++++ code_study/Baekjoon/ts/1427.ts | 2 ++ code_study/Baekjoon/ts/25305.ts | 4 ++++ 4 files changed, 16 insertions(+) create mode 100644 code_study/Baekjoon/python/10815.py create mode 100644 code_study/Baekjoon/ts/10815.ts create mode 100644 code_study/Baekjoon/ts/1427.ts create mode 100644 code_study/Baekjoon/ts/25305.ts diff --git a/code_study/Baekjoon/python/10815.py b/code_study/Baekjoon/python/10815.py new file mode 100644 index 0000000..8590d53 --- /dev/null +++ b/code_study/Baekjoon/python/10815.py @@ -0,0 +1,5 @@ +from collections import Counter +input() +counter = Counter(input().split()) +input() +print(' '.join(str(counter[n]) for n in input().split())) \ No newline at end of file diff --git a/code_study/Baekjoon/ts/10815.ts b/code_study/Baekjoon/ts/10815.ts new file mode 100644 index 0000000..55692b6 --- /dev/null +++ b/code_study/Baekjoon/ts/10815.ts @@ -0,0 +1,5 @@ +export {}; +const input:string[] = require("fs").readFileSync(0,"utf8").toString().trim().split('\n'); +let counter:Map = new Map(); +for(let n of input[1].split(' ').map(Number)) counter.set(n,1); +console.log(input[3].split(' ').map(Number).map((n=> counter.get(n) || 0)).join(' ')); diff --git a/code_study/Baekjoon/ts/1427.ts b/code_study/Baekjoon/ts/1427.ts new file mode 100644 index 0000000..e3840ed --- /dev/null +++ b/code_study/Baekjoon/ts/1427.ts @@ -0,0 +1,2 @@ +export {}; +console.log(require("fs").readFileSync(0,"utf8").toString().trim().split('').sort((a:string,b:string)=>b.charCodeAt(0)-a.charCodeAt(0)).join('')); \ No newline at end of file diff --git a/code_study/Baekjoon/ts/25305.ts b/code_study/Baekjoon/ts/25305.ts new file mode 100644 index 0000000..d3bef8f --- /dev/null +++ b/code_study/Baekjoon/ts/25305.ts @@ -0,0 +1,4 @@ +export {}; +const input:string[] = require("fs").readFileSync(0,"utf8").toString().trim().split('\n'); +const [N,k]: number[] = input[0].split(" ").map(Number); +console.log(input[1].split(' ').map(Number).sort((a,b)=>b-a)[k-1]); \ No newline at end of file