早教吧作业答案频道 -->其他-->
ZOJ1489运行正确,WA,应该是求最小X地方错了,真心求改正ZOJProblemSet-14892^xmodn=1--------------------------------------------------------------------------------TimeLimit:1SecondMemoryLimit:32768KB---------------------
题目详情
ZOJ 1489 运行正确,WA,应该是求最小X地方错了,真心求改正
ZOJ Problem Set - 14892^x mod n = 1
--------------------------------------------------------------------------------
Time Limit:1 Second Memory Limit:32768 KB
--------------------------------------------------------------------------------
Give a number n,find the minimum x that satisfies 2^x mod n = 1.
Input
One positive integer on each line,the value of n.
Output
If the minimum x exists,print a line with 2^x mod n = 1.
Print 2^?mod n = 1 otherwise.
You should replace x and n with specific numbers.
Sample Input
2
5
Sample Output
2^?mod 2 = 1
2^4 mod 5 = 1
-------------------------------------------------------------------------------------------
#include
#include
int main()
{
int n,x,i,count,a;
scanf("%d",&n);
if(n%2==1)
{
a=1;
for(x=1;x
ZOJ Problem Set - 14892^x mod n = 1
--------------------------------------------------------------------------------
Time Limit:1 Second Memory Limit:32768 KB
--------------------------------------------------------------------------------
Give a number n,find the minimum x that satisfies 2^x mod n = 1.
Input
One positive integer on each line,the value of n.
Output
If the minimum x exists,print a line with 2^x mod n = 1.
Print 2^?mod n = 1 otherwise.
You should replace x and n with specific numbers.
Sample Input
2
5
Sample Output
2^?mod 2 = 1
2^4 mod 5 = 1
-------------------------------------------------------------------------------------------
#include
#include
int main()
{
int n,x,i,count,a;
scanf("%d",&n);
if(n%2==1)
{
a=1;
for(x=1;x
▼优质解答
答案和解析
#include
#include
int main()
{
int n,x,i,count,a;
while(scanf("%d",&n)==1) // 多组输入
{
count=0; // 初始化count
if(n%2==1)
{
a=1;
for(x=1;x
#include
int main()
{
int n,x,i,count,a;
while(scanf("%d",&n)==1) // 多组输入
{
count=0; // 初始化count
if(n%2==1)
{
a=1;
for(x=1;x
看了ZOJ1489运行正确,WA,...的网友还看了以下:
请问求原点到曲面在z^2=xy+x-y+4的最短距离,建立方程L(x,y,z,c)=(x^2+y^ 2020-05-16 …
求平面x/3+y/4+z/5=1和柱面x2+y2=1的交线上与平面距离最短的点.求平面x/3+y/ 2020-07-30 …
1.若复数z满足:|z|=1+3i+z,则:[(1+i)^3(3i-4)]/2z=2.若|z-2- 2020-08-02 …
1.(1-1/2^2)(1-1/3^2)(1-1/4^2)…(1-1/9^2)(1-1/10^2)2 2020-10-31 …
若x/3=y/4=z/5(z不等于0),求x+y+z/x-y-z的值.提示:可先令x/3=y/4=z 2020-10-31 …
若Z^7=1且Z≠1,求1+Z+Z^2+Z^3+Z^4+Z^5+Z^61+Z+Z^2+Z^3+Z^4 2020-10-31 …
高数求与已知直线(x+3)/2=(y-5)/3=z及(x-10)/5=(y+7)/4=z相交且与直线 2020-10-31 …
设xyz属于R,x+y+z=1,x^2+y^2+z^2=2,x^3+y^3+z^3=设xyz属于R, 2020-11-01 …
证明:(z-1)^4+(z+1)^4=0的根是±icot(π/8),±icot(3π/8)还有一题: 2020-11-01 …
整式的运算数学题!若(x+z)²-4(x-y)(y-z)=0,试求x+z与y的关系1、若(x+z)² 2020-11-15 …