Search found 7 matches

by B.E
Thu Dec 14, 2006 10:09 am
Forum: Volume 5 (500-599)
Topic: 594 - One Little, Two Little, Three Little Endians
Replies: 46
Views: 13764

594 Problem

I would just like to say that the problem is very easy(did it in under a minute). The code I used was (which the CPU time was 0.004 seconds) The following. It works by using the 80386 assembly instruction to byte swap an integer (the instruction is often used to convert big endian numbers to little ...
by B.E
Fri May 27, 2005 12:36 am
Forum: Volume 1 (100-199)
Topic: 116 - Unidirectional TSP
Replies: 226
Views: 37522

it means that there is an invaild memory Reference
I not going to find it for u because it would take me weeks to read.
INDENT AND COMMENT and you will find.
by B.E
Fri May 27, 2005 12:05 am
Forum: Volume 6 (600-699)
Topic: 694 - The Collatz Sequence
Replies: 46
Views: 16223

Prehaps maybe one of u guy can post some of your code
by B.E
Fri May 27, 2005 12:00 am
Forum: Volume 6 (600-699)
Topic: 694 - The Collatz Sequence
Replies: 46
Views: 16223

my code #include <stdio.h> char *Format="%d %d"; int main() { int i,j; register unsigned int tmp; register int current_length,Longest_Length; while (scanf(Format,&i,&j)!= EOF) { Longest_Length = 0; printf(Format,i,j); if (i > j) { i ^=j; j ^=i; i ^=j; } if (j > 1000000) { return 1; } for (;i <= j;i+...
by B.E
Thu May 26, 2005 2:48 pm
Forum: Volume 6 (600-699)
Topic: 694 - The Collatz Sequence
Replies: 46
Views: 16223

I tryed it but it was slower than before
by B.E
Thu May 26, 2005 11:00 am
Forum: Volume 6 (600-699)
Topic: 694 - The Collatz Sequence
Replies: 46
Views: 16223

Collatz Problem

is there a quicker way of working out the cycle length then the standard iteration technique.
I can get the time down to 1.7 seconds but how do you guy get the time down to 0
by B.E
Tue May 24, 2005 5:53 am
Forum: Volume 1 (100-199)
Topic: 100 - The 3n + 1 problem
Replies: 1394
Views: 189276

I'm getting a wrong answer. :( //3n+1 problem #include <iostream> using namespace std; int main(int argc, char *argv[]) { long i,j; long tmp,current_length,Longest_Length; Longest_Length = 0; cin >> i >> j; cout << i << " " << j << " "; if (i > j) { i ^= j; j ^=i; i ^=j; } for (;i <= j;i++) { tmp = ...

Go to advanced search