 Penalty Kick

In 2028 year, China Football Team advanced into the final of the World Cup. What an exciting news! But the Manager of China is ZhuGuanghu's grandson, being conservative is their only style. As almost excepted, the final is boring, they don't even score one goal in 120 minutes! Now the match comes into penalty kick off. Here comes the official law of the penalty kick off:
The referee chooses the goal at which the kicks will be taken
The referee tosses a coin and the team whose captain wins the toss decides whether to take the first or the second kick
The referee keeps a record of the kicks being taken
Subject to the conditions explained below, both teams take five kicks
The kicks are taken alternately by the teams
If, before both teams have taken five kicks, one has scored more goals than the other could score, even if it were to complete its five kicks, no more kicks are taken
If, after both teams have taken five kicks, both have scored the same number of goals, or have not scored any goals, kicks continue to be taken until one team has scored a goal more than the other from the same number of kicks
No player is allowed to take a second kick until all other players in his team have taken a kick
You, assistant coach of China, have been working on the math particularly on probability for many years. You know everyone's success rate when taking a penalty in your team, and you also know the opponent's success rate (assume they have the same success rate). Now you will determine the order of taking the penalty to maximize the probability to win the World Cup.
Input
There are several test cases in the input. Each case contains 12 integers, from 0 to 100. The first 11 integers is the success rate of your teammates. The last integer is the success rate of the opponent.
Output
For each case, compute as accurately as possible the max possibility of your team to win the final, then output a single line containing percentage round to 0.0001
Sample Input
10 10 10 10 10 10 10 10 10 10 10 10
10 20 30 40 50 60 70 80 90 100 100 80
Sample Output50.0000
52.1874
[ACMer请帮助]大家好！请问如何做一个简单的OJ系统？_course
20080420大家好！ 我想问一下POJ的自动判题系统是的基本思路是什么？ 装一个GCC然后如何调用GCC呢？ 我这学期带一个数据结构和算法的班，想做一个类似的系统检查作业。想向大家请教请教 ！ 谢谢！
Penalty Kick _course
20170328In 2028 year, China Football Team advanced into the final of the World Cup. What an exciting news! But the Manager of China is ZhuGuanghu's grandson, being conservative is their only style. As almost excepted, the final is boring, they don't even score one goal in 120 minutes! Now the match comes into penalty kick off. Here comes the official law of the penalty kick off: 1. The referee chooses the goal at which the kicks will be taken 2. The referee tosses a coin and the team whose captain wins the toss decides whether to take the first or the second kick 3. The referee keeps a record of the kicks being taken 4. Subject to the conditions explained below, both teams take five kicks 5. The kicks are taken alternately by the teams 6. If, before both teams have taken five kicks, one has scored more goals than the other could score, even if it were to complete its five kicks, no more kicks are taken 7. If, after both teams have taken five kicks, both have scored the same number of goals, or have not scored any goals, kicks continue to be taken until one team has scored a goal more than the other from the same number of kicks 8. No player is allowed to take a second kick until all other players in his team have taken a kick You, assistant coach of China, have been working on the math particularly on probability for many years. You know everyone's success rate when taking a penalty in your team, and you also know the opponent's success rate (assume they have the same success rate). Now you will determine the order of taking the penalty to maximize the probability to win the World Cup. Input There are several test cases in the input. Each case contains 12 integers, from 0 to 100. The first 11 integers is the success rate of your teammates. The last integer is the success rate of the opponent. Output For each case, compute as accurately as possible the max possibility of your team to win the final, then output a single line containing percentage round to 0.0001 Sample Input 10 10 10 10 10 10 10 10 10 10 10 10 10 20 30 40 50 60 70 80 90 100 100 80 Sample Output 50.0000 52.1874
Penalties Kick _course
20170917Football is an excellent game, but sometimes it is cruel. As you know, two football teams may have a tie after regular time and even addition time, but we have to judge who is the winner, so penalty comes. Here are the rules taken from FIFA: 1. If, before both teams have taken five kicks, one has scored more goals than the other could score, even if it were to complete its five kicks, no more kicks are taken; 2. If, after both teams have taken five kicks, both have scored the same number of goals, or have not scored any goals, kicks continue to be taken in the same order until one team has scored a goal more than the other from the same number of kicks; 3. Each kick is taken by a different player and all eligible players must take a kick before any player can take a second kick; 4. After every player has taken a kick, they take the second kick in the same order as the first kick, and the same with third, fourth ... kick. Now we have some kick results of the game, but unfortunately Doraemon wrote some additional results on the paper of kick results, which make the results become a 22 * 3 matrix. Now you have to judge who is the winner and what is the score. Input The first line gives the number of test cases T, (1 ≤ T ≤ 1000), after the first line followed T cases. In each case, the first 11 lines give the kick results of the home team, in each line, there are 3 words(each word is either "yes" or "no") which indicates the result of the player's first kick, second kick and third kick(of course, the game would end before take three turns, but Doraemon always makes things bad). The next 11 lines give the kick result of the away team. Home team takes the kick first, and player kicks in the given order. Output For each case, output contains three lines. The first line is "Match #:", where "#" is the case number. The second line is the "Winner: winner_name", (winner_name is either "home" or "away"). The third line is the final score "Score: home_score:away_score". Sample Input 1 yes yes yes yes yes yes yes no no yes no no yes no no no no no no no no no no no no no no no no no no no no yes no no no no no no no no yes no no yes no no yes yes yes yes yes yes yes yes yes yes yes yes yes yes yes yes yes yes Sample Output Match 1: Winner: home Score: 4:1
My World Cup _course
20170115Description My World Cup is a fantastic board game. In this game, controlled by two players respectively, two different soccer teams meet each other in World Cup final. So, both sides are trying their best to win. Alice and Bob are addicted to My World Cup recently. They always play together. Alice wants to figure out the probability of her winning. She turns to you for help. First of all, you must be familiar with the special dice and cards for My World Cup. The dice is sixsided. Two faces have a ball on them, while the other four faces do not. Dice is an important accessory for My World Cup. There are many cards in My World Cup. Each card belongs to one of four types: foul, offense, defense, and attack. As well, each card has speed and power. When two cards from different sides meet, both of them may take some effect, which depends on both cards' type: 1. If your card is an offense: If the other card is a foul, your card has no effect. Otherwise, your team can have a shoot of your card’s power. A shoot of power k means that you can throw the dice for k times (or do nothing while k is less or equal to zero) . If a ball on the dice is face up for one or more times, your team will score one goal; otherwise, you get nothing. But please note that if the other card is a defense, then before your shoot, your card's power will be reduced by the defense card's power. 2. If your card is a defense: If the other card is an attack, you will make a rapid counterattack. In the rapid counterattack, your team will have a shoot of your card’s power minus the attack card’s power. 3. If your card is an attack: Assume that your card’s power is P1 and the other card’s power is P2. If the other card is a foul, your card will have no effect. If the other card is a defense, your team will score max{ P1P2,0} goals. Otherwise your team will score max{ P1, 0} goals. 4. If your card is a foul: You must throw a dice. If a ball on the dice is face up, your opponent will gain a penalty kick(A penalty kick is regarded as a shoot of power 3); otherwise, your card has no effect. The game's process in detail is going to be explained below. 1. Preparation: (1) One player is decided to be home and the other is away. (2) Each player has five cards, four are on the field, one is off the field. 2. During each turn: (1) Each player selects one card with the largest speed value on his own field. If two or more cards meet the conditions, he can choose anyone among them. (2) Choose the one with larger speed value among two cards selected from step (1) to be the main card. If two cards have the same speed, the one comes from the home team will be chosen. (3) The owner of the main card can choose one card as the subordinate card among the cards in the opponent's field( including the card selected from step(1) by the opponent). (4) The main card and the subordinate card meet each other and both take their effects. (5) Both the main card and the subordinate card are removed from the field. 3. After four turns, there is no card on the field. At this time, if a team scores more goals than the other, the victory are theirs. However, if both teams score an equal number of goals, an extra time will be added  each player should put his last card on the field, and the game continues for one more turn. 4. If the game ends as a draw even after the extra time, well, an exciting penalty shootout is used to determine the winner: (1) Teams take turns to take penalty kicks, until each has taken five kicks. However, if one side has scored more goals than the other could possibly reach with all of its remaining penalty kicks, the shootout ends immediately. (2) If the teams still have scored an equal number of goals at the end of these five rounds of penalty kicks, sudden death rounds of one penalty kick each are used, until one side scores and the other does not. (3) The team scores more goals at last is the winner. Now, give you the full information of Alice's and Bob's cards, can you calculate the probability of Alice's win while both of them are taking optimal strategy to win the game. Note that Alice is always home. Input The input begins with a line containing an integer T (1 <= T <= 30), the number of test cases. Each test case contains 10 lines. Each line contains three integers t, s and p (0 <= t <= 3, 1 <= s <= 10, 0 <= p <= 9) indicating a single card's information  t is the type (0 for foul, 1 for offense, 2 for defense, and 3 for attack), s is the speed, and p is the power of the card. The first five cards belong to Alice (first four are on the field and the fifth is off the field), and the last five cards belong to Bob (also first four are on the field and the fifth is off the field initially). Output For each test case, you just need to print the probability of Alice's wining as a percentage in one line (rounded to the nearest integer). Sample Input 2 1 6 4 3 6 1 2 7 3 3 5 1 0 9 0 2 5 5 3 3 2 2 6 4 3 3 2 2 5 5 3 6 1 3 6 1 3 6 1 3 6 1 3 6 2 3 6 1 3 1 3 3 6 1 3 6 1 3 6 1 Sample Output 4 0
计算 alice 获胜的概率和使用的策略，怎么运用 C 语言的程序代码编写的实现思想的方法来写程序_course
20190607Problem Description My World Cup is a fantastic board game. In this game, controlled by two players respectively, two different soccer teams meet each other in World Cup final. So, both sides are trying their best to win. Alice and Bob are addicted to My World Cup recently. They always play together. Alice wants to figure out the probability of her winning. She turns to you for help. First of all, you must be familiar with the special dice and cards for My World Cup. The dice is sixsided. Two faces have a ball on them, while the other four faces do not. Dice is an important accessory for My World Cup. There are many cards in My World Cup. Each card belongs to one of four types: foul, offense, defense, and attack. As well, each card has speed and power. When two cards from different sides meet, both of them may take some effect, which depends on both cards' type: No matter your side is home or away, 1. If your card is an offense: If the other card is a foul, your card has no effect. Otherwise, your team can have a shoot of your card’s power. A shoot of power k means that you can throw the dice for k times (or do nothing while k is less or equal to zero) . If a ball on the dice is face up for one or more times, your team will score one goal; otherwise, you get nothing. But please note that if the other card is a defense, then before your shoot, your card's power will be reduced by the defense card's power. 2. If your card is a defense: If the other card is an attack, you will make a rapid counterattack. In the rapid counterattack, your team will have a shoot of your card’s power minus the attack card’s power. 3. If your card is an attack: Assume that your card’s power is P1 and the other card’s power is P2. If the other card is a foul, your card will have no effect. If the other card is a defense, your team will score max{ P1P2,0} goals. Otherwise your team will score P1 goals. 4. If your card is a foul: You must throw a dice. If a ball on the dice is face up, your opponent will gain a penalty kick(A penalty kick is regarded as a shoot of power 3); otherwise, your card has no effect. The game's process in detail is going to be explained below. 1. Preparation: (1) One player is decided to be home and the other is away. (2) Each player has five cards, four are on the field, one is off the field. 2. During each turn: (1) Each player selects one card with the largest speed value on his own field. If two or more cards meet the conditions, he can choose anyone among them. (2) Choose the one with larger speed value among two cards selected from step (1) to be the main card. If two cards have the same speed, the one comes from the home team will be chosen. (3) The owner of the main card can choose one card as the subordinate card among the cards in the opponent's field( including the card selected from step(1) by the opponent). (4) The main card and the subordinate card meet each other and both take their effects. (5) Both the main card and the subordinate card are removed from the field. 3. After four turns, there is no card on the field. At this time, if a team scores more goals than the other, the victory are theirs. However, if both teams score an equal number of goals, an extra time will be added  each player should put his last card on the field, and the game continues for one more turn. 4. If the game ends as a draw even after the extra time, well, an exciting penalty shootout is used to determine the winner: (1) Teams take turns to take penalty kicks, until each has taken five kicks. However, if one side has scored more goals than the other could possibly reach with all of its remaining penalty kicks, the shootout ends immediately. (2) If the teams still have scored an equal number of goals at the end of these five rounds of penalty kicks, sudden death rounds of one penalty kick each are used, until one side scores and the other does not. (3) The team scores more goals at last is the winner. Now, give you the full information of Alice's and Bob's cards, can you calculate the probability of Alice's winning while both of them are taking optimal strategy to win the game. Note that Alice is always home. Input The input begins with a line containing an integer T (1 <= T <= 30), the number of test cases. Each test case contains 10 lines. Each line contains three integers t, s and p (0 <= t <= 3, 1 <= s <= 10, 0 <= p <= 9) indicating a single card's information  t is the type (0 for foul, 1 for offense, 2 for defense, and 3 for attack), s is the speed, and p is the power of the card. The first five cards belong to Alice (first four are on the field and the fifth is off the field), and the last five cards belong to Bob (also first four are on the field and the fifth is off the field initially). Output For each test case, you just need to print the probability of Alice's winning as a percentage in one line (rounded to the nearest integer). Sample Input 2 1 6 4 3 6 1 2 7 3 3 5 1 0 9 0 2 5 5 3 3 2 2 6 4 3 3 2 2 5 5 3 6 1 3 6 1 3 6 1 3 6 1 3 6 2 3 6 1 3 1 3 3 6 1 3 6 1 3 6 1 Sample Output 4 0
My World Cup 比分的问题_course
20200117Problem Description My World Cup is a fantastic board game. In this game, controlled by two players respectively, two different soccer teams meet each other in World Cup final. So, both sides are trying their best to win. Alice and Bob are addicted to My World Cup recently. They always play together. Alice wants to figure out the probability of her winning. She turns to you for help. First of all, you must be familiar with the special dice and cards for My World Cup. The dice is sixsided. Two faces have a ball on them, while the other four faces do not. Dice is an important accessory for My World Cup. There are many cards in My World Cup. Each card belongs to one of four types: foul, offense, defense, and attack. As well, each card has speed and power. When two cards from different sides meet, both of them may take some effect, which depends on both cards' type: No matter your side is home or away, 1. If your card is an offense: If the other card is a foul, your card has no effect. Otherwise, your team can have a shoot of your card’s power. A shoot of power k means that you can throw the dice for k times (or do nothing while k is less or equal to zero) . If a ball on the dice is face up for one or more times, your team will score one goal; otherwise, you get nothing. But please note that if the other card is a defense, then before your shoot, your card's power will be reduced by the defense card's power. 2. If your card is a defense: If the other card is an attack, you will make a rapid counterattack. In the rapid counterattack, your team will have a shoot of your card’s power minus the attack card’s power. 3. If your card is an attack: Assume that your card’s power is P1 and the other card’s power is P2. If the other card is a foul, your card will have no effect. If the other card is a defense, your team will score max{ P1P2,0} goals. Otherwise your team will score P1 goals. 4. If your card is a foul: You must throw a dice. If a ball on the dice is face up, your opponent will gain a penalty kick(A penalty kick is regarded as a shoot of power 3); otherwise, your card has no effect. The game's process in detail is going to be explained below. 1. Preparation: (1) One player is decided to be home and the other is away. (2) Each player has five cards, four are on the field, one is off the field. 2. During each turn: (1) Each player selects one card with the largest speed value on his own field. If two or more cards meet the conditions, he can choose anyone among them. (2) Choose the one with larger speed value among two cards selected from step (1) to be the main card. If two cards have the same speed, the one comes from the home team will be chosen. (3) The owner of the main card can choose one card as the subordinate card among the cards in the opponent's field( including the card selected from step(1) by the opponent). (4) The main card and the subordinate card meet each other and both take their effects. (5) Both the main card and the subordinate card are removed from the field. 3. After four turns, there is no card on the field. At this time, if a team scores more goals than the other, the victory are theirs. However, if both teams score an equal number of goals, an extra time will be added  each player should put his last card on the field, and the game continues for one more turn. 4. If the game ends as a draw even after the extra time, well, an exciting penalty shootout is used to determine the winner: (1) Teams take turns to take penalty kicks, until each has taken five kicks. However, if one side has scored more goals than the other could possibly reach with all of its remaining penalty kicks, the shootout ends immediately. (2) If the teams still have scored an equal number of goals at the end of these five rounds of penalty kicks, sudden death rounds of one penalty kick each are used, until one side scores and the other does not. (3) The team scores more goals at last is the winner. Now, give you the full information of Alice's and Bob's cards, can you calculate the probability of Alice's winning while both of them are taking optimal strategy to win the game. Note that Alice is always home. Input The input begins with a line containing an integer T (1 <= T <= 30), the number of test cases. Each test case contains 10 lines. Each line contains three integers t, s and p (0 <= t <= 3, 1 <= s <= 10, 0 <= p <= 9) indicating a single card's information  t is the type (0 for foul, 1 for offense, 2 for defense, and 3 for attack), s is the speed, and p is the power of the card. The first five cards belong to Alice (first four are on the field and the fifth is off the field), and the last five cards belong to Bob (also first four are on the field and the fifth is off the field initially). Output For each test case, you just need to print the probability of Alice's winning as a percentage in one line (rounded to the nearest integer). Sample Input 2 1 6 4 3 6 1 2 7 3 3 5 1 0 9 0 2 5 5 3 3 2 2 6 4 3 3 2 2 5 5 3 6 1 3 6 1 3 6 1 3 6 1 3 6 2 3 6 1 3 1 3 3 6 1 3 6 1 3 6 1 Sample Output 4 0
 11.3MB
2020年9月新版CKA真题
202010192020年九月新版CKA考试真题，是博主在考试时候偷偷截的图，考试是在线考试，具体的考试攻略可以参考我的博客，如有疑问可以在博客下面留言，我看到就会回复的。博客地址：https://blog.csdn
手把手带你学会Python
20200303当下最火的计算机语言，难道你还只停留知道的阶段吗？快跟着老司机一起起飞吧~ 零基础开始学，只要跟着视频一步一步来，多思考，多练习，我相信你会有质的飞越。 学习路上会很苦，也会很累。但是这些等你学会以后，会发现这些都是值得。 还在等什么？快来学习吧~
R语言入门基础
20190601本课程旨在帮助学习者快速入门R语言： 课程系统详细地介绍了使用R语言进行数据处理的基本思路和方法。 课程能够帮助初学者快速入门数据处理。 课程通过大量的案例详细地介绍了如何使用R语言进行数据分析和处理 课程操作实际案例教学，通过编写代码演示R语言的基本使用方法和技巧
Java进阶高手课Java基础编程提升
20200427课程聚焦Java基础编程提升的核心知识点，以真实场景项目实战为导向，循序渐进，深入浅出的了解Java基础编程，讲解Java这门使用广泛的编程语言，助你能够游刃有余地游走在这些技术之中。
 41.83MB
Python高级编程.pdf
20130801《Python高级编程》通过大量的实例，介绍了Python语言的最佳实践和敏捷开发方法，并涉及整个软件生命周期的高级主题，诸如持续集成、版本控制系统、包的发行和分发、开发模式、文档编写等。《Pytho
Python进阶Pandas数据分析库
20181218您观看课程学习后 免费入群领取【超全Python资料包+17本学习电子书】 Pandas是python中非常常用的数据分析库，在数据分析，机器学习，深度学习等领域经常被使用。本课程会讲解到pandas中最核心的一些知识点，包括Series以及DataFrame的构建，赋值，操作，选择数据，合并等等，以及使用pandas对文件进行读取和写入，使用pandas绘图等等。
 111.65MB
DirectX修复工具V4.0增强版
20200613DirectX修复工具(DirectX Repair)是一款系统级工具软件，简便易用。本程序为绿色版，无需安装，可直接运行。 本程序的主要功能是检测当前系统的DirectX状态，如果发现异常则进行修复
Java学习指南（Java入门与进阶）
20170809这是Java学习指南系列课程的第1篇，介绍Java语言的入门语法，引领希望学习Java语言编程的初学者进入Java大门。 本课程不需要其他语言作为基础，可以直接学习。 课程从Java开发平台的下载和安装开始，从浅到深、从易到难，循序渐进地进行语法讲解。 为了让学员更好的掌握Java语言，本课程配套在线的Java题库及答案解析。 相比于其他语言，Java语言更科学、更容易掌握，快来和大家一起学习Java吧。
 22.3MB
西北工业大学软件学院软件测试实验1lab1.zip
20200713西北工业大学，软件学院，软件测试实验1，lab1，嵌入式系统测试，包含讲解资料以及测试结果表格（2017年测试大赛题目）
 20KB
java循环题 循环输出五角星的各种图形
20090612java循环输出五角星的各种图形···········
征服C++ 11视频精讲
20160902【为什么还需要学习C++？】 你是否接触很多语言，但从来没有了解过编程语言的本质？ 你是否想成为一名资深开发人员，想开发别人做不了的高性能程序？ 你是否经常想要窥探大型企业级开发工程的思路，但苦于没有基础只能望洋兴叹？ 那么C++就是你个人能力提升，职业之路进阶的不二之选。 【课程特色】 1.课程共19大章节，239课时内容，涵盖数据结构、函数、类、指针、标准库全部知识体系。 2.带你从知识与思想的层面从0构建C++知识框架，分析大型项目实践思路，为你打下坚实的基础。 3.李宁老师结合4大国外顶级C++著作的精华为大家推出的《征服C++11》课程。 【学完后我将达到什么水平？】 1.对C++的各个知识能够熟练配置、开发、部署； 2.吊打一切关于C++的笔试面试题； 3.面向物联网的“嵌入式”和面向大型化的“分布式”开发，掌握职业钥匙，把握行业先机。 【面向人群】 1.希望一站式快速入门的C++初学者； 2.希望快速学习 C++、掌握编程要义、修炼内功的开发者； 3.有志于挑战更高级的开发项目，成为资深开发的工程师。 【课程设计】 本课程包含3大模块 基础篇 本篇主要讲解c++的基础概念，包含数据类型、运算符等基本语法，数组、指针、字符串等基本词法，循环、函数、类等基本句法等。 进阶篇 本篇主要讲解编程中常用的一些技能，包含类的高级技术、类的继承、编译链接和命名空间等。 提升篇： 本篇可以帮助学员更加高效的进行c++开发，其中包含类型转换、文件操作、异常处理、代码重用等内容。
 学院 C#之高级进阶
 下载 精易模块V8.4.5
 下载 SDIO_Fatfs.zip
 博客 不支持源选项5请使用6或更高版本
 下载 资料文件夹保护精灵4.95.rar
 下载 基于PCA的图像融合matlab
 学院 Web安全攻防
 学院 玩转MySQL数据库(赠送JDK8新特性)
 下载 C++与opencv自己实现腐蚀和膨胀函数.zip
 下载 仅限今天免费领取！linux学习资料包.rar
 学院 华为 HCIA HCNA 数通 路由交换 思科 CCNA 教程 视频
 下载 微信小程序源码,微信小程序cms电影源码
 学院 基于vue.js的uniapp家具家居商城APP（使用教程）
 学院 Spring核心原理面试训练营（停止报名）
 下载 抖音批量解析.zip
 学院 Java语言编程系统清晰路线学习①Java核心基础语法
 学院 Java工程师必学系列课程之6《Java日期时间类》视频课程
 博客 springboot后台中文件上传和下载
 学院 覃超老师带你玩转数据结构与算法
 下载 枝切法相位解缠matlab代码
 下载 C++课程设计:学生成绩信息管理系统
 学院 循序渐进学人工智能系列课程
 博客 期中
 下载 西门子4307.5kw驱动板维修电路图
 学院 朱老师鸿蒙系列课程第1期1.鸿蒙系统HarmonyOS打通开发实践
 下载 数据库MySQL12315
 博客 讲讲 Cookie、Session、Token、JWT之间的区别
 博客 PyQGIS开发  创建第一个插件
 博客 Neuron杂志：研究者发现前额叶中调控社交恐惧的去抑制神经微环路
 学院 Git使用详解