POJ3696 The Luckiest Number 欧拉定理】的更多相关文章

昨天终于把欧拉定理的证明看明白了...于是兴冲冲地写了2道题,发现自己啥都不会qwq 题意:给定一个正整数L<=2E+9,求至少多少个8连在一起组成正整数是L的倍数. 这很有意思么... 首先,连续的8可表示为:8*(10^x-1)/9; 那么就是L|8*(10^x-1)*9 => 9*L|8*(10^x-1) ,求最小的x: 我们设d=gcd(L,8) 则9*L/d | 8/d*(10^x-1),因为此时9*L/d 和 8/d 互质,所以9*L/d | 10^x-1,所以 10^x ≡ 1…
题意 Language:Default The Luckiest number Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 7083 Accepted: 1886 Description Chinese people think of '8' as the lucky digit. Bob also likes digit '8'. Moreover, Bob has his own lucky number L. Now…
Chinese people think of '8' as the lucky digit. Bob also likes digit '8'. Moreover, Bob has his own lucky number L. Now he wants to construct his luckiest number which is the minimum among all positive integers that are a multiple of L and consist of…
题目:http://poj.org/problem?id=3696 题意:给你一个数字L,你要求出一个数N,使得N是L的倍数,且N的每位数都必须是8,输出N的位数(如果不存在输出0) 分析: 首先我们假设N是x个8组成的 那么88888...888=kL 提个8出来:8*111..1111=kL ① 因为题目只要求x的值,所以要弄出关于x的方程 11...111可以写成(10^k-1)/9 于是①变成了8(10^x-1)=9kL ② 再来回顾下题目,②式中x和k是变量,且都属于正整数,要根据②式…
一.题目 Chinese people think of '8' as the lucky digit. Bob also likes digit '8'. Moreover, Bob has his own lucky number L. Now he wants to construct his luckiest number which is the minimum among all positive integers that are a multiple of L and consi…
The Luckiest Number 题目大意:给你一个int范围内的正整数n,求这样的最小的x,使得:连续的x个8可以被n整除. 注释:如果无解输出0.poj多组数据,第i组数据前面加上Case i: 即可. 想法:这题还是挺好的.我最开始的想法是一定有超级多的数输出0.然后...我就在哪里找啊找....其实这道题是一道比较好玩儿的数论题.我们思考:连续的8可用什么来表示出来?$\frac{(10^x-1)}{9}\cdot 8$.其实想到这一步这题就做完了.这题的精髓就在于告诉我们连续的连…
Chinese people think of '8' as the lucky digit. Bob also likes digit '8'. Moreover, Bob has his own lucky number L. Now he wants to construct his luckiest number which is the minimum among all positive integers that are a multiple of L and consist of…
The Luckiest number Time Limit: 1000ms Memory Limit: 32768KB This problem will be judged on HDU. Original ID: 246264-bit integer IO format: %I64d      Java class name: Main Chinese people think of '8' as the lucky digit. Bob also likes digit '8'. Mor…
The Luckiest number Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 1163    Accepted Submission(s): 363 Problem Description Chinese people think of '8' as the lucky digit. Bob also likes digit '…
# 题解 一道数论欧拉函数和欧拉定理的入门好题. 虽然我提交的时候POJ炸掉了,但是在hdu里面A掉了,应该是一样的吧. 首先我们需要求的这个数一定可以表示成\(\frac{(10^x-1)}{9}\times 8\). 那么可以列出一个下面的方程 \[\frac{(10^x-1)}{9}\times 8=L\times k\] 设\(d=gcd(9L,8)=gcd(L,8)\) \[\frac89(10^x-1)=Lk\] \[\frac{8(10^x-1)}d=\frac{9Lk}{d}\]…