枚举
文章平均质量分 69
第一周枚举专题
libulala
算法练习
展开
-
Make a Square
Make a SquareYou are given a positive integer n, written without leading zeroes (for example, the number 04 is incorrect).In one operation you can delete any digit of the given integer so that the result remains a positive integer without leading zeros.原创 2021-01-26 15:10:55 · 519 阅读 · 0 评论 -
多边形角度
Polygon for the AngleYou are given an angle ang.The Jury asks You to find such regular n-gon (regular polygon with n vertices) that it has three vertices a, b and c (they can be non-consecutive) with ∠abc=ang or report that there is no such n-gon.If the原创 2021-01-26 15:11:07 · 374 阅读 · 0 评论 -
Pairs
PairsToad Ivan has m pairs of integers, each integer is between 1 and n, inclusive. The pairs are (a1,b1),(a2,b2),…,(am,bm).He asks you to check if there exist two integers x and y (1≤x<y≤n) such that in each given pair at least one integer is equal t原创 2021-01-26 15:11:17 · 118 阅读 · 0 评论 -
奖牌数
Beautiful Regional ContestSo the Beautiful Regional Contest (BeRC) has come to an end! n students took part in the contest. The final standings are already known: the participant in the i-th place solved pi problems. Since the participants are primarily s原创 2021-01-26 15:11:31 · 273 阅读 · 0 评论 -
Photo of The Sky
Photo of The SkyPavel made a photo of his favourite stars in the sky. His camera takes a photo of all points of the sky that belong to some rectangle with sides parallel to the coordinate axes.Strictly speaking, it makes a photo of all points with coordi原创 2021-01-26 15:11:57 · 106 阅读 · 0 评论 -
滑雪场设计
滑雪场设计农夫约翰的农场上有 N 个山丘,每座山的高度都是整数。在冬天,约翰经常在这些山上举办滑雪训练营。不幸的是,从明年开始,国家将实行一个关于滑雪场的新税法。如果滑雪场的最高峰与最低峰的高度差大于17,国家就要收税。为了避免纳税,约翰决定对这些山峰的高度进行修整。已知,增加或减少一座山峰 x 单位的高度,需要花费 x2 的金钱。约翰只愿意改变整数单位的高度。请问,约翰最少需要花费多少钱,才能够使得最高峰与最低峰的高度差不大于17。输入格式第一行包含整数 N。接下来 N 行,每行包含原创 2021-01-26 15:11:45 · 173 阅读 · 0 评论