Don't make a promise when you are in Joy. Don't reply when you are Sad.Don't take decisions when you are Angry.Think Twice.Act Wise. 当你喜悦时,不要轻易地承诺.当你悲伤时,不要轻易地回复.当你愤怒时,不要轻易做出决定.三思而后行,明智之法.…
Joy of Flight 题目连接: http://codeforces.com/gym/100531/attachments Description Jacob likes to play with his radio-controlled aircraft. The weather today is pretty windy and Jacob has to plan flight carefully. He has a weather forecast - the speed and d…
B. A Lot of Joy Time Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/gym/100187/problem/A Description Two boys Gena and Petya wrote on two strips of paper the same string s that consisted of lowercase Latin letters. Then each boy took o…
Chords: C G Am Em F C Dm G C G Am Em F C Am Dm G English - O the joy of having nothing and being nothing, seeing nothing But a living Christ in glory, And being careful for nothing. O the joy of having nothing and being nothing, seeing nothing But a…
There are nn players sitting at the card table. Each player has a favorite number. The favorite number of the jj-th player is fjfj. There are k⋅nk⋅n cards on the table. Each card contains a single integer: the ii-th card contains number cici. Also, y…
F - Cards and Joy 思路:比较容易想到dp,直接dp感觉有点难,我们发现对于每一种数字要处理的情况都相同就是有 i 张牌 要给 j 个人分, 那么我们定义dp[ i ][ j ]表示 i 张牌给 j 个人分最大的价值可以得到dp方程如下: dp[ i ][ j ] = max(dp[ i - u ][ j - 1 ] + f[ u ] ) u <= k 暴力转移就好了. #include<bits/stdc++.h> #define LL long long #def…
F. Cards and Joy time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output There are nn players sitting at the card table. Each player has a favorite number. The favorite number of the jj-th player…
F. Cards and Joy 题目大意: 给你n个人,每一个人恰好选k张牌. 第一行是 n 和 k 第二行有n*k个数,代表有n*k张牌,每张牌上的数字 第三行有n个数,代表第i个人喜欢的数字 第四行有k个数,代表有如果一个人可以拿到 i 张喜欢的牌,那么快乐值+h[i] 然后就是让你分配这些牌来找最大的欢乐值. 这个题目仔细想想就知道,因为这个h数组是递增的,所以我们就是要尽量把这个人喜欢的牌分配给她. 如果一种牌喜欢的人只有一个,那就把这个类型都给她,但是如果有很多人喜欢一样的牌,那就要…