Ranking System

一家知名软件公司升级了其即时通讯应用,并引入了用户群体排名系统,根据成员的活跃度来分配等级。等级由成员在群组中的分数决定,分数高者等级高。若分数相同,则按加入群组的先后顺序和用户ID大小决定等级。任务是编写程序计算群组中每个成员的等级。
摘要由CSDN通过智能技术生成

Few weeks ago, a famous software company has upgraded its instant messaging software. A ranking system was released for user groups. Each member of a group has a level placed near his nickname. The level shows the degree of activity of a member in the group.

Each member has a score based his behaviors in the group. The level is determined by this method:

Level Percentage The number of members in this level
LV1 / All members whose score is zero
LV2 / All members who can not reach level 3 or higher but has a positive score
LV3 30% ⌊(The number of members with a positive score) * 30%⌋
LV4 20% ⌊(The number of members with a positive score) * 20%⌋
LV5 7% ⌊(The number of members with a positive score) * 7%⌋
LV6 3% ⌊(The number of members with a positive score) * 3%⌋
  • x⌋ is the maximum integer which is less than or equal to x.
  • The member with the higher score will get the higher level. If two members have the same score, the earlier one who joined the group will get the higher level. If there is still a tie, the user with smaller ID will
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值