1467: Pku3243 clever Y Time Limit: 4 Sec Memory Limit: 64 MB[Submit][Status][Discuss] Description 小Y发现,数学中有一个很有趣的式子: X^Y mod Z = K 给出X.Y.Z,我们都知道如何很快的计算K.但是如果给出X.Z.K,你是否知道如何快速的计算Y呢? Input 本题由多组数据(不超过20组),每组测试数据包含一行三个整数X.Z.K(0 <= X, Z, K <= 109). 输入文…
1467: Pku3243 clever Y Time Limit: 4 Sec Memory Limit: 64 MBSubmit: 313 Solved: 181[Submit][Status][Discuss] Description 小Y发现,数学中有一个很有趣的式子: X^Y mod Z = K 给出X.Y.Z,我们都知道如何很快的计算K.但是如果给出X.Z.K,你是否知道如何快速的计算Y呢? Input 本题由多组数据(不超过20组),每组测试数据包含一行三个整数X.Z.K(0…
1467: Pku3243 clever Y Time Limit: 4 Sec Memory Limit: 64 MBSubmit: 425 Solved: 238[Submit][Status][Discuss] Description 小Y发现,数学中有一个很有趣的式子: X^Y mod Z = K 给出X.Y.Z,我们都知道如何很快的计算K.但是如果给出X.Z.K,你是否知道如何快速的计算Y呢? Input 本题由多组数据(不超过20组),每组测试数据包含一行三个整数X.Z.K(0…
Description Little Y finds there is a very interesting formula in mathematics: XY mod Z = K Given X, Y, Z, we all know how to figure out K fast. However, given X, Z, K, could you figure out Y fast? Input Input data consists of no more than 20 test ca…
Description Little Y finds there is a very interesting formula in mathematics: XY mod Z = K Given X, Y, Z, we all know how to figure out K fast. However, given X, Z, K, could you figure out Y fast? Input Input data consists of no more than 20 test ca…
题目链接:http://lightoj.com/volume_showproblem.php?problem=1215 题意:已知三个数a b c 的最小公倍数是 L ,现在告诉你 a b L 求最小的 c ; 其实就是告诉你(最小公倍数LCM)LCM(x, y) = L 已知 x 和 L 求 最小的 y ; L = LCM(x, y)=x*y/gcd(x, y);如果把x,y,L写成素因子之积的方式会很容易发现 L 就是 x 和 y 中素因子指数较大的那些数之积; 例如LCM(24, y)…
B - 小Y上学记——小Y的玩偶 Time Limit: 2000/1000MS (Java/Others) Memory Limit: 128000/64000KB (Java/Others) Submit Status Problem Description 小Y最喜欢拆拆拆了~尽管他不一定能装回去. 小Y有一个很可爱的积木玩偶,是由一块一块积木拼接而成,现在小Y想把这个积木玩偶拆拆拆. 每一块积木玩偶都有一个耐久值,想把一块积木拆出来,小Y需要付出的能量就是和它直接拼接的所有积木的耐…
每次把gcd(a,c)提到前面,直到a,c互质,然后就是普通BSGS了 #include<cstdio> #include<cstring> #include<iostream> #include<algorithm> #include<cmath> #define LL long long using namespace std; struct hashtable{ static const int N=577399; int tot,hash…
B. Proper Nutrition time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output Vasya has n burles. One bottle of Ber-Cola costs a burles and one Bars bar costs b burles. He can buy any non-negative in…
Dating with girls(1) Time Limit: 6000/2000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 5709 Accepted Submission(s): 1855 Problem Description Everyone in the HDU knows that the number of boys is larger than the…