题意: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. Delphi XE2及以后的版本编译后的程序大小问题

    说说Delphi XE2及以后的版本编译后的程序大小问题. 其实最终得到的程序并不大,由于编译器的变化,XE2里Debug版程序比Release版程序大很多,要减小程序体积,就使用Release版.下 ...

  2. twisted internet.reactor部分 源码分析

    twisted.internet.reactor 是进行所有twisted事件循环的地方. reactor在1个python进程中只能有一个. 在windows下用的是select.linux下epo ...

  3. boost linux 下安装

    1. 在boost 官网 http://www.boost.org/doc/libs/ 下载最新的boost 安装包 2. 解压至 /usr/local/ 目录下 3. cd /usr/local/b ...

  4. 【Scala 】Akka库

    简介编辑 Akka 是一个用 Scala 编写的库,用于简化编写容错的.高可伸缩性的 Java 和 Scala 的 Actor 模型应用.它已经成功运用在电信行业.系统几乎不会宕机(高可用性 99.9 ...

  5. MVC-ActionResult解说

    HttpNotFoundResult: 专门用来响应Http404找不到网页的错误,在System.Web.Mvc.Controller类别中内建了一个HttpNotFound()方法,可以很方便的回 ...

  6. ASP.NET MVC NHibernate 整合

    请注明转载地址:http://www.cnblogs.com/arhat 在整合这三个技术之前,首先得说明一下整合的步骤,俗话说汗要一口一口吃,事要一件一件做.同理这个三个技术也是.那么在整合之前,需 ...

  7. Qt 5 常见错误汇总

    1.没加 QT+=sql,需要再.pro文件中加上 2.无故崩溃,这个有多种原因,多为指针问题,例如,指针内存泄露,指针未开辟空间直接使用,UI还未建立就使用UI里面的东西..等等 3.Sql问题,有 ...

  8. spring的主要特性

    一.简化java开发.为了降低java开发的复杂性,Spring采取了以下4种关键策略: 1.基于POJO的轻量级和最小侵入性编程. 2.通过依赖注入和面向接口实现松耦合. 3.基于切面和惯例进行声式 ...

  9. 'InitializeCulture' is not a member of 'XXXX'

    今天在部署ASP.NET网页时出现一个奇怪的问题.在开发,调试时访问网页一切正常.但一部署到IIS中时就会出现以下的错误信息:'InitializeCulture' is not a member o ...

  10. scrollview始终显示滚动条 Android

    设置scrollview的:android:fadeScrollbars="false"表示始终显示垂直滚动条