Search found 90 matches

by Minilek
Mon Aug 30, 2004 2:03 pm
Forum: Volume 107 (10700-10799)
Topic: 10700 - Camel trading
Replies: 32
Views: 14354

EDIT:
Don't be dumb like me. In calculating how big your char array should be for holding the expression, remember that numbers can be 2 digits :-?

[c]
AC
[/c]
by Minilek
Mon Aug 30, 2004 12:35 pm
Forum: Volume 100 (10000-10099)
Topic: 10055 - Hashmat the Brave Warrior
Replies: 166
Views: 46693

unsigned long long for this problem was enough (conversion specifier %llu).

that might have been overkill, but i knew it would work for sure and just did the first thing that came to my head that i knew would fit. : )
by Minilek
Mon Aug 30, 2004 12:24 pm
Forum: Volume 107 (10700-10799)
Topic: 10700 - Camel trading
Replies: 32
Views: 14354

10700 WA

AC
by Minilek
Wed Aug 25, 2004 6:39 am
Forum: Volume 1 (100-199)
Topic: 101 - The Blocks Problem
Replies: 635
Views: 40439

i get a compiler error too (use -ansi so you can see them). usually to be safe i compile with -ansi -Wall -pedantic C:\acmuva>gpp -ansi test.cpp gpp -ansi test.cpp In file included from c:/djgpp/lang/cxx/3.34/bits/locale_facets.tcc:41, from c:/djgpp/lang/cxx/3.34/locale:47, from c:/djgpp/lang/cxx/3....
by Minilek
Tue Aug 24, 2004 2:31 am
Forum: Volume 105 (10500-10599)
Topic: 10534 - Wavio Sequence
Replies: 44
Views: 7830

i used to get compiler errors (would compile on my machine but not the judge's), but i started seeing the compile errors the judge sees after using the following command line:

gcc -pedantic -ansi -Wall <source code file name>

hope it helps you as much as it has helped me :D
by Minilek
Mon Aug 23, 2004 4:29 pm
Forum: Volume 100 (10000-10099)
Topic: 10080 - Gopher II
Replies: 31
Views: 15992

sorry about that, but thanks a lot for taking the time to look at my code. : ) the problem ended up being not in my algorithm but in telling whether gophers can make it to holes or not i had a sneaky typo. [c] /* find which gophers can make it to which holes */ for (i=0;i<n;i++) for (j=0;j<m;j++) { ...
by Minilek
Mon Aug 23, 2004 12:50 am
Forum: Volume 100 (10000-10099)
Topic: 10080 - Gopher II
Replies: 31
Views: 15992

[c]
AC
[/c]
by Minilek
Sun Aug 22, 2004 4:11 am
Forum: Algorithms
Topic: prime numbers
Replies: 10
Views: 3867

[c] gen_all_primes_up_to[sqrt(B)] (using normal sieve) isprime = new array of size B-A+1 initialize all elements of isprime to 1 for (i=0;i<primes_array_size;i++) { start = (A/primes ); if (start*primes < A) start++; if (start==1) start++; // don't mark prime as composite!!! for (j=start*primes -A;j...
by Minilek
Sat Aug 21, 2004 9:15 am
Forum: Volume 104 (10400-10499)
Topic: 10463 - Aztec Knights
Replies: 35
Views: 11199

hm, actually, if you can show that the *shortest path* from any square to any other square is < 9, i think my reasoning above works. the shortest path from 0,0 to any other square is 8, but i haven't checked from other spots. in case my reasoning wasn't clear.. if the shortest path is <9 the only od...
by Minilek
Sat Aug 21, 2004 6:46 am
Forum: Volume 1 (100-199)
Topic: 104 - Arbitrage
Replies: 223
Views: 14376

[cpp]
AC
[/cpp]
by Minilek
Fri Aug 20, 2004 6:37 am
Forum: Volume 104 (10400-10499)
Topic: 10463 - Aztec Knights
Replies: 35
Views: 11199

oh doh...i completely forgot that odd numbers can also be composite :oops: i think i am losing my mind :( Edit: I will make a claim that I think can be proven by case-by-case analysis, but I'll think about proving it later: if you can get from one square to another in 1 step, then you can either als...
by Minilek
Fri Aug 20, 2004 4:51 am
Forum: Volume 104 (10400-10499)
Topic: 10463 - Aztec Knights
Replies: 35
Views: 11199

aztec knight moves are (+/- 1, +/-3) or (+/- 3, +/- 1), so all moves are (+odd,+odd). A parity argument will convince you that if it's possible to get from one point to another in an even number of moves, it must be impossible in an odd number of moves - and vice versa.
by Minilek
Fri Aug 20, 2004 2:28 am
Forum: Volume 100 (10000-10099)
Topic: 10032 - Tug of War
Replies: 91
Views: 32599

consider a greedy approach that starts off with two teams of people and continuously modifies the teams until they can't be made better. i proved to myself this works and (falsely) proved to myself it was fast and got AC in 0.000. now that i see a flaw in my proof that this algorithm is fast, can an...
by Minilek
Thu Aug 19, 2004 10:54 am
Forum: Volume 100 (10000-10099)
Topic: 10020 - Minimal coverage
Replies: 57
Views: 20752

ah thanks - AC now. i only learned C from these online contests so i'm still newb at so many things :oops:
by Minilek
Thu Aug 19, 2004 5:03 am
Forum: Volume 100 (10000-10099)
Topic: 10020 - Minimal coverage
Replies: 57
Views: 20752

May someone please give me some i/o for this problem? I'm getting SIGSEV but am not quite sure why (I tried putting assert's all over the place but still no SIGABRT).

Also, if you're feeling giving and also wouldn't mind taking a look at my source code, here it is :)

[c]
AC
[/c]

Thanks.

Go to advanced search