题目来源:http://community.topcoder.com/stat?c=problem_statement&pm=1692&rd=5858

比较简单。

代码如下:

#include <iostream>
#include <vector> using namespace std; class YahtzeeScore
{
public:
int maxPoints(vector <int> toss);
}; int YahtzeeScore::maxPoints(vector<int> toss)
{
int i, j;
int size = toss.size();
int maxP = 0;
int sum; for (i = 0; i < size; i++) {
sum = 0;
for (j = 0; j < size; j++) {
if (toss[i] == toss[j]) {
sum += toss[i];
}
}
if (sum > maxP) {
maxP = sum;
}
}
return maxP;
}

SRM 212 Div II Level One: YahtzeeScore的更多相关文章

  1. SRM 212 Div II Level Two: WinningRecord,Brute Force

    题目来源:http://community.topcoder.com/stat?c=problem_statement&pm=3003&rd=5858 比较简单. 代码如下: #inc ...

  2. SRM 223 Div II Level Two: BlackAndRed,O(N)复杂度

    题目来源:http://community.topcoder.com/stat?c=problem_statement&pm=3457&rd=5869 解答分析:http://comm ...

  3. SRM 207 Div II Level Two: RegularSeason,字符串操作(sstream),多关键字排序(操作符重载)

    题目来源:http://community.topcoder.com/stat?c=problem_statement&pm=2866&rd=5853 主要是要对字符串的操作要熟悉,熟 ...

  4. SRM 577 Div II Level Two: EllysRoomAssignmentsDiv2

    题目来源: http://community.topcoder.com/tc?module=ProblemDetail&rd=15497&pm=12521 这个问题要注意的就是只需要直 ...

  5. SRM 582 Div II Level One: SemiPerfectSquare

    题目来源:http://community.topcoder.com/stat?c=problem_statement&pm=12580 比较简单,代码如下: #include <ios ...

  6. SRM 582 Div II Level Two SpaceWarDiv2

    题目来源:http://community.topcoder.com/stat?c=problem_statement&pm=12556 #include <iostream> # ...

  7. SRM 582 Div II Level Three: ColorTheCells, Brute Force 算法

    题目来源:http://community.topcoder.com/stat?c=problem_statement&pm=12581 Burte Force 算法,求解了所有了情况,注意  ...

  8. SRM 583 Div II Level One:SwappingDigits

    题目来源:http://community.topcoder.com/stat?c=problem_statement&pm=12609 #include <iostream> # ...

  9. SRM 583 Div II Level Three:GameOnABoard,Dijkstra最短路径算法

    题目来源:http://community.topcoder.com/stat?c=problem_statement&pm=12556 用Dijkstra实现,之前用Floyd算法写了一个, ...

随机推荐

  1. Js~对数组的操作

    在工作中可能用的不多,但一些特殊的场合还是会用到,所以在这里,把JS的数组操作总结一下,分享给大家! Array 对象 Array 对象用于在单个的变量中存储多个值. 创建 Array 对象的语法: ...

  2. vue配置二级目录&vue-axios跨域办法&谷歌浏览器设置跨域

    一.根据官方建议,dist打包的项目文件放在服务器根目录下,但是很多时候,我们并不能这样做,当涉及到二级目录设置多层深埋的时候,就需要在webpack配置文件里去设置一下了. 在webpack.con ...

  3. 4款Github泄漏敏感信息搜索工具简单比较

    gitrob Ruby开发,支持通过postgresql数据库https://github.com/michenriksen/gitrob weakfilescan Python开发,多线程,猪猪侠开 ...

  4. centos7.5 ab压力测试安装和swoole压力测试

    Apache Benchmark(简称ab) 是Apache安装包中自带的压力测试工具 ,简单易用 1.ab安装 yum -y install httpd-tools 2.ab参数详解,传送门:htt ...

  5. laravel windows安装(composer)

    1.安装composer参考windows 安装tp5 composer方式 2.先配置好本地虚拟域名,在cmd里面切换到网站根目录 ... 3.安装成功之后,在浏览器输入已配置的虚拟域名我的是,la ...

  6. 【转载】Xutils3源码解析

    Github源码地址:https://github.com/wyouflf/xUtils3 原文地址 :http://www.codekk.com/blogs/detail/54cfab086c476 ...

  7. Coding.net简单使用指南

    注意:大家创建项目时一定要选择创建公开仓库!不然别人看不到! Coding.net是一个代码托管平台,简单来说这东西就是一个你在线存放代码的地方. 至于为什么要把代码存到这东西上呢?很多好处,比如防丢 ...

  8. HDU 6031 Innumerable Ancestors

    树状数组,倍增,枚举,$dfs$序. 对于每一次的询问,可以枚举$B$集合中的所有点,对于每一个点,在树上二分$LCA$,找到最低的更新答案. 判断是否是$LCA$可以搞个$dfs$序,将$A$集合中 ...

  9. POJ3292 Semi-prime H-numbers [数论,素数筛]

    题目传送门 Semi-prime H-numbers Time Limit: 1000MS   Memory Limit: 65536K Total Submissions: 10871   Acce ...

  10. thunk 函数

    function* f() { console.log(1); for (var i = 0; true; i++) { console.log('come in'); var reset = yie ...