1. 程式人生 > >WHU 2013 Summer random contest #2 F題

WHU 2013 Summer random contest #2 F題

Download as PDF

Do you know Lotto? Lotto is a game of probability. Six numbers are drawn from a range of numbers (such as 42, 47, 47, 49, 51, and 54). Michigan, for instance, has a 6-out-of-47 game (6/47), meaning that six numbers are drawn from possible 47. Florida's Lotto is 6/53, meaning that six numbers are drawn from a possible 53.

To play Lotto, indicate your six chosen numbers by marking the numbered squares on a play slip. Then take the play slip to a lottery retailer (or agent). The retailer enters your selection in the on-line terminal, which produces your game ticket. The ticket, not the play slip, is the official receipt and must be presented and validated in the event of a win. Always check to make sure that the correct date and numbers are on the game ticket before you leave. Lottery agents are found in convenience stores, gas stations, and grocery stores.

The cost for one chance at Lotto is still $1 in many states. So for one chance, or play, at Lotto, you would pay $1. For five plays -- that is, to play five sets of numbers--you would pay $5. Illinois offers a bargain: two plays for $1.

Typically, Lotto drawings are held twice a week, usually on Wednesday and Saturday nights. However, this may not be true for every state.

The lottery officials use special ball-drawing machines, and the balls are numbered. The machine randomly shoots out six selected balls; these balls display the winning numbers for that evening's lottery drawing. If all six of your numbers exactly match the numbers drawn, you win the jackpot. In Lotto, your numbers don't need to be listed in any particular order, as long as they match those drawn. (taken from http://entertainment.howstuffworks.com/how-to-play-the-lottery1.htm)

In most case of lottery they don't draw same number, but in our problem here same number are allowed. So here, you can play number "42 42 45 45 45" which is not allowed in common lottos.

They say there's more chance of you getting hit by a car on your way to buy a lotto ticket than the chance of winning one. Is the probability to win really that small? You are about to help me find out.

相關推薦

WHU 2013 Summer random contest #2 F

Do you know Lotto? Lotto is a game of probability. Six numbers are drawn from a range of numbers (such as 42, 47, 47, 49, 51, and 54). Michigan, for inst

Finals [Online Mirror, Div. 2] F

Splitting money time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output Afte

牛客網 小白月賽2 F 黑黑白白 【簡單sg博弈】

傳送門 題意: 就是每次在一顆有根樹上有一個棋子, 兩個人輪流的移動棋子, 且每次只能向其兒子移動, 不能移動者輸掉比賽, 給定這個樹的形態, 問是否先手必勝. 思路: 稍微瞭解一點sg博弈的都知道, 這就是sg博弈的最開始的引入呀, 就是在一副有向圖上進行

2018 Multi-University Training Contest 2 部分簡單解析

query mes pan rain ++ 兩個 long 暴力 modify Preface 多校第二場,依靠罰時優勢打到了校內的Rank 2 暴力分塊碾標算系列 T4 Game 題目大意:在一個數集\([1,n]\)中兩個人輪流選擇其中的一個數,並從數集中刪去這個數所

【清北學堂2018-刷衝刺】Contest 2

 這場比賽的T1相當智熄。由於至今無法理解題意,我只能解出前20分。諸位dalao誰能比較好地理解題意(獨立性)的,請聯絡我,不勝感激。  在此本蒟蒻只能貼上題面: Task 1:選舉 【問題描述】  一場選舉有三位選手分別編號為1,2,3,還有兩位評委4,5。  評委打分時會給出一個{1,2,3}

CCF CSP考題 2013-12 1、2 (找到出現最多的數,ISBN號碼判斷)

第一題 找到出現次數最多的數 試題編號:201312-1 試題名稱:出現次數最多的數 時間限制:1.0s 記憶體限制:256.0MB 問題描述: 問題描述   給定n個正整數,找出它們中出現次數最多

Codeforces Round #322 (Div. 2) F. Zublicanes and Mumocrates(樹形dp,好)

It's election time in Berland. The favorites are of course parties of zublicanes and mumocrates. The election campaigns of both parties include numerous

【BZOJ3781、2038】莫隊算法2

bsp space har 情況 ros clu while 給定 print 【BZOJ3781】小B的詢問 題意:有一個序列,包含N個1~K之間的整數。他一共有M個詢問,每個詢問給定一個區間[L..R],求Sigma(c(i)^2)的值,其中i的值從1到K,其中c(i

紫書第五章訓練2 F - Compound Words

每次 bre main sed color ons div img insert F - Compound Words You are to find all the two-word compound words in a dictionary. A two-word c

2017Summmer_上海金馬五校 F,G,I,K

sum 組隊 時序 而且 sizeof bit 屬性排序 print 浪費 以下題目均自己搜 F題 A序列 一開始真的沒懂題目什麽意思,還以為是要連續的子串,結果發現時序列,簡直智障,知道題意之後,好久沒搞LIS,有點忘了,復習一波以後,直接雙向LIS,處理處兩個數組L和

10-2

rfi 混亂 極角排序 manage usaco 排序 神題 bsp code Usaco混亂的奶牛。考慮到選的順序無關,裝壓DP即可 1232:安慰奶牛 將點券加入邊權,在找最小的根節點點權即可 路面休整:只會2000的,codevs2572 usaco2008 笨

Codeforces Round #441 F題解

答案 long hid 一個數 src else 單調棧 pri b2c 題目大意 給出一個有n個數的序列 求符合 區間各數或起來的數小於區間最大數 的區間的個數 題解 預處理出每個數每一位是0的那位左邊最近的1和右邊最近的1,用單調棧找出每個最大值所在的區間的左右端點

Codeforces Round #451 (Div. 2) F Restoring the Expression

rest strlen int() 開頭 都是 ret 代碼 += code 題意: 有一個a+b=c的等式,去掉兩個符號,把三個數連在一起得到一個數 給出這個數,要求還原等式,length <= 1e6 三個數不能含有前導0,保證有解 解法: 鐵頭過題法,分類然

Educational Codeforces Round 37 (Rated for Div. 2)F. SUM and REPLACE+線段樹

namespace ted amp return Education span num sign define 題目鏈接:F. SUM and REPLACE 題意:給一個數組,兩種操作,第一種把[L,R]的數變成這個數的因子個數(這個是log級別的下降),第二種求[L,

linux1-2

lin 安裝包 軟件包安裝 指定 rpm tar.bz2 benet 自己 mage 第一組: 1、創建/班級名目錄/本人目錄,進入本人名目錄,在本人目錄下建空文件名為123和abcmkdir 創建目錄驗證並建立空文件 123 和abc 用touch 命令 如下建立空文件

Codeforces Round #380 Div.2 F - Financiers Game

ems 們的 include c++ 超過 fine spa nan 情況下 F - Financiers Game 這種兩人博弈一般都可以用兩個dp寫, 一個dp描述第一個人的最優態, 第二個dp描述第二個人的最優態,難點在於優化空間。。。 我感覺這個空間開得有點玄學

Codeforces Round #482 (Div. 2) B

BE 題意 www. finally tdi code fir eterm htm B. Treasure Hunt time limit per test1 second memory limit per test:256 megabytes i

Codeforces Round #485 (Div. 2) C求三元組(思維)

rip ORC 它的 printf ble CA BE byte order C. Three displays time limit per test 1 second memory limit per test 256 megabytes input s

Codeforces Round #491 (Div. 2) F. Concise and clear

open back contain msu () put val atom ready F. Concise and clear time limit per test 2 seconds memory limit per test 256 megabyte

AtCoder Grand Contest 006 F - Blackout

sin 所在 long long || 如果 open int 雙向 mem Description 在 \(n*n\) 的棋盤上給出 \(m\) 個黑點,若 \((x,y)\),\((y,z)\) 都是黑點,那麽 \((z,x)\) 也會變成黑點,求最後黑點的數量 題面