Codeforces-1000B B Light It Up

Recently, you bought a brand new smart lamp with programming features. At first, you set up a schedule to the lamp. Every day it will turn power on at moment 0 and turn power off at moment M. Moreover, the lamp allows you to set a program of switching its state (states are “lights on” and “lights off”). Unfortunately, some program is already installed into the lamp.

继续阅读Codeforces-1000B B Light It Up

Codeforces-1000A Codehorses T-shirts

 

Codehorses has just hosted the second Codehorses Cup. This year, the same as the previous one, organizers are giving T-shirts for the winners.

The valid sizes of T-shirts are either “M” or from 0 to 3 “X” followed by “S” or “L”. For example, sizes “M”“XXS”“L”“XXXL” are valid and “XM”“Z”“XXXXL” are not.

继续阅读Codeforces-1000A Codehorses T-shirts

SDAU暑假训练总结(2018/8/27)

暑假训练结束了,一共四周

    暑假过的很累,,但是也每天三点一线学了不少东西,所谓苦尽甘来大概就是这种感 觉。

    收获比起具体的知识点是思维的转变以及自学能力的逐步增强。

    缺点就是身体羸弱了点,到了第三周开始就撑不起来训练的上层建筑了,所以这个学期除了准备比赛,准备ACM,准备四级之外,每周也必须要拿出来时间来多多的锻炼身体,这个暑假让我发现,ACM除了比智力和努力之外比的还有体力,比如宋大佬和孙大佬都想通宵学习就通宵学习,而我一旦熬夜了对第二天影响很大。所以对我来说补一下短板是非常重要的。

    说到努力,我们队像是所有队里面最水的了,尤其是我懒得要死,对这个假期的自己提出批评,中间因为生了点病就给自己找借口减弱训练强度(可能突然见到很难的东西本能逃避),尤其是大饼说数学他负责,我和晨松一起搞别的之后,对数学的精力投入更是比别人少了。教练说我暑假没了上学期的钻研精神,这是一方面,另一方面可能是因为我对数学并不是很感兴趣,我大部分的学习动力几乎都来源于兴趣,兴趣包括了整个计算机系专业课还有自然科学之类的知识,所以对于专业课我都能钻下去,而且钻研的过程是快乐的,但是像数学这种基础理论,只有实用性这一个动力驱动我,说到底对于数学还是被动学习,没有达到“我想学”的境界。但是,数学基础支撑计算机的上层建筑,数学不好想学好计算机是不现实的,新学期我要尽量感受数学的乐趣,重新认识数学,化被动为主动,就算我真的对数学不感兴趣在最坏的情况下也得强迫自己去学。

    这暑假也是见到了学霸们的生活方式,从来没假期的见过,没有任何娱乐活动的见过,从晚上8点到第二天8点通宵刷题的见过,平均每1.5天就有一个留在613通宵学习的。我以前认为不可能的,现在有人证明给我看了。触动很大。

新学期开始了,时间更少了,往者不可谏,来者犹可追,暑假不如别人,现在开始弥补,还可以补救。

Codeforces-1004B. Sonya and Exhibition

Sonya decided that having her own hotel business is the best way of earning money because she can profit and rest wherever she wants.

The country where Sonya lives is an endless line. There is a city in each integer coordinate on this line. She has nn hotels, where the ii-th hotel is located in the city with coordinate xi. Sonya is a smart girl, so she does not open two or more hotels in the same city.

Sonya understands that her business needs to be expanded by opening new hotels, so she decides to build one more. She wants to make the minimum distance from this hotel to all others to be equal to dd. The girl understands that there are many possible locations to construct such a hotel. Thus she wants to know the number of possible coordinates of the cities where she can build a new hotel.

Because Sonya is lounging in a jacuzzi in one of her hotels, she is asking you to find the number of cities where she can build a new hotel so that the minimum distance from the original nn hotels to the new one is equal to d.

继续阅读Codeforces-1004B. Sonya and Exhibition