CodeforcesRound#708

unrated     阅读全文
MorphLing's avatar
MorphLing 3月 18, 2021

Codeforces Round#643 1355E.Restorer Distance(三分/二分)

题目描述:E. Restorer Distance time limit per test 1 second memory limit per test 256 megabytes You have to restore the wall. The wall consists of N pillars of bricks, the height of the i-th pillar is initially equal to hi, the height is measured in number of bricks. After the restoration all the N pillars should have equal heights. You are allowed the following operations: put a brick on top of one pillar, the cost of this operation is A;remove a brick from the top of one non-empty pillar, the cost of this operation is R;move a brick from the top of one non-empty pillar to the top of another pillar, the cost of this operation is M.You cannot create additional pillars or ignore some of pre-existing pillars even if their height becomes 0. What is the minimal total cost of restoration, in other words, what is the minimal total cost to make all the pillars of equal height? InputThe first line of input contains four integers N, A, R, M (1≤N≤105, 0≤A,R,M≤104) — the number of pillars and the costs of operations. The second line contains N integers hi (0≤hi≤109) — initial heights of pillars. OutputPrint one integer — the minimal cost of restoration.     阅读全文
MorphLing's avatar
MorphLing 5月 18, 2020

Codeforces Round#639 1345D.Monopole Magnets(构造)

题目描述:E. Kaavi and Magic Spell time limit per test 2 seconds memory limit per test 512 megabytes Kaavi, the mysterious fortune teller, deeply believes that one’s fate is inevitable and unavoidable. Of course, she makes her living by predicting others’ future. While doing divination, Kaavi believes that magic spells can provide great power for her to see the future.     阅读全文
MorphLing's avatar
MorphLing 5月 08, 2020

Codeforces Round#639 1345D.Monopole Magnets(构造)

最近一个月基本处在只偶尔打下contest不刷题的状态,结果就是把把拉胯 于是rating 这还是幸亏本场unrated了。让人不禁感叹这就是努力型选手吗,真是有够好笑的呢 痛定思痛,为了督促自己不要疏于练习,定个小目标,以后把每次contest最后做不出来(或者很勉强做出来)的题自己再好好理解总结一下(看难度和题数尽量做到Div.2的D或E题,1900-2200的),参考内容包括但不仅限于出题人给出的tutorial和别人的ac代码以及其他非官方的题解。     阅读全文
MorphLing's avatar
MorphLing 5月 07, 2020