HomeAboutMeBlogGuest
© 2025 Sejin Cha. All rights reserved.
Built with Next.js, deployed on Vercel
🤎
프론트엔드 데브코스 5기 교육생
/
🐥
김은수팀
/
🏆
15주차 : 기업 코테 딱대
/
1. 알바생 강호

1. 알바생 강호

고른사람
송희
URL
https://www.acmicpc.net/problem/1758
난이도
실버4

민수 풀이

재현 풀이

송희 풀이

const fs = require("fs"); const filePath = process.platform === "linux" ? "/dev/stdin" : "./input.txt"; const [n, ...tips] = fs.readFileSync(filePath).toString().trim().split("\n"); let result = 0; tips.sort((a, b) => +b - +a); for (i = 0; i < tips.length; i++) { let tip = tips[i] - i; if (tip > 0) result += tip; else return console.log(result); } console.log(result);

승민 풀이