42 (@rs42) 在 cdk站 社区分数计算方式 中发帖

徽章参考此处 
cdk在进行社区分数计数统计时会使用如下代码 
func (u *User) CalculateUserScore(badges []Badge, badgeScores map[int]int) int {
    var totalScore int
    for _, badge := range badges {
        if score, exists := badgeScores[badge.ID]; exists {
            totalScore += score
        }
    }
    return totalScore - int(config.Config.ProjectApp.DeductionPerOffense)*int(u.ViolationCount)
}


Score = \sum_{b \in...
 
 
Back to Top