TopCoder SRM 588 DIV2 KeyDungeonDiv2
简单的题目
class KeyDungeonDiv2
{
public:
int countDoors(vector <int> doorR, vector <int> doorG, vector <int> keys)
{
int res = ;
for(int i = ; i < doorR.size(); i ++){
if(doorR[i] <= keys[]+keys[] && doorG[i] <= keys[]+keys[] && doorR[i] + doorG[i] <=keys[]+keys[]+keys[]) res ++;
}
return res;
}
};
TopCoder SRM 588 DIV2 KeyDungeonDiv2的更多相关文章
- 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 ...
- Topcoder SRM 683 Div2 - C
树形Dp的题,根据题意建树. DP[i][0] 表示以i为根节点的树的包含i的时候的所有状态点数的总和 Dp[i][1] 表示包含i结点的状态数目 对于一个子节点v Dp[i][0] = (Dp[v] ...
- Topcoder SRM 626 DIV2 SumOfPower
本题就是求所有连续子数列的和 开始拿到题目还以为求的时数列子集的和,认真看到题目才知道是连续子数列 循环遍历即可 int findSum(vector <int> array) { ; ; ...
随机推荐
- RPM软件包管理的查询功能
以后大家升级rpm包的时候,不要用Uvh了! 我推荐用Fvh 前者会把没有安装过得包也给装上,后者只会更新已经安装的包 总结:未安装的加上小写p,已安装的不需要加p 查询q rpm {- ...
- Sphinx 增量索引更新
是基于PHP API调用,而不是基于sphinxSE.现在看来sphinxSE比API调用更简单的多,因为之前没有想过sphinxSE,现在先把API的弄明白.涉及到的:sphinx 数据源的设置,简 ...
- Count Numbers with Unique Digits
Given a non-negative integer n, count all numbers with unique digits, x, where 0 ≤ x < 10n. Examp ...
- MySQL的LIMIT与分页优化
在系统中需要进行分页操作的时候,我们通常会使用LIMIT加上偏移量的办法实现,同时加上合适的ORDER BY子句.如果有对应的索引,通常效率会不错,否则,MySQL需要做大量的文件排序操作. 一个非常 ...
- c# 获取屏幕DPI
方法一:用ManagementClass来获取.需要引入System.Management.dll; using (ManagementClass mc = new ManagementClass(& ...
- ffplay 2.5.3 媒体播放器
下载地址 http://pan.baidu.com/s/1bnlMYB1 一定要解压到 D:\ffmpeg\ 目录下 双击 OpenWith_FFPlay.reg 注册ffplay 在视频文件名上面, ...
- HDU 4704 Sum (高精度+快速幂+费马小定理+二项式定理)
Sum Time Limit:1000MS Memory Limit:131072KB 64bit IO Format:%I64d & %I64u Submit Status ...
- Light OJ 1393 Crazy Calendar (尼姆博弈)
C - Crazy Calendar Time Limit:4000MS Memory Limit:32768KB 64bit IO Format:%lld & %llu Su ...
- hdu 1286:找新朋友(数论,欧拉函数)
找新朋友 Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submis ...
- Java Hour 31 Weather ( 4 )
有句名言,叫做10000小时成为某一个领域的专家.姑且不辩论这句话是否正确,让我们到达10000小时的时候再回头来看吧. Hour 31 Maven 的项目结构 Struts 2 Tags < ...