电脑桌面
添加小米粒文库到电脑桌面
安装后可以在桌面快捷访问

2025年福建省第三届大学生程序设计竞赛题目

2025年福建省第三届大学生程序设计竞赛题目_第1页
1/25
2025年福建省第三届大学生程序设计竞赛题目_第2页
2/25
2025年福建省第三届大学生程序设计竞赛题目_第3页
3/25
Problem A Solve equationAccept: 111 Submit: 229Time Limit: 1000 mSec Memory Limit : 32768 KBProblem DescriptionYou are given two positive integers A and B in Base C. For the equation:A=k*B+dWe know there always existing many non-negative pairs (k, d) that satisfy the equation above. Now in this problem, we want to maximize k.For example, A="123" and B="100", C=10. So both A and B are in Base 10. Then we have:(1) A=0*B+123(2) A=1*B+23As we want to maximize k, we finally get one solution: (1, 23)The range of C is between 2 and 16, and we use 'a', 'b', 'c', 'd', 'e', 'f' to represent 10, 11, 12, 13, 14, 15, respectively.InputThe first line of the input contains an integer T (T≤10), indicating the number of test cases.Then T cases, for any case, only 3 positive integers A, B and C (2≤C≤16) in a single line. You can assume that in Base 10, both A and B is less than 2^31.OutputFor each test case, output the solution “(k,d)” to the equation in Base 10.Sample Input32bc 33f 16123 100 101 1 2 Sample Output(0,700)(1,23)(1,0)Problem B Bin & Jing in wonderlandAccept: 4 Submit: 28Time Limit: 1000 mSec Memory Limit : 32768 KBProblem DescriptionBin has a dream that he and Jing are both in a wonderland full of beautiful gifts. Bin wants to choose some gifts for Jing to get in her good graces.There are N different gifts in the wonderland, with ID from 1 to N, and all kinds of these gifts have infinite duplicates. Each time, Bin shouts loudly, “I love Jing”, and then the wonderland random drop a gift in front of Bin. The dropping probability for gift i (1≤i≤N) is P(i). Of cause, P(1)+P(2)+…+P(N)=1. Bin finds that the gifts with the higher ID are better. Bin shouts k times and se...

1、当您付费下载文档后,您只拥有了使用权限,并不意味着购买了版权,文档只能用于自身使用,不得用于其他商业用途(如 [转卖]进行直接盈利或[编辑后售卖]进行间接盈利)。
2、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。
3、如文档内容存在违规,或者侵犯商业秘密、侵犯著作权等,请点击“违规举报”。

碎片内容

2025年福建省第三届大学生程序设计竞赛题目

您可能关注的文档

确认删除?
VIP
微信客服
  • 扫码咨询
会员Q群
  • 会员专属群点击这里加入QQ群
客服邮箱
回到顶部