题意:有三个背包,每个背包里都用一些数字,你可以选择某一个背包的数字\(a\),从另外一个背包拿出\(b\)(拿出之后就没有了),然后将\(a\)替换为\(a-b\),你可以进行任意次这样的操作,使得最后只剩下一个数,问这个数最大能是多少. 题解:我的思路是,先任意选两个背包,假设\(x\)和\(y\),我们假设选\(x\)中的最大值,\(y\)中的最小值,很明显,我们让\(y\)的最小值减去没有选的背包的所有数和除了\(x\)最大值的所有数一定是最优的,但是\(y\)中除了最小值的其他数不好处…
Codeforces Round #521 (Div. 3)  E. Thematic Contests 题目传送门 题意: 现在有n个题目,每种题目有自己的类型要举办一次考试,考试的原则是每天只有一种题目类型一种题目类型只能出现在一天每天的题目类型不能相同,而且后一天的题目数量必须正好为前一天的两倍,第一天的题目数量是任意的求怎么安排能使题目尽量多.注意:不是天数尽量多 思路: 首先我们知道一件事,题目属于哪种类型并不重要,重要的是每种类型的个数所以我们先统计出所有类型的个数,存进一个数组,而…
比赛地址 A (水题) 题目链接 题目: 给出\(n\)个面板,每个面板初始时间相同,每过1s面板上数字会加1(数字在\(0\sim9\)循环播放),任意时刻选择一个面板\(x\)使他的时间停止,其他的面板\(y\)会在间隔\(|x-y|\)s以后停止,问从左到右顺序组成的数字序列所对应的十进制数最大值是多少? 解析: 只要最高位最大即可,因此首先需要最高位为9,那么次高位一定得是8,再次高位并不是7,因为可以在次高位为8时停止第二个面板构成989的序列 总结: 当\(n=1\)时,只输出9 当…
D. Fish Weight 题目连接: http://www.codeforces.com/contest/298/problem/D Description It is known that there are k fish species in the polar ocean, numbered from 1 to k. They are sorted by non-decreasing order of their weight, which is a positive number.…
A. Snow Footprints 题目连接: http://www.codeforces.com/contest/298/problem/A Description There is a straight snowy road, divided into n blocks. The blocks are numbered from 1 to n from left to right. If one moves from the i-th block to the (i + 1)-th blo…
C. Alternative Thinking Time Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/contest/604/problem/C Description Kevin has just recevied his disappointing results on the USA Identification of Cows Olympiad (USAICO) in the form of a binary…
A. Bits Time Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/contest/484/problem/A Description Let's denote as the number of bits set ('1' bits) in the binary representation of the non-negative integer x. You are given multiple queries…
https://codeforces.com/contest/1139/problem/F 题意 有m个人,n道菜,每道菜有\(p_i\),\(s_i\),\(b_i\),每个人有\(inc_j\),\(pref_j\),一个人可以买一道菜的条件是 1. \(p_i \leq inc_j \leq s_i\) 2. \(|b_i - pref_j| \leq inc_j-p_i\) ,问每个人分别能买多少道菜 题解 转化一下公式 \(p_i \leq inc_j \leq s_i\) 下面两个满…
B. Sort the Array 题目连接: http://codeforces.com/contest/451/problem/B Description Being a programmer, you like arrays a lot. For your birthday, your friends have given you an array a consisting of n distinct integers. Unfortunately, the size of a is to…
题目链接: http://codeforces.com/contest/606/problem/D D. Lazy Student time limit per test2 secondsmemory limit per test256 megabytes 问题描述 Student Vladislav came to his programming exam completely unprepared as usual. He got a question about some strange…