Skip to content

Commit 4819af8

Browse files
committed
fix: 딕셔너리 키 접근 에러 해결하기 위해 scoreboard의 구조를 일관되게 "users" 하위로 관리하도록 수정
1 parent 31a421b commit 4819af8

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

_MonthlyChallenges/update_scoreboard.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,16 +62,18 @@ def main():
6262
continue
6363

6464
print(f"username: {username}, algorithm: {algorithm}, problem_id: {problem_id}")
65-
65+
print(f"users: {users}")
6666
# 챌린지 유형에 포함되어 있는지 확인 (예: "그래프", "DP")
6767
if algorithm not in CHALLENGE_TYPES:
6868
continue # 챌린지 대상이 아니면 무시
6969

7070
# 사용자의 기록이 없으면 초기화
71+
print("사용자의 기록이 없으면 초기화")
7172
if username not in users:
72-
scoreboard[username] = initialize_user()
73+
users[username] = initialize_user()
7374

7475
# 해당 유형 문제 번호를 중복 없이 추가
76+
print("해당 유형 문제 번호를 중복 없이 추가")
7577
if problem_id not in users[username].get(algorithm, []):
7678
users[username][algorithm].append(problem_id)
7779

0 commit comments

Comments
 (0)