111qqz的小窝

老年咸鱼冲锋!

codeforces 12 C. Fruits

http://codeforces.com/contest/12/problem/C 题意:有n个价格价格,m个要买的东西(可能有相同的种类,设为k种),把n个标签中拿出k个给个贴上。。。问最大价钱和最少价钱分别是多少。 思路

codeforces 526 B Om Nom and Dark Park

http://codeforces.com/contest/526/problem/B 题意:有一棵完全二叉树。每条边上有一定数量的路灯。问最少需要添加多少个路灯。使得根节点道叶子节点的每一条路径上的路灯数量一样。 思路:同叶子

cf 596 B. Wilbur and Array

http://codeforces.com/problemset/problem/596/B 题意:初始序列全为0,问经过多少次变换,能变成序列b。一次变换是指,选定一个i,从i一直到最后每个元素都增加1,或者每个元素都减少1. 思路

codeforces 600 C. Make Palindrome

http://codeforces.com/problemset/problem/600/C 题意:给定一个字符串。要求用最少的变换得到一个回文串。且在变换次数相同时要字典序最小的。输出变换后的字符串。 思路:对不能构成会文串有影响的

codeforces 158 B. Taxi

http://codeforces.com/problemset/problem/158/B 题意:n组人,每组有si个(1<=si<=4),每辆车能装4个人。问最少需要多少辆车装下所有人并且保证同一组的人在一辆车里。 思

codeforces #334 div 2 B. More Cowbell

题意是说。给n个balls,k个箱子。保证(n<=2*k) 一个箱子中中最多放两个balls,size为两个balls的size之和。 所

best coder #56 div 2 A Clarke and minecraft(贪心)

贪心..尽量把一样的材料放在一起... 然后写蠢了..妈蛋... 详情见代码 /************************************************************************* > File Name: code/bc/#56/1001.cpp > Author: 111qqz > Email: rkz2013@126.com > Created Time: 2015年09月19日 星期六 18时55分

codeforces 558c Amr and Chemistry (贪心)

http://codeforces.com/contest/558/problem/C 题目大意是说,给定N个数,可以对任意数进行任意次两种操作,×2,和/2(整除) 问最少操作多少次,可以让所有数相等。 嘛,前半个小时A掉了前两

codeforces 479D. Long Jumps

http://codeforces.com/problemset/problem/479/D 题意是说有一把尺子,本身有一些刻度,然后需要测量x和y,问最少需要添加多少个刻度,如果需要,这些刻度分别添加在什么位置。 一开始没有看清题目

codeforces 525 B. Pasha and String

http://codeforces.com/problemset/problem/525/B fbdcea<br></br><br></br>题意是说一个字符串,进行m次颠倒变换(从a

codeforces 482 A. Diverse Permutation(构造)

C - C **Time Limit:**1000MS **Memory Limit:**262144KB 64bit IO Format:%I64d & %I64u Submit Status Description Permutation_p_ is an ordered set of integers _p_1, _p_2, …, _p__n_, consisting of _n_ distinct positive integers not larger than _n_. We'll denote as_n_ the length of permutation _p_1, _p_2, …, _p__n_. Your task is to find such permutation p of length n, that the group of numbers |_p_1 - _p_2|, |_p_2 - p_3|, …,

codeforces 47 C. Exams

http://codeforces.com/problemset/problem/479/C /* *********************************************** Author :111qqz Created Time :2016年02月22日 星期一 23时31分10秒 File Name :code/cf/problem/479C.cpp ************************************************ */ #include #include #include #include #include using namespace std; int n,ans; const int N=1E4+5; int a[N],b[N]; struct Q {int a,b; }q[N]; bool cmp(Q x, Q y) { if ( x.a<y.a) return true; if ( x.a==y.a

HDOJ 4882 Loves Codefires

ZCC Loves Codefires Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 988 Accepted Submission(s): 500 Problem Description Though ZCC has many Fans, ZCC himself is a crazy Fan of a coder, called “Memset137”. It was on Codefires(CF), an online competitive programming site, that ZCC knew Memset137, and immediately became his fan. But why? Because Memset137 can solve all problem in rounds, without unsuccessful submissions; his estimation

poj 1065 Wooden Sticks

Wooden Sticks Time Limit: 1000MS Memory Limit: 10000K Total Submissions: 19008 Accepted: 8012 Description There is a pile of n wooden sticks. The length and weight of each stick are known in advance. The sticks are to be processed by a woodworking machine in one by one fashion. It needs some time, called setup time, for the machine to prepare processing a stick. The setup times are associated with cleaning

codeforces 447 B. DZY Loves Strings

简单贪心。 因为填的字母没有次数限制,所以最优策略很容易想到,就是在最后面填最大的。 不用实际去填,算出ans就可以。 #include <iostream> #include <cmath> #include <cstring> #include <algorithm> using namespace std; int main()

hdu 1009 FatMouse' Trade

简单贪心…. 需要注意的是数据是非负,所以有0的情况要考虑周全,基本都要特殊处理。 多WA了三次,不知道为什么交C++可以过,交G