분류 전체보기

https://www.acmicpc.net/problem/5648[BOJ] 5648 - 역원소 정렬코드const fs = require("fs");const path = process.platform === "linux" ? "dev/stdin" : "./input.txt";const [n, ...arr] = fs .readFileSync(path) .toString() .split(/\s/) .filter((val) => val !== "");const reverseString = (str) => { return str.split("").reverse().join("");};const ans = arr.map((val) => +reverseString(val)).sort((a, b) => a ..
보호되어 있는 글입니다.
·TIL
1. 설계의 중요성.2. 커밋 습관을 들이자.3. 자바스크립트 타입 조심하자
·문제풀이/DP
https://www.acmicpc.net/problem/27134코드const fs = require("fs");const filePath = process.platform === "linux" ? "/dev/stdin" : "./input.txt";const n = +fs.readFileSync(filePath).toString().trim();function solution(n) { let total = (n * (n + 1)) / 2; if (total % 2 === 1) return 0; let dp = Array.from(new Array(n + 1), () => new Array(total / 2 + 1).fill(0)); for (let i = 0; i = 0) { dp..
https://www.acmicpc.net/problem/11322코드from collections import dequen= int(input())def bfs(division): q = deque(["1"]) while q: num = q.popleft() if int(num) % division == 0: return num q.append(num+"0") q.append(num+"1")for i in range(n): print(bfs(int(input())))
딜레이레이
'분류 전체보기' 카테고리의 글 목록 (2 Page)