ICode9

精准搜索请尝试: 精确搜索
首页 > 其他分享> 文章详细

英语题目作业(6)

2022-01-22 21:33:13  阅读:165  来源: 互联网

标签:题目 魔力 作业 number magical 123 124 a1a2 英语


原题:

Magical Number

 1000ms  131072K

描述:

We consider a natural number pp with kk digits, a1a2..ak(a1≠0)a1a2..ak¯(a1≠0), is magical only when it satisfies:

Every number composed by leading digits of pp can be divisible by the number of its digits.

More formally, ∀i∈[1,k]∀i∈[1,k],i|a1a2..ai。

For example, 123 is magical, because 1|1, 2|12, 3|123。

However,124 is not magical, because 3∤124。

Every digit can be composed with match sticks in the following ways.

What is the largest posible magical number you can compose with exactly nn match sticks?

输入:

The input contains a integer n(1≤n≤10100)n(1≤n≤10100), the number of match sticks you have .

输出:

Print the largest posible magical number xx that can be possibly composed with exactly nn match sticks.

If the number doesn't exist, print −1−1.

 (链接:https://acs.jxnu.edu.cn/problem/ICPCJX2020F)

翻译:

魔力数字

由k位数组成的自然数p,a1a2···ak(ai!=0)只有当它满足:每个由前导位数p组成的数字能被p的位数整除,我们认为它是一个魔力数字。

即∀i∈[1,k],i|a1a2..ai

例如,123是一个魔力数字,因为1|1,2|12(12能被2整除),3|123(123能被3整除)

然而,124不是个魔力数字,因为3∤124(124不能被3整除)

每个数字都能用火柴棍按下面方式摆出来。

你用n根火柴棍最大可能能拜出的魔力数字是?

输入:

输入一个整数n(1<=n<=10^100),代表你有的火柴棍;

输出:

输出最大可能的魔力数字x,可能由n根火柴棍组成。

如果数字不存在,输出-1。

标签:题目,魔力,作业,number,magical,123,124,a1a2,英语
来源: https://blog.csdn.net/m0_65788482/article/details/122642972

本站声明: 1. iCode9 技术分享网(下文简称本站)提供的所有内容,仅供技术学习、探讨和分享;
2. 关于本站的所有留言、评论、转载及引用,纯属内容发起人的个人观点,与本站观点和立场无关;
3. 关于本站的所有言论和文字,纯属内容发起人的个人观点,与本站观点和立场无关;
4. 本站文章均是网友提供,不完全保证技术分享内容的完整性、准确性、时效性、风险性和版权归属;如您发现该文章侵犯了您的权益,可联系我们第一时间进行删除;
5. 本站为非盈利性的个人网站,所有内容不会用来进行牟利,也不会利用任何形式的广告来间接获益,纯粹是为了广大技术爱好者提供技术内容和技术思想的分享性交流网站。

专注分享技术,共同学习,共同进步。侵权联系[81616952@qq.com]

Copyright (C)ICode9.com, All Rights Reserved.

ICode9版权所有