diff --git a/tle/cogs/codeforces.py b/tle/cogs/codeforces.py index 47d86569..362a98b6 100644 --- a/tle/cogs/codeforces.py +++ b/tle/cogs/codeforces.py @@ -19,6 +19,8 @@ _GITGUD_NO_SKIP_TIME = 3 * 60 * 60 _GITGUD_SCORE_DISTRIB = (2, 3, 5, 8, 12, 17, 23) _GITGUD_MAX_ABS_DELTA_VALUE = 300 +#Minimum rating so that beginners can solve 800-1300 problems. Can change(maybe) to 1100, so they can solve 800-1400. No problem on codeforces with <800 rating +_GITGUD_MIN_RATING = 1000 class CodeforcesCogError(commands.CommandError): @@ -71,6 +73,8 @@ async def upsolve(self, ctx, choice: int = -1): handle, = await cf_common.resolve_handles(ctx, self.converter, ('!' + str(ctx.author),)) user = cf_common.user_db.fetch_cf_user(handle) rating = round(user.effective_rating, -2) + #minimum rating so that beginners can solve problems + rating = max(rating, _GITGUD_MIN_RATING) resp = await cf.user.rating(handle=handle) contests = {change.contestId for change in resp} submissions = await cf.user.status(handle=handle) @@ -225,6 +229,8 @@ async def gitgud(self, ctx, delta: int = 0): handle, = await cf_common.resolve_handles(ctx, self.converter, ('!' + str(ctx.author),)) user = cf_common.user_db.fetch_cf_user(handle) rating = round(user.effective_rating, -2) + #minimum rating so that beginners can solve problems + rating = max(rating, _GITGUD_MIN_RATING) submissions = await cf.user.status(handle=handle) solved = {sub.problem.name for sub in submissions} noguds = cf_common.user_db.get_noguds(ctx.message.author.id)