【codeforces】 Far Relative’s Problem
2016-07-23 21:12
337 查看
这不能算贪心题吧
#include<stdio.h> #include<string.h> #include<algorithm> using namespace std; int a[380],m1[380],m2[380]; int main() { int n; while(scanf("%d",&n)!=EOF) { int began,end; char c; memset(a,0,sizeof(a)); memset(m1,0,sizeof(m1)); memset(m2,0,sizeof(m2)); for(int l=0; l<n; l++) { getchar(); scanf("%c%d%d",&c,&began,&end); if(c=='M') for(int j=began; j<=end; j++) m1[j]++; else for(int j=began; j<=end; j++) m2[j]++; } for(int l=0; l<380; l++) { a[l]=2*min(m1[l],m2[l]); } printf("%d\n",*max_element(a,a+380)); } return 0; }
http://acm.hust.edu.cn/vjudge/contest/123357#problem/H
相关文章推荐
- Codeforces Round #197 (Div. 2)
- Codeforces Round #198 (Div. 1)
- Codeforces 405E Codeforces Round #238 (Div. 2)E
- Codeforces 407C Codeforces Round #239 (Div. 1)C
- CodeForces 449A - Jzzhu and Chocolate
- CodeForces 449 B. Jzzhu and Cities
- codeforces 618C. Constellation
- Codeforces Round #349 (Div. 2) - C
- Codeforces Round #361 (Div. 2)
- 7.13Codeforces Round #360 (Div. 2)
- Codeforces Round #363 (Div. 2)
- Codeforces Round #265 (Div. 2)
- Codeforces #310 div2 C. Case of Matryoshkas
- 状态压缩DP codeforces 244 Problem C. The Brand New Function 和 codeforces 165 E. Compatible Numbers
- codeforces 16 Problem E fish
- Codeforces Round332 部分题解
- CodeForces 603A_Alternative Thinking (DP)
- CodeForces 602B_Approximating a Constant Range_DP
- Codeforces round #247 for Div. 2
- Codeforces Round #246 (Div. 2)