topcoder SRM 592 DIV2 LittleElephantAndBooks
#include <iostream>
#include <vector>
#include <algorithm> using namespace std; class LittleElephantAndBooks{
public:
int getNumber(vector<int> pages,int number){
sort(pages.begin(),pages.end());
int res = pages[number];
for(int i = ; i < number-; i ++ ){
res += pages[i];
}
return res;
}
};
topcoder SRM 592 DIV2 LittleElephantAndBooks的更多相关文章
- topcoder SRM 592 DIV2 LittleElephantAndPermutationDiv2
#include <iostream> #include <vector> #include <algorithm> #include <iterator&g ...
- SRM 592 DIV2 报告
昨天下午查看邮箱,看到了topcoder的SRM比赛通知和cf的比赛通知,当时什么也不想做,心里空荡荡的,忽然就想参加一下,试试看.吃完晚饭回来一看,就剩十几分钟了,匆忙把平台下了,就开始等待比赛开始 ...
- Topcoder Srm 673 Div2 1000 BearPermutations2
\(>Topcoder \space Srm \space 673 \space Div2 \space 1000 \space BearPermutations2<\) 题目大意 : 对 ...
- Topcoder Srm 671 Div2 1000 BearDestroysDiv2
\(>Topcoder \space Srm \space 671 \space Div2 \space 1000 \space BearDestroysDiv2<\) 题目大意 : 有一 ...
- 求拓扑排序的数量,例题 topcoder srm 654 div2 500
周赛时遇到的一道比较有意思的题目: Problem Statement There are N rooms in Maki's new house. The rooms are number ...
- Topcoder srm 632 div2
脑洞太大,简单东西就是想复杂,活该一直DIV2; A:水,基本判断A[I]<=A[I-1],ANS++; B:不知道别人怎么做的,我的是100*N*N;没办法想的太多了,忘记是连续的数列 我们枚 ...
- topcoder SRM 628 DIV2 BracketExpressions
先用dfs搜索所有的情况,然后判断每种情况是不是括号匹配 #include <vector> #include <string> #include <list> # ...
- topcoder SRM 628 DIV2 BishopMove
题目比较简单. 注意看测试用例2,给的提示 Please note that this is the largest possible return value: whenever there is ...
- Topcoder SRM 683 Div2 B
贪心的题,从左向右推过去即可 #include <vector> #include <list> #include <map> #include <set&g ...
随机推荐
- HDOJ 1102 生成树
Constructing Roads Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Other ...
- Compare Strings
Compare two strings A and B, determine whether A contains all of the characters in B. The characters ...
- 取出type="button" 和type="text" 里面的值显示在页面
<script type="text/JavaScript> function changeLink() { document.getElementById("nod ...
- redis 初探
2014年6月24日 17:50:57 解压redis后进入源码目录,只用执行make命令就可以完成安装了 安装完成后到src目录里,将 redis-server redis-cli redis.co ...
- VelocityTracker简介
android.view.VelocityTracker主要用跟踪触摸屏事件(flinging事件和其他gestures手势事件)的速率.用addMovement(MotionEvent)函数将Mot ...
- 国密SM4对称算法实现说明(原SMS4无线局域网算法标准)
国密SM4对称算法实现说明(原SMS4无线局域网算法标准) SM4分组密码算法,原名SMS4,国家密码管理局于2012年3月21日发布:http://www.oscca.gov.cn/News/201 ...
- php 数组定义、取值和遍历
<?php //常用函数 //生成随机数 //echo rand(1,10); //两个参数来确定随机数的范围 //日期时间函数 //var_dump(time()); //取当前时间的UNIX ...
- C#学习笔记---修饰符,this关键字和static关键字
1. C#中类的修饰符: public 表示不限制对该类的访问 protected 表示只能从所在类和所在类派生的子类进行访问 private 只有其所在类才能访问 internal 只有对 ...
- 在Android中让Preference的宽度占满整个屏幕的宽度
今天遇到一个问题,需要修改Preference的宽度,让其与屏幕宽度一致.搞了一上午. 终于发现Preference的这个尺寸是在PreferenceFrameLayout中设置的.通过下面这段代码, ...
- redis的PHP扩展包安装方法
试用Redis安装.php环境连接.测试 Redis介绍 Redis本质上一个Key/Value数据库,与Memcached类似的NoSQL型数据库,但是他的数据可以持久化的保存在磁盘上,解 ...