Search found 15 matches

by Zuza
Thu Apr 26, 2007 7:25 pm
Forum: Volume 107 (10700-10799)
Topic: 10702 - Travelling Salesman
Replies: 20
Views: 9506

My original method ( printf( "%d\n", best ); ) prints a line per set.
by Zuza
Thu Apr 26, 2007 12:43 pm
Forum: Volume 107 (10700-10799)
Topic: 10702 - Travelling Salesman
Replies: 20
Views: 9506

10702 PE

I'm printing the output with

Code: Select all

printf( "%d\n", best );
just as the problem suggests it and I don't know how to get rid of the presentation error.
I tried leaving blank after each set and leaving a blank line between each set.
by Zuza
Fri Sep 01, 2006 2:50 am
Forum: Volume 110 (11000-11099)
Topic: 11064 - Number Theory
Replies: 25
Views: 16333

You might wanna watch out for this... ( I got TLE becouse of it )

i wrote

Code: Select all

for( int i = 2; i*i <= n; ++i ) ...
instead of

Code: Select all

for( long long i = 2; i*i <= n; ++i ) ...
enjoy... :)
by Zuza
Sun Jun 12, 2005 7:40 pm
Forum: Volume 100 (10000-10099)
Topic: 10098 - Generating Fast
Replies: 62
Views: 14237

Input:

Code: Select all

1
aaa
Your Output:

Code: Select all

aaa
aaa
aaa
aaa
aaa
aaa
Correct Output:

Code: Select all

aaa
Two identical permutations muss not be printed...
by Zuza
Sun Jun 12, 2005 7:26 pm
Forum: Volume 1 (100-199)
Topic: 107 - The Cat in the Hat
Replies: 278
Views: 21770

Re: hints for 107. TLE

I got AC. but.. but, when change the my code ( pow -> my function ) i got AC ( 0:05.619 ; CPU ) I was just wondering... Try using a pow function that runs in O( lg n ) time, but uses recursion which is sooo slow. What running time will you get ? typedef unsigned int uint; uint power( uint b, uint e...
by Zuza
Wed Dec 29, 2004 7:23 pm
Forum: Volume 107 (10700-10799)
Topic: 10796 - Right Hand Rule
Replies: 7
Views: 4813

Thx Little Joey , I finally got Acc.

The Problem was that there was a (dirty :) ) trick in the input files (which I believe you already know about). I hope my input will help someone.
by Zuza
Wed Dec 29, 2004 5:18 pm
Forum: Volume 107 (10700-10799)
Topic: 10796 - Right Hand Rule
Replies: 7
Views: 4813

10796 - Right Hand Rule

I got many WA becouse of this problem. Can somebodey werify the correctness of this test cases? 19 20 20 1 17 19 0 0 19 D ###################. #.#.#.#.#.#.#.#.#.#. #.#.#.#.#.#.#.#.#.#. #.#.#.#.#.#.#.#.#.#. #.#.#.#.#.#.#.#.#.#. #.#.#.#.#.#.#.#.#.#. #.#.#.#.#.#.#.#.#.#. #.#.#.#.#.#.#.#.#.#. #.#.#.#.#....
by Zuza
Mon Nov 01, 2004 5:54 pm
Forum: Volume 1 (100-199)
Topic: 110 - Meta-Loopless Sorts
Replies: 92
Views: 8186

You were this close to solving this problem... Look at your excetion check (if(n==1e)). Remove the "writenln" and replace it with the writeln, that should do the trick (I hope so). :wink:
by Zuza
Mon Nov 01, 2004 5:40 pm
Forum: Volume 1 (100-199)
Topic: 195 - Anagram
Replies: 242
Views: 27779

There's no compile error becouse the i's are in different scopes, thus the i in the first loop doesn't clash with the second i. Think about it as a function. The local variables do not clash with the globals so you can adress the outer scope with the scope operator ( :: ). :) BTW, you can be assured...
by Zuza
Mon Nov 01, 2004 5:30 pm
Forum: Volume 1 (100-199)
Topic: 101 - The Blocks Problem
Replies: 635
Views: 42461

SIGSEGV

SIGSEGV is a runtime error that happens when you reference memory out of bounds. It can happen when you (let's say) allocate an array of 100 members and then you start to write on position array[150] or so.
by Zuza
Sun Oct 31, 2004 4:23 pm
Forum: Volume 100 (10000-10099)
Topic: 10096 - The Richest Man of the Universe
Replies: 42
Views: 16702

No need to bother. I figured it out. r2=r1/sqrt(2)
by Zuza
Wed Oct 27, 2004 2:30 pm
Forum: Volume 100 (10000-10099)
Topic: 10098 - Generating Fast
Replies: 62
Views: 14237

Generation optimisation

You could do two things: optimise your check which asks has that permutation been listed :) or you can write an algorithm that doesn't even need to check that. Consider this: when you have a string "aab" you repeat the "aab" only if you place two "a"s on the same position in the generation. Try to a...
by Zuza
Mon Oct 11, 2004 3:19 pm
Forum: Volume 100 (10000-10099)
Topic: 10096 - The Richest Man of the Universe
Replies: 42
Views: 16702

10096 fission?

Can somebody explain me the process of fission in 10096? Does the initial virus (with the specs got from the input) splits in two viruses with radii equal one half the initial or we have to split up two viruses of input sizes?
by Zuza
Mon Oct 11, 2004 3:13 pm
Forum: Volume 100 (10000-10099)
Topic: 10038 - Jolly Jumpers
Replies: 445
Views: 82749

Perhaps the difference between two consecutive numbers does not ascend (or decend) sequentaly . Consieder the sequence 1 2 5 3. Your program tells you that it's not jolly, but actualy it is because the difference between the elements are 1, 3 and 2 which are all the values from 1 to 3. I hope this h...
by Zuza
Tue Oct 05, 2004 9:02 pm
Forum: Volume 1 (100-199)
Topic: 108 - Maximum Sum
Replies: 233
Views: 24159

As you found out your program is too slow because it runs in apx 10^1 (if n=100). We could solve this problem using DP in a similar way as if we would check for the maximum sum of consecutive element in an array (lets assume that there isn't any O(n) nor O(n log n) algorithm). First, we need a effic...

Go to advanced search