Page 5 of 5

### Re: 10006 WA. Help Me!

Posted: Fri Sep 07, 2012 7:51 pm
570 is normal.

### Re: 10006 WA. Help Me!

Posted: Fri Sep 07, 2012 8:06 pm
Thank You BrianFry. I Got ACCCCCCCCCCCCCCCC

### Re: 10006 WA. Help Me!

Posted: Mon Apr 01, 2013 9:03 pm
I don't understand why i get WA, Is my algorithm is wrong ???. If algorithm is ok then need some I/O.
Here is my code :

Code: Select all

``````#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
#include <ctype.h>
#include <string>
#include <iostream>
#include <sstream>
#include <algorithm>
#include <vector>
#include <stack>
#include <queue>
#include <list>
#include <map>

using namespace std;

#define sf scanf
#define pf printf
#define ll long long
#define l long

void isprime();
bool BigMod(int n, int nm);

bool ck[65000], Carmichael_number[65000];
const int N = 65000;
int k;

int main()
{
pf("Accepted\n"); //   :D
}
``````

### Re: 10006 WA. Help Me!

Posted: Mon Apr 01, 2013 10:00 pm
The number 46657 is a Carmichael number.

### Re: 10006 WA. Help Me!

Posted: Mon Apr 01, 2013 11:02 pm

Code: Select all

``````Thanks brianfry713
``````

### 10006 - Carmichael Numbers Why getting WA!!!!!!!!

Posted: Sat Jun 28, 2014 11:20 am

Code: Select all

``````#include<iostream>
#include<cmath>
#include<cstdio>

int n;

int isPrime(int p)
{
double s;
s=sqrt(p);
for(int i=2;i<s+1;i++)
{
if(p%i==0) return 0;
}
return 1;

}
int isOdd()
{
if(n%2==0) return 0;
return 1;
}

int main()
{
double s;

//freopen("in.txt","r",stdin);
//freopen("out.txt","w",stdout);
while(1)
{
int flag=0;
scanf("%d",&n);
if(n==0) break;
if(!isOdd()) flag=1;
else
{
if(isPrime(n))
{
flag=1;

}
s=sqrt(n);
for(int i=3;i<=s+1;i++)
{

if(n%i==0 and isPrime(i))
{
if((n-1)%(i-1)!=0)
{
flag=1;
break;
}
}
}

}
if(flag==1) printf("%d is normal.\n",n);
else printf("The number %d is a Carmichael number.\n",n);
}

//if(flag==0) printf("%d is normal.\n",n);
//else printf("The number %d is a Carmichael number.\n",n);

return 0;
}

``````

### Re: 10006 - Carmichael Numbers Why getting WA!!!!!!!!

Posted: Mon Jul 07, 2014 11:05 pm
9 is normal.