r774. Game
標籤 : Zaim
通過比率: 1人/ 1人 ( 100%) [非即時]
評分方式:
Tolerant

最近更新 : 2025-12-13 20:30

內容

Zzzz was secretly playing Spider Solitaire. Sometimes he won, sometimes he lost. Feeling someone's gaze, he stopped playing and started coding. Believing he'd evaded suspicion, he resumed the game. Then, during his brief coding stint, he noticed a noticeable improvement in his gaming skills.

Now, Zzzz won't lose in any future games. However, since he can't delete his game records, he believes his poor performances from the past don't prove his current prowess.

The game record looks like this:

  • Number of games: X
  • Games won: Y (Z%)
  • Z is Zzzz's winning percentage, with the decimal point removed. For example, if X=53 and Y=47, then Z=88.

Given X and Y, write a program to find the minimum number of times Zzzz must play the game before Z changes.

輸入說明

Each line contains integers X and Y.

輸出說明

On the first line, print the minimum number of rounds Zzzz needs to play. If Z never changes, print -1.

範例輸入 #1
10 8
範例輸出 #1
1
範例輸入 #2
100 80
範例輸出 #2
6
範例輸入 #3
47 47
範例輸出 #3
-1
範例輸入 #4
99000 0
範例輸出 #4
1000
測資資訊:
記憶體限制: 128 MB
不公開 測資點#0 (5%): 0.5s , <1K
不公開 測資點#1 (5%): 0.5s , <1K
不公開 測資點#2 (5%): 0.5s , <1K
不公開 測資點#3 (5%): 0.5s , <1K
不公開 測資點#4 (5%): 0.5s , <1K
不公開 測資點#5 (5%): 0.5s , <1K
不公開 測資點#6 (5%): 0.5s , <1K
不公開 測資點#7 (5%): 0.5s , <1K
不公開 測資點#8 (5%): 0.5s , <1K
不公開 測資點#9 (5%): 0.5s , <1K
不公開 測資點#10 (5%): 0.5s , <1K
不公開 測資點#11 (5%): 0.5s , <1K
不公開 測資點#12 (5%): 0.5s , <1K
不公開 測資點#13 (5%): 0.5s , <1K
不公開 測資點#14 (5%): 0.5s , <1K
不公開 測資點#15 (5%): 0.5s , <1K
不公開 測資點#16 (5%): 0.5s , <1K
不公開 測資點#17 (5%): 0.5s , <1K
不公開 測資點#18 (5%): 0.5s , <1K
不公開 測資點#19 (5%): 0.5s , <1K
提示 :
標籤:
Zaim
出處:
[管理者: chenwei98050 ... (陳維(Z)) ]

本題狀況 本題討論 排行

編號 身分 題目 主題 人氣 發表日期
沒有發現任何「解題報告」