B a s e R a t i n g = P r o b l e m S c o r c e ∗ 0.5 + r a t i n g S c o r c e ∗ 0.4 + B l o g S c o r e ∗ 0.1 BaseRating =ProblemScorce*0.5+ratingScorce*0.4+BlogScore*0.1 BaseRating=ProblemScorce∗0.5+ratingScorce∗0.4+BlogScore∗0.1
P r o b l e m S c o r c e = P a s s P l o b l e m S u m ProblemScorce = PassPloblemSum ProblemScorce=PassPloblemSum
r a t i n g S c o r c e = ( A t c o d e R a t i n g + C o d e f o r c e s R a t i n g ) ∗ 0.1 ratingScorce=(AtcodeRating+CodeforcesRating)*0.1 ratingScorce=(AtcodeRating+CodeforcesRating)∗0.1
B l o g S c o r c e = B l o g N u m ∗ 2 BlogScorce=BlogNum*2 BlogScorce=BlogNum∗2
R a t i n g Rating Rating 将以(天\周\月)为单位作为一场比赛,进行迭代计算。
P r o b l e m S c o r e = e a s y ∗ 1 + b a s i c ∗ 2 + a d v a n c e d ∗ 3 + h a r d ∗ 4 + u n k n o w n ∗ 2 ProblemScore=easy∗1+basic∗2+advanced∗3+hard∗4+unknown∗2 ProblemScore=easy∗1+basic∗2+advanced∗3+hard∗4+unknown∗2
c o d e f o r c e s : codeforces : codeforces:
d = r a t i n g c f n e w − r a t i n g c f d=rating_{cf_{new}}-rating_{cf} d=ratingcfnew−ratingcf
r a t i n g S c o r e c f = { 1 , r a t i n g c f ≤ 600 , d ≥ 1 r a t i n g c f 400 + r a t i n g c f ∗ d 20000 , r a t i n g c f ≥ 601 , d ≥ 1 0 , d ≤ 0 ratingScore_{cf}= \begin{cases} 1,\quad rating_{cf}\leq 600,d \geq 1\\ \frac{rating_{cf}}{400}+\frac{rating_{cf}*d}{20000}, \quad rating_{cf}\geq 601,d \geq 1\\ 0,\quad d \leq 0 \end{cases} ratingScorecf=⎩ ⎨ ⎧1,ratingcf≤600,d≥1400ratingcf+20000ratingcf∗d,ratingcf≥601,d≥10,d≤0
A t c o d e r : Atcoder: Atcoder:
d = r a t i n g a t c n e w − r a t i n g a t c d=rating_{atc_{new}}-rating_{atc} d=ratingatcnew−ratingatc
r a t i n g S c o r e a t c = { 1 , r a t i n g a t c ≤ 400 , d ≥ 1 r a t i n g a t c 400 ⋅ ( 1 + d 50 ) , r a t i n g a t c ≥ 401 , d ≥ 1 r a t i n g a t c 400 ⋅ ( 1 + d 20 ) , r a t i n g a t c ≥ 1000 , d ≥ 1 0 , d ≤ 0 ratingScore_{atc}= \begin{cases} 1,\quad rating_{atc}\leq 400,d \geq 1\\ \frac{rating_{atc}}{400}\cdot(1+\frac{d}{50}), \quad rating_{atc}\geq 401,d \geq 1\\ \frac{rating_{atc}}{400}\cdot(1+\frac{d}{20}), \quad rating_{atc}\geq 1000,d \geq 1\\ 0,\quad d \leq 0 \end{cases} ratingScoreatc=⎩ ⎨ ⎧1,ratingatc≤400,d≥1400ratingatc⋅(1+50d),ratingatc≥401,d≥1400ratingatc⋅(1+20d),ratingatc≥1000,d≥10,d≤0
B l o g S c o r e = ∑ i = 1 n B l o g S c o r e i n BlogScore=\frac{\sum^{n}_{i=1} BlogScore_i}{n} BlogScore=n∑i=1nBlogScorei
A t t e n d a n c e S c o r e = 单位周期内出勤分钟数 AttendanceScore=单位周期内出勤分钟数 AttendanceScore=单位周期内出勤分钟数
ELO积分预期胜率计算公式
P ( D ) = 1 2 + ∫ 0 D 1 δ 2 π ⋅ e − x 2 2 δ 2 d x P(D)=\frac{1}{2}+\int_0^D \frac{1}{\delta\sqrt{2\pi}} \cdot e^{\frac{-x^2}{2\delta ^2}}dx P(D)=21+∫0Dδ2π1⋅e2δ2−x2dx
利用最小二乘法得到实际应用公式,其中 D D D 代表分差。
P ( D ) = 1 1 + 1 0 D 400 P(D)=\frac{1}{1+10^{\frac{D}{400}}} P(D)=1+10400D1
R A : p l a y e r A 的 r a t i n g R B : p l a y e r B 的 r a t i n g R_A:player A 的 rating ~~~~~~~~~~~~~~~~~~~~~~~~~~~R_B:player B 的 rating RA:playerA的rating RB:playerB的rating
E A = 1 1 + 1 0 R B − R A 400 E B = 1 1 + 1 0 R A − R B 400 E_A=\frac{1}{1+10^{\frac{R_B-R_A}{400}}}~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~E_B=\frac{1}{1+10^{\frac{R_A-R_B}{400}}} EA=1+10400RB−RA1 EB=1+10400RA−RB1
E A + E B = 1 E_A+E_B=1 EA+EB=1
S A = p r o b l e m S c o r e A p r o b l e m S c o r e A + p r o b l e m S c o r e B ⋅ 0.4 + r a t i n g S c o r e A r a t i n g S c o r e A + r a t i n g S c o r e B ∗ 0.3 + b l o g S c o r e A b l o g S c o r e A + b l o g S c o r e B ∗ 0.2 + A t t e n d a n c e S c o r e A A t t e n d a n c e S c o r e A + A t t e n d a n c e S c o r e B ∗ 0.1 S_A=\frac{problemScore_A}{problemScore_A+problemScore_B} \cdot 0.4+\frac{ratingScore_A}{ratingScore_A+ratingScore_B}*0.3+ \\ ~\\~~~~~~~~~~ \frac{blogScore_A}{blogScore_A+blogScore_B}*0.2+\frac{AttendanceScore_A}{AttendanceScore_A+AttendanceScore_B}*0.1 SA=problemScoreA+problemScoreBproblemScoreA⋅0.4+ratingScoreA+ratingScoreBratingScoreA∗0.3+ blogScoreA+blogScoreBblogScoreA∗0.2+AttendanceScoreA+AttendanceScoreBAttendanceScoreA∗0.1
S B = p r o b l e m S c o r e B p r o b l e m S c o r e A + p r o b l e m S c o r e B ⋅ 0.4 + r a t i n g S c o r e B r a t i n g S c o r e A + r a t i n g S c o r e B ∗ 0.3 + b l o g S c o r e B b l o g S c o r e A + b l o g S c o r e B ∗ 0.2 + A t t e n d a n c e S c o r e B A t t e n d a n c e S c o r e A + A t t e n d a n c e S c o r e B ∗ 0.1 S_B=\frac{problemScore_B}{problemScore_A+problemScore_B} \cdot 0.4+\frac{ratingScore_B}{ratingScore_A+ratingScore_B}*0.3+\\~\\~~~~~~~~~~~\frac{blogScore_B}{blogScore_A+blogScore_B}*0.2+\frac{AttendanceScore_B}{AttendanceScore_A+AttendanceScore_B}*0.1 SB=problemScoreA+problemScoreBproblemScoreB⋅0.4+ratingScoreA+ratingScoreBratingScoreB∗0.3+ blogScoreA+blogScoreBblogScoreB∗0.2+AttendanceScoreA+AttendanceScoreBAttendanceScoreB∗0.1
S A + S B = 1 S_A+S_B=1 SA+SB=1
R A n e w = R A + K ⋅ ( S A − E A ) R_{A_{new}}=R_A+K \cdot (S_A -E_A) RAnew=RA+K⋅(SA−EA)
K K K 暂定为 32 32 32,实际上 K K K 将随着用户 R a t i n g Rating Rating 的增加而减小。
R A n e w = R A + K ⋅ P A R_{A_{new}}=R_A+K \cdot P_A RAnew=RA+K⋅PA
P A = ∏ i = 排名低于 A 的用户 x ( S A i − E A i ) x − ∏ i = 排名高于 A 的用户 y ( E A i − S A i ) y P_A=\sqrt[x]{\prod^{x}_{i=排名低于A的用户}(S_{Ai}-E_{Ai})}-\sqrt[y]{\prod^{y}_{i=排名高于A的用户}(E_{Ai}-S_{Ai})} PA=x∏i=排名低于A的用户x(SAi−EAi)−y∏i=排名高于A的用户y(EAi−SAi)
由于 ( S A i − E A i ) (S_{Ai}-E_{Ai}) (SAi−EAi)并不是全为正数,因此通过分别计算对应的值做差为 P A P_A PA。
第一次:
a d j u s t = − 1 − ∑ K i ∗ P i n adjust=\frac{-1-\sum K_i*P_i}{n} adjust=n−1−∑Ki∗Pi
R i = R i + a d j u s t R_i=R_i+adjust Ri=Ri+adjust
保证所有人的平均变化接近 0 并且在 0 以下。
第二次:
m = m i n ( n , 4 n ) m=min(n,4\sqrt{n}) m=min(n,4n)
a d j u s t = m i n ( m a x ( − 1 − ∑ K i ∗ P i m , − 10 ) , 0 ) adjust=min(max(\frac{-1-\sum K_i*P_i}{m},-10),0) adjust=min(max(m−1−∑Ki∗Pi,−10),0)
取一个合理的 a d j u s t adjust adjust 使得前 m m m 个人的平均变化为 0。
R i = R i + a d j u s t ( i ≤ m ) R_i=R_i+adjust~~~~(i \leq m) Ri=Ri+adjust (i≤m)
本文参考了 c o d e f o r c e , a t c o d e r , E l o r a t i n g s y s t e m codeforce,atcoder,Elo~rating~system codeforce,atcoder,Elo rating system 的 r a t i n g rating rating 规则,以周期统计数据替代比赛场景,并根据应用场景进行修改,目前未进行样本测试。
可能测试后,还会对参数以及公式大改QAQ
参考
https://en.wikipedia.org/wiki/Elo_rating_system
https://www.luogu.com.cn/blog/ak-ioi/cf-at-rating
这里是Ruby新手。完成一些练习后碰壁了。练习:计算一系列成绩的字母等级创建一个方法get_grade来接受测试分数数组。数组中的每个分数应介于0和100之间,其中100是最大分数。计算平均分并将字母等级作为字符串返回,即“A”、“B”、“C”、“D”、“E”或“F”。我一直返回错误:avg.rb:1:syntaxerror,unexpectedtLBRACK,expecting')'defget_grade([100,90,80])^avg.rb:1:syntaxerror,unexpected')',expecting$end这是我目前所拥有的。我想坚持使用下面的方法或.join,
项目介绍随着我国经济迅速发展,人们对手机的需求越来越大,各种手机软件也都在被广泛应用,但是对于手机进行数据信息管理,对于手机的各种软件也是备受用户的喜爱小学生兴趣延时班预约小程序的设计与开发被用户普遍使用,为方便用户能够可以随时进行小学生兴趣延时班预约小程序的设计与开发的数据信息管理,特开发了小程序的设计与开发的管理系统。小学生兴趣延时班预约小程序的设计与开发的开发利用现有的成熟技术参考,以源代码为模板,分析功能调整与小学生兴趣延时班预约小程序的设计与开发的实际需求相结合,讨论了小学生兴趣延时班预约小程序的设计与开发的使用。开发环境开发说明:前端使用微信微信小程序开发工具:后端使用ssm:VU
我对如何计算通过{%assignvar=0%}赋值的变量加一完全感到困惑。这应该是最简单的任务。到目前为止,这是我尝试过的:{%assignamount=0%}{%forvariantinproduct.variants%}{%assignamount=amount+1%}{%endfor%}Amount:{{amount}}结果总是0。也许我忽略了一些明显的东西。也许有更好的方法。我想要存档的只是获取运行的迭代次数。 最佳答案 因为{{incrementamount}}将输出您的变量值并且不会影响{%assign%}定义的变量,我
给定一个nxmbool数组:[[true,true,false],[false,true,true],[false,true,true]]有什么简单的方法可以返回“该列中有多少个true?”结果应该是[1,3,2] 最佳答案 使用转置得到一个数组,其中每个子数组代表一列,然后将每一列映射到其中的true数:arr.transpose.map{|subarr|subarr.count(true)}这是一个带有inject的版本,应该在1.8.6上运行,没有任何依赖:arr.transpose.map{|subarr|subarr.in
给定两个大小相等的数组,如何找到不考虑位置的匹配元素的数量?例如:[0,0,5]和[0,5,5]将返回2的匹配项,因为有一个0和一个5共同;[1,0,0,3]和[0,0,1,4]将返回3的匹配项,因为0有两场,1有一场;[1,2,2,3]和[1,2,3,4]将返回3的匹配项。我尝试了很多想法,但它们都变得相当粗糙和令人费解。我猜想有一些不错的Ruby习惯用法,或者可能是一个正则表达式,可以很好地回答这个解决方案。 最佳答案 您可以使用count完成它:a.count{|e|index=b.index(e)andb.delete_at
Ruby中如何“一般地”计算以下格式(有根、无根)的JSON对象的数量?一般来说,我的意思是元素可能不同(例如“标题”被称为其他东西)。没有根:{[{"title":"Post1","body":"Hello!"},{"title":"Post2","body":"Goodbye!"}]}根包裹:{"posts":[{"title":"Post1","body":"Hello!"},{"title":"Post2","body":"Goodbye!"}]} 最佳答案 首先,withoutroot代码不是有效的json格式。它将没有包
目标我正在尝试计算自给定日期以来周的距离,而无需跳过任何步骤。我更喜欢用普通的Ruby来做,但ActiveSupport无疑是一个可以接受的选择。我的代码我写了以下内容,这似乎可行,但对我来说似乎还有很长的路要走。require'date'DAYS_IN_WEEK=7.0defweeks_sincedate_stringdate=Date.parsedate_stringdays=Date.today-dateweeks=days/DAYS_IN_WEEKweeks.round2endweeks_since'2015-06-15'#=>32.57ActiveSupport的#weeks
技术选型1,前端小程序原生MINA框架cssJavaScriptWxml2,管理后台云开发Cms内容管理系统web网页3,数据后台小程序云开发云函数云开发数据库(基于MongoDB)云存储4,人脸识别算法基于百度智能云实现人脸识别一,用户端效果图预览老规矩我们先来看效果图,如果效果图符合你的需求,就继续往下看,如果不符合你的需求,可以跳过。1-1,登录注册页可以看到登录页有注册入口,注册页如下我们的注册,需要管理员审核,审核通过后才可以正常登录使用小程序1-2,个人中心页登录成功以后,我们会进入个人中心页我们在个人中心页可以注册人脸,因为我们做人脸识别签到,需要先注册人脸才可以进行人脸比对,进
我有以下代码#coloursarandomcellwithacorrectcolourdefcolour_random!whiletruedocol,row=rand(columns),rand(rows)cell=self[row,col]ifcell.empty?thencell.should_be_filled??cell.colour!(1):cell.colour!(0)breakendendend做什么并不重要,尽管它应该很明显。关键是Rubocop给了我一个警告Neveruse'do'withmulti-line'while为什么我不应该那样做?那我该怎么办呢?
如何计算两个字符串之间的字符交集?例如(假设我们有一个名为String.intersection的方法):"abc".intersection("ab")=2"hello".intersection("hallo")=4好的,男孩女孩们,感谢你们的大量反馈。更多示例:"aaa".intersection("a")=1"foo".intersection("bar")=0"abc".intersection("bc")=2"abc".intersection("ac")=2"abba".intersection("aa")=2一些补充说明:维基百科定义intersection如下:Int