摘要: The inversion number of a given number sequence a1, a2, ..., an is the number of pairs (ai, aj) that satisfy i < j and ai > aj. For a given sequence o 阅读全文
posted @ 2017-02-13 21:55 perplex 阅读(166) 评论(0) 推荐(0) 编辑
摘要: 很多学校流行一种比较的习惯。老师们很喜欢询问,从某某到某某当中,分数最高的是多少。 这让很多学生很反感。 不管你喜不喜欢,现在需要你做的是,就是按照老师的要求,写一个程序,模拟老师的询问。当然,老师有时候需要更新某位同学的成绩。 Input本题目包含多组测试,请处理到文件结束。 在每个测试的第一行, 阅读全文
posted @ 2017-02-13 10:04 perplex 阅读(134) 评论(0) 推荐(0) 编辑
摘要: C国的死对头A国这段时间正在进行军事演习,所以C国间谍头子Derek和他手下Tidy又开始忙乎了。A国在海岸线沿直线布置了N个工兵营地,Derek和Tidy的任务就是要监视这些工兵营地的活动情况。由于采取了某种先进的监测手段,所以每个工兵营地的人数C国都掌握的一清二楚,每个工兵营地的人数都有可能发生 阅读全文
posted @ 2017-02-13 09:08 perplex 阅读(131) 评论(0) 推荐(0) 编辑
摘要: Nikita has a stack. A stack in this problem is a data structure that supports two operations. Operation push(x) puts an integer x on the top of the st 阅读全文
posted @ 2017-02-12 22:40 perplex 阅读(425) 评论(0) 推荐(0) 编辑
摘要: A new innovative ticketing systems for public transport is introduced in Bytesburg. Now there is a single travel card for all transport. To make a tri 阅读全文
posted @ 2017-02-12 22:35 perplex 阅读(392) 评论(0) 推荐(0) 编辑
摘要: Mahmoud and Ehab live in a country with n cities numbered from 1 to n and connected by n - 1 undirected roads. It's guaranteed that you can reach any 阅读全文
posted @ 2017-02-09 23:42 perplex 阅读(263) 评论(0) 推荐(0) 编辑
摘要: Mahmoud wants to write a new dictionary that contains n words and relations between them. There are two types of relations: synonymy (i. e. the two wo 阅读全文
posted @ 2017-02-09 23:36 perplex 阅读(424) 评论(0) 推荐(0) 编辑
摘要: Mahmoud wrote a message s of length n. He wants to send it as a birthday present to his friend Moaz who likes strings. He wrote it on a magical paper 阅读全文
posted @ 2017-02-09 23:30 perplex 阅读(312) 评论(0) 推荐(0) 编辑
摘要: 开始补题,今天下午virtual参赛,过了ABC,D题因为一点小错误而没能在比赛时间中AC,时间到了之后几分钟就发现了问题所在,略有遗憾。之后一直冥思苦想E题,在提示下终于明白,真的是给这样组合题画风的题目跪了,只能说继续加油,扩展思路吧。 A题 题目地址 只有奇偶数个数相差小于等于1时可以,需要特 阅读全文
posted @ 2017-02-06 22:13 perplex 阅读(207) 评论(0) 推荐(0) 编辑
摘要: 年后恢复训练参加的第一场,表现的不是很好,必须要赶紧振作起来了啊。 A、B题不再赘述。 C题 不要被树的形式吓到,实际上不需要换根DFS,只需要看两顶点颜色不同的线段即可。 D题 构造法,按矩形左下角横纵坐标奇偶性填颜色即可。(易证这样即可) E题 “ 大概就是,考虑任取Ai和Aj,作差Ai-Aj, 阅读全文
posted @ 2017-02-05 23:29 perplex 阅读(187) 评论(0) 推荐(0) 编辑