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题目描述的更多相关文章

  1. UVA 10127题目的解答

    #include <iostream>#include <cstdio>#include <cmath> int main(){ int num; while (s ...

  2. uva 10127 - Ones(数论)

    题目链接:uva 10127 - Ones 题目大意:给出n,问说者少要多少为1才干够整除n. 解题思路:等于是高精度取模,直到余数为0为止. #include <cstdio> #inc ...

  3. 通过vjudge刷Uva的题目(解决Uva网站打开慢的问题)

    最近在跟着算法竞赛入门经典刷题,发现Uva网站打开超级慢,进个主页面都需要好几秒.后来发现可以通过vjudge网站刷Uva的题目,很是方便,在这mark一下,顺便做一下推荐. vjudge网址:htt ...

  4. 【数论,水题】UVa 10127 - Ones

    题目链接 题意:给你一个数n,问最少有多少个1构成的“1”串(1,11,...)能整除n; 比如:111能被3整除: 111111能被7整除:... 作为水货觉得只要自己能1A的都是水题=. = #i ...

  5. 题目描述: k一只青蛙一次可以跳上1级台阶,也可以跳上2级。求该青蛙跳上一个n级的台阶总共有多少种跳法。

    时间限制:1秒     空间限制:32768k 斐波那契数列指的是这样一个数列: 0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144, 233,377,610,9 ...

  6. POJ 1035题目描述

    Description You, as a member of a development team for a new spell checking program, are to write a ...

  7. POJ 1028题目描述

    Description Standard web browsers contain features to move backward and forward among the pages rece ...

  8. Eugeny and Array(水题,注意题目描述即可)

    Eugeny has array a = a1, a2, ..., an, consisting of n integers. Each integer ai equals to -1, or to ...

  9. 最小栈问题:题目描述:设计一个支持 push ,pop ,top 操作,并能在常数时间内检索到最小元素的栈。

    MinStack minStack = new MinStack();minStack.push(-2);minStack.push(0);minStack.push(-3);minStack.get ...

随机推荐

  1. erlang-jiffy 安装手记

    今天安装 erlang-jiffy 把握逼疯,不过最后还是成功了. 错误避免: rebar只能再英文目录下运行,如果编译jiffy的目录中有中文或其它unicode字符,将会出错 从git relea ...

  2. 一种少见的跨目录写webshell方法

    http://hi.baidu.com/kwthqquszlbhkyd/item/480716204cfa33c3a5275afa

  3. 1215课后练习----indexOf的用法

    package com.hanqi; public class Testco { public static void main(String[] args) { String str1 = &quo ...

  4. KMS错误代码收集

    Q:KMS认证时,错误讯息代码0x80070005? A:-0x80070005:存取遭拒.要求的动作要求较高的权限. -这个错误讯息,代表您在执行命令提示字元(cmd)时,没有以系统管理员的身份执行 ...

  5. STATIC::含义

    Static 关键字,是作为作用域引用,类似Parent和self 关键字,和Parent和 Self不同 Parent引用父类作用域 Self 引用当前类作用域 Static 引用全部静态作用于,子 ...

  6. 解析数据存储MySQL

    为了适应不同项目对不同感兴趣属性的解析存储,数据存储结构采用纵向的属性列表方式,即一个url页面多个属性存储多条记录方式,并且按照text,html, data,num几大典型类型分别对应存储. 创建 ...

  7. Ubuntu中搭建Nginx+PHP环境最简单的方法

    先安装: sudo apt-get install nginx php5-fpm 然后编辑配置文件: sudo gedit /etc/nginx/site-available/default 找到lo ...

  8. 百度BAE环境下WordPress安装教程

    不了解代码的童鞋慎重使用这种方法哦,安装过程中可能会出现一些简单的错误. 前两天有位网友在QQ上联系我,他告诉我自己在百度BAE上安装WordPress程序总是出错.我让他按照网络上的教程逐步安装,但 ...

  9. 【转载】MySQL性能优化的最佳20+条经验

    今天,数据库的操作越来越成为整个应用的性能瓶颈了,这点对于Web应用尤其明显.关于数据库的性能,这并不只是DBA才需要担心的事,而这更是我们程序员需要去关注的事情.当我们去设计数据库表结构,对操作数据 ...

  10. Programming In hardware Programming in software

    COMPUTER ORGANIZATION AND ARCHITECTURE DESIGNING FOR PERFORMANCE NINTH EDITION