a039: Ten Half 十點半
標籤 : Comprehensive 綜合
通過比率 : 75% (9 人 / 12 人 ) (非即時)
評分方式 :
Tolerant

最近更新 : 2019-03-04 09:00

內容

“Ten Half” is a simple poker game similar to BlackJack. A is one point, 2 is two points, …, 10 is ten points, and each of J, Q, K is a half point. If your total point of cards is over 10.5, you lose the game.

“十點半”是一款類似於二十一點的簡單撲克遊戲。 A是1分,2是2分,......,10是10分,J,Q,K分別是半分。 如果您的總積分超過10.5,您就輸了這場遊戲。

輸入說明

The first line is an integer n(0<n<=10) that indicates the number of test cases. Other lines contain the cards you have in each test case. There is at least one card in each test case.

第一行是整數n(0 <n <= 10),表示測試例子的數量。 其他行包含每個測試例子中的撲克牌。 每個測試例子中至少有一張撲克牌。

輸出說明

Output the probability of losing the game, as a rounded integer scaled from 0 to 100 after you draw a card. If the cards you input have already exceeded 10.5 points, output -1. Add a newline at the end of each output.

輸出你抽一張牌後,輸掉遊戲的機率,捨入至0到100的整數。 如果您輸入的牌已經超過10.5點,則輸出-1。 在每個輸出的末端加上換行符號。

範例輸入
2
A 3 5
4 6 J K
範例輸出
69
-1
測資資訊 :
記憶體限制 : 64 MB
隱藏 測資點#0 (33%): 1.0s , <1K
隱藏 測資點#1 (33%): 1.0s , <1K
隱藏 測資點#2 (34%): 1.0s , <1K
提示 :
標籤:
Comprehensive 綜合
出處:
線上協同學習平臺 - ITSA 教育部資通訊軟體創新人才推升計畫 [編輯 :
zero_jason (zero_jason(MANAGER))
]


編號 身分 題目 主題 人氣 發表日期
8
610521236 (wth)
a039
251 2019-04-12 16:57