题意:n个人,在规定时间范围内,找到最多有多少对男女能一起出面。

思路:ans=max(2*min(一天中有多少个人能出面))

 #include<iostream>
#include<string>
#include<algorithm>
#include<cstdlib>
#include<cstdio>
#include<set>
#include<map>
#include<vector>
#include<cstring>
#include<stack>
#include<cmath>
#include<queue>
#define clc(a,b) memset(a,b,sizeof(a))
#include <bits/stdc++.h>
using namespace std;
#define LL long long int main()
{
int n;
int p[][];
scanf("%d",&n);
clc(p,);
for(int i=; i<=n; i++)
{
char c;
int l,r;
getchar();
scanf("%c%d%d",&c,&l,&r);
if(c=='M')
{
for(int j=l; j<=r; j++)
p[][j]++;
}
else
{
for(int j=l; j<=r; j++)
p[][j]++;
}
}
int ans=;
for(int i=; i<=; i++)
ans=max(ans,*min(p[][i],p[][i]));
cout<<ans<<endl;
return ;
}

Codeforces Round #343 (Div. 2) B. Far Relative’s Problem的更多相关文章

  1. Codeforces Round #343 (Div. 2) B. Far Relative’s Problem 暴力

    B. Far Relative's Problem 题目连接: http://www.codeforces.com/contest/629/problem/B Description Famil Do ...

  2. Codeforces Round #343 (Div. 2) A. Far Relative’s Birthday Cake 水题

    A. Far Relative's Birthday Cake 题目连接: http://www.codeforces.com/contest/629/problem/A Description Do ...

  3. Codeforces Round #343 (Div. 2)-629A. Far Relative’s Birthday Cake 629B. Far Relative’s Problem

    A. Far Relative's Birthday Cake time limit per test 1 second memory limit per test 256 megabytes inp ...

  4. Codeforces Round #343 (Div. 2) A. Far Relative’s Birthday Cake【暴力/组合数】

    A. Far Relative’s Birthday Cake time limit per test 1 second memory limit per test 256 megabytes inp ...

  5. Codeforces Round #343 (Div. 2) A. Far Relative’s Birthday Cake

    水题 #include<iostream> #include<string> #include<algorithm> #include<cstdlib> ...

  6. Codeforces Round #343 (Div. 2) B

    B. Far Relative’s Problem time limit per test 2 seconds memory limit per test 256 megabytes input st ...

  7. Codeforces Round #343 (Div. 2)

    居然补完了 组合 A - Far Relative’s Birthday Cake import java.util.*; import java.io.*; public class Main { ...

  8. Codeforces Round #343 (Div. 2)【A,B水题】

    A. Far Relative's Birthday Cake 题意: 求在同一行.同一列的巧克力对数. 分析: 水题~样例搞明白再下笔! 代码: #include<iostream> u ...

  9. Codeforces Round #343 (Div. 2) E. Famil Door and Roads lca 树形dp

    E. Famil Door and Roads 题目连接: http://www.codeforces.com/contest/629/problem/E Description Famil Door ...

随机推荐

  1. git fork同步原作者

    从github上获取源代码,一种是直接下载,但是无法改动后提交. 一种是fork一下,但是和原作者同步麻烦. 所以我找到了四个命令,解决同步问题. 以后建议大家fork一下,主要是哪天对源码熟悉了,想 ...

  2. E8.Net工作流平台之中国特色

     特色之一领导排名有先后 领导排名是有潜规则的,不论是在企业通讯录中,还是企业员工目录中,不管在流程执行过程中,还是存档数据中,当前领导的排名一定要按潜规则展示,不能随便罗列.E8.Net工作流解决了 ...

  3. NGUI系列教程六(技能冷却的CD效果)

    今天来学习一下,如何利用NGUI做技能冷却的CD效果. 1,首先按之前的教程Create Your UI,Camera为Simple 2D 最终如下图: 2,添加一个按钮,Background 为一张 ...

  4. py2exe把python程序转换exe

    1.首先下载py2exe:https://sourceforge.net/projects/py2exe/ 2.假设要打包的python 文件放在C:\packet路径下 如 果你有一个名为myscr ...

  5. js展开更多

    var introduces = { inIt : function(){ introduces.imgLoad(); introduces.showMore(0,'hioh',86); introd ...

  6. [转载]Asp.net MVC2 与 MVC3 路由调试好帮手RouteDebug 与 RouteDebugger

    RouteDebug 与 RouteDebugger是什么? 在Asp.Net MVC程序中,路由(Route)是一个非常核心的概念,可以说是MVC程序的入口,因为每一个Http请求都要经过路由计算, ...

  7. 如何设置、查看以及调试core文件

    http://blog.csdn.net/xiaoxiaoniaoer1/article/details/7740820 1.core文件的生成开关和大小限制--------------------- ...

  8. 一位IT行业高收入者的理财规划方案

    一位IT行业高收入者的理财规划方案 http://zhuanlan.zhihu.com/invest/19670220 Alex · 12 天前 回望2013,这一年是极其不寻常的.理财浪潮席卷大江南 ...

  9. 怎么修改tomcat默认访问首页

    一般情况下安装好tomcat之后我们的默认访问首页是index了,但我们如果要修改或增加一个默认首页,我们可参考下面办法来解决. 通过 ip:port 访问到的是 tomcat 的管理页面,其他常规部 ...

  10. ANDROID_MARS学习笔记_S02_006_APPWIDGET2_PendingIntent及RemoteViews实现widget绑定点击事件

    一.代码流程 1.ExampleAppWidgetProvider的onUpdate(Context context, AppWidgetManager appWidgetManager, int[] ...