Codeforces Round #216 (Div. 2)A. Valera and Plates
#include <iostream>
using namespace std;
int main(){
int n, m , k;
cin >> n >> m >> k;
int first_type = , second_type = ;
for(int i = ; i < n ; ++ i){
int a;
cin >> a;
(a == ) ? first_type++ : second_type ++ ;
}
int wash_number = ;
if(first_type - m >= ){
wash_number = first_type - m;
m = ;
}else{
m -=first_type;
}
if(second_type - m > ){
second_type-=m;
wash_number += (second_type-k > ? second_type-k : );
}
cout<<wash_number<<endl;
}
Codeforces Round #216 (Div. 2)A. Valera and Plates的更多相关文章
- Codeforces Round #216 (Div. 2) D. Valera and Fools
题目链接:http://codeforces.com/contest/369/problem/D 注意题意:所有fools都向编号最小的fool开枪:但每个fool都不会笨到想自己开枪,所以编号最小的 ...
- Codeforces Round #216 (Div. 2) B. Valera and Contest
#include <iostream> #include <algorithm> #include <vector> using namespace std; in ...
- Codeforces Round #216 (Div. 2) E. Valera and Queries 树状数组 离线处理
题意:n个线段[Li, Ri], m次询问, 每次询问由cnt个点组成,输出包含cnt个点中任意一个点的线段的总数. 由于是无修改的,所以我们首先应该往离线上想, 不过我是没想出来. 首先反着做,先求 ...
- Codeforces Round #216 (Div. 2) E. Valera and Queries (BIT)
标题效果: 给很多分布 x 行轴. 然后给出了一个非常的多点集,问该组点分布多少不同段. IDEAS: 分散成多个线段点集的. 给出的线段的话,也就是说这个点集上不会有点在这条线段上. 所以我们就是求 ...
- Codeforces Round #216 (Div. 2)
以后争取补题不看别人代码,只看思路,今天就是只看思路补完的题,有点小激动. A. Valera and Plates 水题,贪心地先放完第一种食物,在考虑第二种. 居然被卡了一会,心态要蹦 :(: # ...
- Codeforces Round #252 (Div. 2) B. Valera and Fruits(模拟)
B. Valera and Fruits time limit per test 1 second memory limit per test 256 megabytes input standard ...
- Codeforces Round #216 (Div. 2)解题报告
又范低级错误! 只做了两题!一道还被HACK了,囧! A:看了很久!应该是到语文题: 代码:#include<iostream> #include<]; ,m2=; ;i ...
- [Codeforces Round #237 (Div. 2)] A. Valera and X
A. Valera and X time limit per test 1 second memory limit per test 256 megabytes input standard inpu ...
- codeforces Round #252 (Div. 2) C - Valera and Tubes
贪心算法,每条路径最短2格,故前k-1步每次走2格,最后一步全走完 由于数据比较小,可以先打表 #include <iostream> #include <vector> #i ...
随机推荐
- Android性能优化系列 + Android官方培训课程中文版
Android性能优化典范 - 第6季 http://hukai.me/android-performance-patterns-season-6/ Android性能优化典范 - 第5季 htt ...
- 【JAVA正则表达式综合练习】
一.治疗口吃. 将字符串“我我我我我我我..........我.......要要要要要..................要要要要...学习习习习.......习习习习习习习习编程程程程程程..... ...
- python多进程程序之间交换数据的两种办法--Queue和Pipe
合在一起作的测试. #!/usr/bin/env python # -*- coding: utf-8 -*- import multiprocessing import random import ...
- Install PIL on mac osX10.9
follow this instruction: http://blog.csdn.net/liushuaikobe/article/details/8729652 and if you encoun ...
- freemarker 实现对URL的安全编码
[#setting url_escaping_charset='utf-8'] ${yourstr?url}
- document.location.reload();与location.href='xxx'的区别
document.location.reload();会重新加载页面,onload事件会被触发. location.href='xxx'刷新页面,onload事件不会触发.
- .NET Nancy 详解(一) 初识
Nancy 是一个轻量级的,简单粗暴的framework用来构建基于HTTP的各种服务,兼容.Net和Mono.Nancy的整套设计理念是基于"super-duper-happy-path& ...
- BOOL in Object-C
BOOL in Object-C typedef signed char BOOL; #define YES (BOOL)1 #define NO (BOOL)0 重构上页中的代码 - (BOOL)s ...
- android 入门-布局
android:gravity 针对本view 的位置. android:layout_gravity 本view相对于父布局view的位置. android:layout_alignParentRi ...
- ios 距离传感器和摇一摇
//距离传感器,以注册通知的形式来实现的 #import "ViewController.h" @interface ViewController () @end @impleme ...