UVA 10127题目描述
Given any integer 0 ≤ n ≤ 10000 not divisible
by 2 or 5, some multiple of n is a number which
in decimal notation is a sequence of 1’s. How
many digits are in the smallest such a multiple
of n?
Input
A file of integers at one integer per line.
Output
Each output line gives the smallest integer x > 0
such that p =
∑x−1
i=0 1×10i = a×b, where a is the
corresponding input integer, and b is an integer
greater than zero.
Sample Input
3
7
9901
Sample Output
3
6
12
UVA 10127题目描述的更多相关文章
- UVA 10127题目的解答
#include <iostream>#include <cstdio>#include <cmath> int main(){ int num; while (s ...
- uva 10127 - Ones(数论)
题目链接:uva 10127 - Ones 题目大意:给出n,问说者少要多少为1才干够整除n. 解题思路:等于是高精度取模,直到余数为0为止. #include <cstdio> #inc ...
- 通过vjudge刷Uva的题目(解决Uva网站打开慢的问题)
最近在跟着算法竞赛入门经典刷题,发现Uva网站打开超级慢,进个主页面都需要好几秒.后来发现可以通过vjudge网站刷Uva的题目,很是方便,在这mark一下,顺便做一下推荐. vjudge网址:htt ...
- 【数论,水题】UVa 10127 - Ones
题目链接 题意:给你一个数n,问最少有多少个1构成的“1”串(1,11,...)能整除n; 比如:111能被3整除: 111111能被7整除:... 作为水货觉得只要自己能1A的都是水题=. = #i ...
- 题目描述: k一只青蛙一次可以跳上1级台阶,也可以跳上2级。求该青蛙跳上一个n级的台阶总共有多少种跳法。
时间限制:1秒 空间限制:32768k 斐波那契数列指的是这样一个数列: 0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144, 233,377,610,9 ...
- POJ 1035题目描述
Description You, as a member of a development team for a new spell checking program, are to write a ...
- POJ 1028题目描述
Description Standard web browsers contain features to move backward and forward among the pages rece ...
- Eugeny and Array(水题,注意题目描述即可)
Eugeny has array a = a1, a2, ..., an, consisting of n integers. Each integer ai equals to -1, or to ...
- 最小栈问题:题目描述:设计一个支持 push ,pop ,top 操作,并能在常数时间内检索到最小元素的栈。
MinStack minStack = new MinStack();minStack.push(-2);minStack.push(0);minStack.push(-3);minStack.get ...
随机推荐
- QInputDialog 使用方法
在Qt中,如果想快速生成一个对话框,可以和用户进行简单的交互,而不需要写一个新的类的时候,就要用到QInputDialog类,这个类就是专门用来建立简单对话框的,其主要能建下列几种对话框:
- 《Pro Git》笔记2:Git基础操作
第二章 Git基础 Git基础包括:版本库的创建和获取,文件添加修改提交等基本操作,状态查询,远程版本库管理和同步,打标签. 1.取得项目的Git版本库 基于Git的工作流要以Git版本库为基础,即可 ...
- NVPerfHUD
http://www.cnblogs.com/cproom/archive/2006/11/13/559287.html NVPerfHUD是一个很好的3D程序调试工具,它是NVPerfKit的一部分 ...
- tunnel.p4
Tunneling: VXLAN and NVGRE (including L2/L3 Gateway), Geneve, GRE and IPinIP /* Copyright 2013-prese ...
- PHP 错误与异常 笔记与总结(16 )自定义异常处理器
可以使用自定义异常处理器来处理所有未捕获的异常(没有用 try/catch 捕获的异常). set_exception_handler():设置一个用户定义的异常处理函数,当一个未捕获的异常发生时所调 ...
- ecshop数据库操作函数
ecshop数据库操作函数 分类: ecshop和dede2013-09-23 14:02 1716人阅读 评论(0) 收藏 举报 本章我们将结合eschop二次开发一些常见的开发例子.来谈谈ecsh ...
- SqlServer 高版本数据库 降级
SQL Server2012 1 首先就来介绍一下SQL Server2012数据库的降级方法,成功之后突然感觉很简单,但是没成功之前很郁闷.废话少说,直接开始. 打开SQL Server2012,连 ...
- 11.PHP内核探索:嵌入式PHP PHP内核探索:嵌入式PHP
从PHP源码目录结构的介绍以及PHP生命周期可知:嵌入式PHP类似CLI,也是SAPI接口的另一种实现. 一般情况下,它的一个请求的生命周期也会和其它的SAPI一样:模块初始化=>请求初始化=& ...
- garbage collection - 垃圾收集
Professional.JavaScript.for.Web.Developers.3rd.Edition.Jan.2012 JavaScript is a garbage-collected la ...
- Asp.net forms认证注意事项
1.N台服务器配置文件的相关配置要一致 <authentication mode="Forms"> <forms timeout="3600" ...