Search:

Type: Posts; User: aesguitar

Search: Search took 0.09 seconds.

  1. Re: Problem getting rid of congruent triangles from a counter.

    Run this. I'll give you my Timer.



    public class Tester {

    /**
    * @param args
    */
    public static void main(String[] args) {
  2. Re: Problem getting rid of congruent triangles from a counter.

    That solved it. How fast does this algorithm run for you? I have a new computer with a very fast i7 in it. Does it run in about 10ms for you with out the debug printing? Just want to see how...
  3. Re: Problem getting rid of congruent triangles from a counter.

    Because right triangles with perimeter 12 were the only ones found. The sides array was supposed to be added twice to perims.get(12) on two separate occasions. Which it was, but something apparently...
  4. Re: Problem getting rid of congruent triangles from a counter.

    This is the code I'm using to print out perims.



    for(int i = 0; i < perims.size(); i++)
    {
    System.out.print("perims:" + i +": ");
    for(int[] j : perims.get(i))
    {...
  5. Re: Problem getting rid of congruent triangles from a counter.

    This is what I get when I print perims after everything is added together, before anything else happens.



    Perimeter: 12 ; Sides: {3, 4, 5}
    Perimeter: 12 ; Sides: {4, 3, 5}
    perims:0: ...
  6. Re: Problem getting rid of congruent triangles from a counter.

    Perimeter: 12 ; Sides: {3, 4, 5}
    Perimeter: 12 ; Sides: {4, 3, 5}
    triangles[12] = 1
    Elapsed time: 0.001 sec.


    This is what was printed out. I used 15 as the size. Code edited to use a variable...
  7. Re: Problem getting rid of congruent triangles from a counter.

    Ignore timer. That's my own class. I use it for timing the amount of time it takes. Neither of the imports are used in this program. This is my 'general use' class. These are the Algorithms.*...
  8. Re: Problem getting rid of congruent triangles from a counter.

    Code with comments:



    package tools;

    import java.util.*;

    import org.jscience.mathematics.number.LargeInteger;
  9. Problem getting rid of congruent triangles from a counter.

    I've been trying to solve this problem of Project euler: Problem 39 - Project Euler

    I've run into a problem with sorting out triangle sides that are already used like {3,4,5} and {4,3,5} and so...
Results 1 to 9 of 10