oh bythe way here is my code:
#include "fstream"
#include "string.h"
using namespace std;
int rule_table[8][4]={{0,0,0,0},{0,0,1,0},{0,1,0,0},{0,1,1,0},{1,0,0,0},{1,0,1,0},{1,1,0,0},{1,1,1,0}};
int cells;
char current_state[33];
int making[33];
void set_rules(int a){
register int i;
for(i=0;i ...
Search found 3 matches
- Fri Oct 21, 2005 8:04 pm
- Forum: Volume 100 (10000-10099)
- Topic: 10001 - Garden of Eden
- Replies: 39
- Views: 20335
- Thu Oct 20, 2005 5:43 pm
- Forum: Volume 100 (10000-10099)
- Topic: 10001 - Garden of Eden
- Replies: 39
- Views: 20335
10001 WA?
hi everybody,
i need some test cases for this problem.i managed to solve it in 3 sec using backtracking,but got WA.
thanks.
i need some test cases for this problem.i managed to solve it in 3 sec using backtracking,but got WA.
thanks.
- Wed Dec 17, 2003 11:00 pm
- Forum: Volume 100 (10000-10099)
- Topic: 10006 - Carmichael Numbers
- Replies: 66
- Views: 29542
How to solve 10006
Hi there!
for testing the a^n %n==a statement you can use the divide method like this:
[cpp]
unsigned long int bigmod(unsigned long int a,unsigned long int b,unsigned long int c){
if (b==0)
return 1;
else if (b==1)
return a%c;
else if (b%2==0){
int k=bigmod(a,b/2,c)%c;
return (k*k)%c ...
for testing the a^n %n==a statement you can use the divide method like this:
[cpp]
unsigned long int bigmod(unsigned long int a,unsigned long int b,unsigned long int c){
if (b==0)
return 1;
else if (b==1)
return a%c;
else if (b%2==0){
int k=bigmod(a,b/2,c)%c;
return (k*k)%c ...