We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
💬 문제
https://www.acmicpc.net/problem/20006
💬 Idea
💬 풀이
func solution200006() { let pm = readLine()!.split(separator: " ").map({ Int(String($0))! }) var roomArr: [(Int, Int)] = [] var roomInfo: [Int: [(Int, String)]] = [:] for _ in 0..<pm[0] { let p = readLine()!.split(separator: " ").map({ String($0) }) let level = Int(p[0])! let id = p[1] var room = -1 for (idx, r) in roomArr.enumerated() { if level >= r.0 && level <= r.1 && roomInfo[idx]!.count < pm[1] { room = idx roomInfo[idx]!.append((level, id)) break } } if room == -1 { // 새로운 방 생성 roomArr.append((level - 10, level + 10)) roomInfo[roomArr.count - 1] = [(level, id)] } } for (idx, _) in roomArr.enumerated() { if roomInfo[idx]!.count == pm[1] { print("Started!") } else { print("Waiting!") } for j in roomInfo[idx]!.sorted(by: { $0.1 < $1.1 }) { print("\(j.0) \(j.1)") } } }
소요시간 : 29분
소요시간
The text was updated successfully, but these errors were encountered:
#207 - 랭킹전 대기열 문제 풀이
cbe627e
67d41e9
hwangJi-dev
No branches or pull requests
💬 문제
https://www.acmicpc.net/problem/20006
💬 Idea
💬 풀이
소요시간
: 29분The text was updated successfully, but these errors were encountered: