def score(dices_input):
count = {}.fromkeys(range(1, 7), 0)
points = 0
for dice_side in dices_input:
count[dice_side] += 1
# print count
points = (count[1]/3)*1000 + (count[1]%3)*100 + (count[5]%3)*50
for i in range(2, 7):
points += (count[i]/3) * i * 100 return points if __name__=="__main__":
print "The score of the given examples:"
print "score[1,1,1,5,1]=%d" %score([1,1,1,5,1])
print "score[2,3,4,6,2]=%d" %score([2,3,4,6,2])
print "score[3,4,5,3,3]=%d" %score([3,4,5,3,3])
print "score[1,5,1,2,4]=%d" %score([1,5,1,2,4])
print "You can try others"
a=raw_input("Input five numbers:")
input_s=[0,0,0,0,0]
if len(a.split())!=0:
b=a.split()
for i in range(len(input_s)):
input_s[i]=int(b[i])
print score(input_s)

Dice chrone execise的更多相关文章

  1. HDOJ 4652 Dice

      期望DP +数学推导 Dice Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/65536 K (Java/Others ...

  2. 三种renderman规范引擎的dice对比

    次表面做的有些烦躁,既然如此,索性先记一下前一阵比较的PIXIE.3delight.prman的dice方式. 研究过reyes的人都知道dice,简而言之,就是为了生成高质量高精度的图片(电影CG) ...

  3. LightOJ 1248 Dice (III) 概率

    Description Given a dice with n sides, you have to find the expected number of times you have to thr ...

  4. hdu 4586 Play the Dice 概率推导题

    A - Play the DiceTime Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://acm.hust.edu.cn/vjudge/contest/ ...

  5. 概率 Gym 100502D Dice Game

    题目传送门 /* 题意:两个人各掷两个骰子,给出每个骰子的最小值和最大值,其余值连续分布 问两人投掷,胜利的概率谁大 数据小,用4个for 把所有的可能性都枚举一遍,统计每一次是谁胜利 还有更简单的做 ...

  6. HDU 5955 Guessing the Dice Roll

    HDU 5955 Guessing the Dice Roll 2016 ACM/ICPC 亚洲区沈阳站 题意 有\(N\le 10\)个人,每个猜一个长度为\(L \le 10\)的由\(1-6\) ...

  7. UVALive 7275 Dice Cup (水题)

    Dice Cup 题目链接: http://acm.hust.edu.cn/vjudge/contest/127406#problem/D Description In many table-top ...

  8. HDU 4586 A - Play the Dice 找规律

    A - Play the DiceTime Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://acm.hust.edu.cn/vjudge/contest/ ...

  9. CF Polycarpus' Dice (数学)

    Polycarpus' Dice time limit per test 1 second memory limit per test 256 megabytes input standard inp ...

随机推荐

  1. Java实现Socket之WhoisClient

    Java实现Socket之WhoisClient 代码内容 从常用的whois服务器的43号端口得到对应域名的所有注册信息并显示出来 代码实现 /* WhoisClient.java */ impor ...

  2. C#的winform矩阵简单运算

    C#的winform矩阵简单运算 程序截图 关键代码 using System; using System.Collections.Generic; using System.ComponentMod ...

  3. LinqToExcel: LINQ查询Excel电子表格

    Linq的强大人所共知,能不能将Linq扩展到读取excel呢? 答案当然是肯定的. LinqToExcel就是一个实现了使用Linq语法查询excel表格的.net开源类库. 在nuget搜索下载安 ...

  4. PB打开ole控件IE浏览器版本问题_指定Webbrowser控件所用IE内核版本(转)

    如果电脑上安装了IE8或者之后版本的IE浏览器,Webbrowser控件会使用IE7兼容模式来显示网页内容.解决方法是在注册表中为你的进程指定引用IE的版本号. 比如我的程序叫做a.exe 对于32位 ...

  5. 读Windows编程

    1.Windows是一个消息驱动系统.它通过把消息投入应用程序消息队列中或者把消息发送给合适的窗口消息处理程序,将发生的各种事件通知给应用程序 2.尽管一个动态链接库模块可能有其它扩展名(如.EXE或 ...

  6. UML 中的用例图解析以及starUML详细介绍

    UML中的用例(Use Case)概念分析及StarUML实例 在UML 中use case 似 乎最簡單的,用例建模的最主要功能就是用来表达系统的功能性需求或行为,依我的理解用例建模可分为用例图和用 ...

  7. loadView, viewDidLoad 快速使用

    一  loadView: 在每次访问 UIViewController时,且其 view = nil 时,会调用这个方法,所以大家在开发中想自己设置 view 的可以用这个方法,在这个方法中自定义 v ...

  8. Python中数据的保存和读取

    在科学计算的过程中,往往需要保存一些数据,也经常需要把保存的这些数据加载到程序中,在 Matlab 中我们可以用 save 和 lood 函数很方便的实现.类似的在 Python 中,我们可以用 nu ...

  9. 网站中的专题页或者tag聚合页的权重不错

    一.据最近的一些观察,觉得网站中的专题页或者tag聚合页的权重不错,因此多给网站制作一些专题页面,不仅有利于聚合站内的文章,更是绝对的原创内容,应该会受到百度的青睐.简评:关于权重的讨论,这篇无疑是很 ...

  10. ASP.NET本质论阅读----线程与异步

    线程 概要:操作系统通过线程对程序的执行进行管理 线程的数据结构:1.线程的核心对象(包含线程的当前寄存器状态),调用线程时-寄存器状态被加载到CPU中. 2.线程环境块TEB:一块用户模式下的内存 ...