A. Important Exam 水题 #include<iostream> #include<string.h> #include<algorithm> #include<stdio.h> using namespace std; ; char a[maxx][maxx]; int pre[maxx]; int b[maxx]; int main(){ int n,m; while(~scanf("%d%d",&n,&…
比赛链接:https://codeforc.es/contest/1201 A. Important Exam 题意:有\(n\)个人,每个人给出\(m\)个答案,每个答案都有一个分值\(a_i\),每个问题的正确答案不确定,询问最大可能的得分为多少. 分析:对于每个问题贪心最大数量就好. AC代码: #include <bits/stdc++.h> #define SIZE 500007 #define rep(i, a, b) for(int i = a; i <= b; ++i)…
B. Maximum Submatrix 2 Time Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/problemset/problem/375/B Description You are given a matrix consisting of digits zero and one, its size is n × m. You are allowed to rearrange its rows. What is…
B. Maximum Value Time Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/contest/484/problem/B Description You are given a sequence a consisting of n integers. Find the maximum possible value of (integer remainder of ai divided by aj), whe…
E. Maximum Matching 题目链接:https://codeforces.com/contest/1038/problem/E 题意: 给出n个项链,每条项链左边和右边都有一种颜色(范围1~4),然后每条项链都有对应的价值. 现在你可以任意改变项链的位置,也可以交换左右两边的颜色,问怎么做才能得到最大的价值.一条项链得到价值,就要求其左边的颜色和左边的项链右边颜色相等,并且右边的颜色和右边项链左边的颜色相等. 题解: 分析就可以发现这个题就是找一条权值最大的欧拉路径(每条边刚好经…
D. Maximum Value You are given a sequence a consisting of n integers. Find the maximum possible value of (integer remainder of ai divided byaj), where 1 ≤ i, j ≤ n and ai ≥ aj. Input The first line contains integer n — the length of the sequence…