HDOJ 2117 Just a Numble(模拟除法)】的更多相关文章

Problem Description Now give you two integers n m, you just tell me the m-th number after radix point in 1/n,for example n=4,the first numble after point is 2,the second is 5,and all 0 followed Input Each line of input will contain a pair of integers…
Just a Numble Time Limit: 3000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 2107    Accepted Submission(s): 987 Problem Description Now give you two integers n m, you just tell me the m-th number after radix…
PTA 7-42 整除光棍 #include <stdio.h> int main() { ];//创建存表 ,count=; int n; ; scanf("%d",&n); ) { count++; if(len||t/n)//商第一位为0,不存入数组中 { a[len]='+t/n;//把数字变为字符存储 len++; } t%=n;//取余数 )//判断余数是否为零,余数为0结束 { a[len]='\0';//输入数组终止符 printf("%s…
题目链接 https://www.patest.cn/contests/gplt/L1-046 思路 用同余定理以及模拟除法. AC代码 #include <iostream> #include <cstdio> #include <algorithm> #include <cmath> #include <deque> #include <vector> #include <queue> #include <str…
http://acm.hdu.edu.cn/showproblem.php?pid=2117 Problem Description Now give you two integers n m, you just tell me the m-th number after radix point in 1/n,for example n=4,the first numble after point is 2,the second is 5,and all 0 followed   Input E…
L1-046. 整除光棍 时间限制 400 ms 内存限制 65536 kB 代码长度限制 8000 B 判题程序 Standard 作者 翁恺 这里所谓的"光棍",并不是指单身汪啦~ 说的是全部由1组成的数字,比如1.11.111.1111等.传说任何一个光棍都能被一个不以5结尾的奇数  整除.比如,111111就可以被13整除. 现在,你的程序要读入一个整数x,这个整数一定是奇数并且不以5结尾.然后,经过计算,输出两个数  字:第一个数字s,表示x乘以s是一个光棍,第二个数字n是这…
行数或列数为奇数就能够所有走完. 行数和列数都是偶数,能够选择空出一个(x+y)为奇数的点. 假设要空出一个(x+y)为偶数的点,则必须空出其它(x+y)为奇数的点 Travelling Salesman Problem Time Limit: 3000/1500 MS (Java/Others)    Memory Limit: 65536/65536 K (Java/Others) Total Submission(s): 747    Accepted Submission(s): 272…
CRB and String Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/65536 K (Java/Others) Total Submission(s): 491    Accepted Submission(s): 186 Problem Description CRB has two strings s and t. In each step, CRB can select arbitrary charact…
Johnny is a brilliant mathematics student. He loves mathematics since he was a child, now he is working on his PhD thesis. He faces a small mathematical problem, he has a n digit integer number (let us call it s) , he wants to find how many substring…
题意: 这里所谓的“光棍”,并不是指单身汪啦~ 说的是全部由1组成的数字,比如1.11.111.1111等.传说任何一个光棍都能被一个不以5结尾的奇数整除.比如,111111就可以被13整除. 现在,你的程序要读入一个整数x,这个整数一定是奇数并且不以5结尾.然后,经过计算,输出两个数字:第一个数字s,表示x乘以s是一个光棍,第二个数字n是这个光棍的位数.这样的解当然不是唯一的,题目要求你输出最小的解. 提示:一个显然的办法是逐渐增加光棍的位数,直到可以整除x为止.但难点在于,s可能是个非常大的…