分类目录归档:CodeForces

Codeforces Round#371 Div.2

A. Meeting of Old Friends

Today an outstanding event is going to happen in the forest — hedgehog Filya will come to his old fried Sonya!

Sonya is an owl and she sleeps during the day and stay awake from minute l1 to minute r1 inclusive. Also, during the minute k she prinks and is unavailable for Filya.

Filya works a lot and he plans to visit Sonya from minute l2 to minute r2 inclusive.

Calculate the number of minutes they will be able to spend together.

继续阅读

CodeForces Round #350 Solution

这场比赛比较水,但是细节比较多,而我没考虑T_T

一个是先入为主坑了我的B题,我没有计算时间复杂度而导致采用了较繁而且容易挂的算法,wa了4发

C题是因为我没能考虑到特殊情况而苦于wa on 14,7 times

如果没有这两个错误说不定能大涨分= =

这些错误都是值得我思考以及改正的,好了,切入正题

继续阅读

CodeForces Round#349 Div.2

A.Pouring Rain

设第x秒会喝完,每秒会增加e\;cm,减少\frac{v}{r^{2}\pi}\;cm,原来相差h\;cm,这就是个追击问题,容易得到方程

(\frac{v}{r^{2}\pi}-e)\times\;x=h

解之即可

B.Coat of Anticubism

考虑题目给出的性质:“初始数据保证一定不能组成凸多边形”

结论:先对原数组排序,然后答案为

a[n]-\sum_{i=1}^{n-1}a[i]\;+1

继续阅读