读懂题意就是水题,按照出现次数对下标排一下序,暴力.. #include<cstdio> #include<algorithm> #include<cstring> using namespace std; typedef long long ll; ; ll cnt[maxn]; ll r[maxn]; bool cmp(int a,int b) { return cnt[a] > cnt[b]; } int main() { int T; scanf(&quo…
题意:给一个nXm的矩阵,上面有一些数字,从左上角出发,每次只能往右或者往下,把沿途的数字加起来,求到达右下角的最大值是多少. 题解:简单的一个dp,设f[i][j]为到达i行j列的最大值,f[i][j] = max(f[i-1][j],f[i][j-1])+a[i][j],然后用队列刷表法. #include<cstdio> #include<cstring> #include<queue> using namespace std; typedef long long…
Problem C. ICPC GiveawaysTime Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/gym/100500/attachments Description During the preparation for the ICPC contest, the organizers prepare bags full of giveaways for the contestants. Each bag us…
Problem H. ICPC QuestTime Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/gym/100500/attachments Description Coach Fegla has invented a song effectiveness measurement methodology. This methodology in simple English means count the frequ…
题意:统计一些串中,字母的出现频率,不分大小写,找出现频率最高5个字符(相同频率优先取字典序大的),把他们的对应的值加起来判断以下是否大于62. 没出现的不算. #include<cstdio> #include<algorithm> #include<cstring> using namespace std; typedef long long ll; ]; ]; bool cmp(int a,int b) { return cnt[a]>cnt[b] || (…
C. CinderellaTime Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/gym/100685/problem/C Description Cinderella is given a task by her Stepmother before she is allowed to go to the Ball. There are N (1 ≤ N ≤ 1000) bottles with water in th…
Identity Checker 题目连接: http://codeforces.com/gym/100015/attachments Description You likely have seen that x(sin x +cos2 x) ! x = 0, and you may have seen that sin(2x) ! 2 sin x cos x =0. But did you know that tan (2x)(x ! x tan2 x) ! 2x tan x = 0? Wo…
Hall of Fame Time Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/gym/100500/attachments Description It was the second day of IBM Chill Zone, and it was the time for distributing the prizes. Unfortunately due to unknown reasons, the org…
B. Island Time Limit: 1 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/gym/100114 Description On February 30th this year astronauts from the International Space Station flew over the Pacific Ocean and took a picture, on which was discovered a pr…
Problem G.Giant ScreenTime Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://acm.hust.edu.cn/vjudge/contest/view.action?cid=86821#problem/G Description You are working in Advanced Computer Monitors (ACM), Inc. The company is building and selling giant c…