CodeForces 668B – Little Artem and Dance [规律]


Link 传送门 Problem Little Artem is fond of dancing. Most of all dances Artem likes rueda — Cuban dance that is danced by pairs of boys and girls forming a circle and dancing together. More detailed, there are n pairs of boys and girls standing i...

CodeForces 668B – Little Artem and Dance [规律]

Link 传送门 Problem Little Artem is fond of dancing. Most of all dances Artem likes rueda — Cuban dance that is danced by pairs of boys and girls ...
阅读全文 0

CodeForces 660E – Different Subsets For All Tuples [DP]


Link 传送门 Problem For a sequence a of n integers between 1 and m, inclusive, denote f(a) as the number of distinct subsequences of a (including the empty subsequence). You are given two positive integers n and m. Let S be the set of all sequenc...

CodeForces 660E – Different Subsets For All Tuples [DP]

Link 传送门 Problem For a sequence a of n integers between 1 and m, inclusive, denote f(a) as the number of distinct subsequences of a (including ...
阅读全文 0

CodeForces 651D – Watchmen [二分]


Link 传送门 Problem Vasya’s telephone contains n photos. Photo number 1 is currently opened on the phone. It is allowed to move left and right to the adjacent photo by swiping finger over the screen. If you swipe left from the first photo, y...

CodeForces 651D – Watchmen [二分]

Link 传送门 Problem Vasya’s telephone contains n photos. Photo number 1 is currently opened on the phone. It is allowed to move left and righ...
阅读全文 0

CodeForces 651C – Watchmen [规律+容斥]


Link 传送门 Problem Watchmen are in a danger and Doctor Manhattan together with his friend Daniel Dreiberg should warn them as soon as possible. There are n watchmen on a plane, the i-th watchman is located at point (xi, yi). They need to arran...

CodeForces 651C – Watchmen [规律+容斥]

Link 传送门 Problem Watchmen are in a danger and Doctor Manhattan together with his friend Daniel Dreiberg should warn them as soon as possible....
阅读全文 0

CodeForces 589G – Hiring [排序+离线+二分+BIT]


Link 点击打开codeforces题目链接 Problem The head of human resources department decided to hire a new employee. He created a test exercise for candidates which should be accomplished in at most m working days. Each candidate has to pass this test e...

CodeForces 589G – Hiring [排序+离线+二分+BIT]

Link 点击打开codeforces题目链接 Problem The head of human resources department decided to hire a new employee. He created a test exercise for candi...
阅读全文 0

CodeForces 66C – Petya and File System


点击打开Codeforces题目链接 题意 给你一些文件的路径,让你找出包含子文件夹最多的文件夹,和子文件最多的文件夹,其中子文件夹和子文件可以是递归意义上的。硬盘符不算文件夹 分析 Python大法好,处理字符串就是爽。统计文件和文件夹即可,包含数量最多的文件夹一...

CodeForces 66C – Petya and File System

点击打开Codeforces题目链接 题意 给你一些文件的路径,让你找出包含子文件夹最多的文件夹,和子文件最多的文件夹,其中子文件夹和子文件可以是递归意义上的...
阅读全文 0

CodeForces 376C – Divisible by Seven


点击打开codeforces题目链接 题意 给你一个不长于10^6个数字的数,其中肯定包含1,6,8,9这几个数字,现在让你重新排列这些数字,使得这个数能够被7整除 分析 1,6,8,9这几个数字的各种排列能够凑出模为0~6的数,那么只需要前面使用所有其他的数字,最后补上1689即可 C+...

CodeForces 376C – Divisible by Seven

点击打开codeforces题目链接 题意 给你一个不长于10^6个数字的数,其中肯定包含1,6,8,9这几个数字,现在让你重新排列这些数字,使得这个数能够被7整除 分析 1...
阅读全文 0

CodeForces 387C – George and Number [贪心]


点击打开Codeforces题目链接 题意 一个数列,可以任选两个数字,大数在前小数在手合并后放在数列最后,然后删除这两个数字。经过若干次操作后数列变成一个数。给你这样的最后的数,问你初始数列最多可能有多少个数字 分析 倒着想这个数的形成过程。逐步从后往前贪心...

CodeForces 387C – George and Number [贪心]

点击打开Codeforces题目链接 题意 一个数列,可以任选两个数字,大数在前小数在手合并后放在数列最后,然后删除这两个数字。经过若干次操作后数列变成一个数...
阅读全文 0

Codeforces Round #318 (Div. 2)


这次也是后来补的,只做了前三道题,ACM练到这个时候,应该多专门做做第3、4题了 A. Bear and Elections 点击打开题目链接 有一些人在拉投票,第一个人想要选票大于所有其他人,可以贿赂投票人,问你最少贿赂多少人。直接用优先队列,优先贿赂票数最多的人。 #inc...

Codeforces Round #318 (Div. 2)

这次也是后来补的,只做了前三道题,ACM练到这个时候,应该多专门做做第3、4题了 A. Bear and Elections 点击打开题目链接 有一些人在拉投票,第一个人想要...
阅读全文 0

Codeforces Round #313 (Div. 2)


题目链接 这是后来补的题,感觉这次比较简单吧,以前都是做到第三道做不动了,这次做第五道超时做不懂了,貌似得用一些数学定理,而不是简单的dp。 A. Currency System in Geraldion A magic island Geraldion, where Gerald lives, has its own currency system....

Codeforces Round #313 (Div. 2)

题目链接 这是后来补的题,感觉这次比较简单吧,以前都是做到第三道做不动了,这次做第五道超时做不懂了,貌似得用一些数学定理,而不是简单的dp。 A. Curre...
阅读全文 1