经典简约
清爽简洁,回归本真
液态水晶
毛玻璃+霓虹光带
赛博朋克
霓虹故障艺术风
🚫
违规操作检测
禁止使用右键菜单
⚠️ 此操作已被系统记录
1

The Lucky Game

📝 题解 🔵 仅限 C++
题目描述
<p>John and Brus believe that the digits 4 and 7 are lucky and all others are not. According to them, a lucky number is a number that contains only lucky digits in its decimal representation.</p> <p>John and Brus play the following game. Initially, there is an interval of integers between <b>a</b> and <b>b</b>, inclusive. Then, John choose a subinterval of the initial interval that contains exactly <b>jLen</b> numbers. Finally, Brus chooses a subinterval of John's subinterval that contains exactly <b>bLen</b> numbers. The outcome of the game is the total number of lucky numbers in Brus's subinterval.</p> <p>John follows the optimal strategy that maximizes the outcome. Brus follows the optimal strategy that minimizes the outcome. Return the outcome of the game.</p>
输入格式
<p>Each line contains four integers a,b,jLen,bLen.</p> <p>1&lt;=a&lt;=b&lt;=4747</p> <p>1&lt;=jLen&lt;=b-a+1</p> <p>1&lt;=bLen&lt;=jLen</p>
输出格式
<p>For each line of input,print the outcome of the game.</p>
样例
样例输入 1
1 10 2 1 4 8 3 2
样例输出 1
0 1
提交代码
请先登录后提交

🤖 AI 解题助手

DeepSeek
就绪
👋 你好!我是 AI 解题助手。
我已阅读了这道题,可以帮你分析思路、提供代码示例。
⚠️ 请先登录后使用