Search found 67 matches

by dumb dan
Sat May 14, 2005 10:08 am
Forum: Volume 103 (10300-10399)
Topic: 10377 - Maze Traversal
Replies: 26
Views: 9725

I haven't tested your code, but you should be aware that (-1)%4=(-1) and not 3 as you would want to in this case.
by dumb dan
Sat May 14, 2005 9:57 am
Forum: Volume 101 (10100-10199)
Topic: 10183 - How Many Fibs?
Replies: 66
Views: 23644

85: implicit declaration of function `int itoa(...)'

The function itoa is (perhaps surprisingly) not a standard C++ function.
by dumb dan
Thu May 12, 2005 4:53 pm
Forum: Volume 108 (10800-10899)
Topic: 10848 - Make Palindrome Checker
Replies: 26
Views: 14842

> if the 2
by dumb dan
Wed May 11, 2005 3:50 am
Forum: Volume 108 (10800-10899)
Topic: 10844 - Bloques
Replies: 15
Views: 10935

Ah, yes... using Bell's triangle you only need addition. Thanks!
by dumb dan
Tue May 10, 2005 4:43 pm
Forum: Volume 108 (10800-10899)
Topic: 10844 - Bloques
Replies: 15
Views: 10935

Yes, it's the Bell number. As far as I can tell this is all about optimizing your bigint class (unless I'm missing something). I still have TLE myself (get to about n=620 before I TLE). Currently my bigint class is using 10000 as word-size (base), but if I used a word-size that was a power of 2 I co...
by dumb dan
Tue May 10, 2005 12:23 pm
Forum: Volume 7 (700-799)
Topic: 727 - Equation
Replies: 156
Views: 34794

Yes, 727 is a multiple input problem. And no, there could be (and probably is) more than one expression. Multiple input problems have a special form of input. The fact that it is a multiple input problem is not specified in the problem specification, but rather in the problem list: http://acm.uva.es...
by dumb dan
Tue May 10, 2005 10:01 am
Forum: Volume 108 (10800-10899)
Topic: 10848 - Make Palindrome Checker
Replies: 26
Views: 14842

> Also, it is not clear what we should do if the length of string is zero.(In my AC program, I give T for P1)

Giving T for P1 seems like the right thing to do, but I can also note that my AC program gives F for P1 when the second string is of zero length. So there cannot be any such inputs.
by dumb dan
Tue May 10, 2005 9:26 am
Forum: Volume 103 (10300-10399)
Topic: 10324 - Zeros and Ones
Replies: 179
Views: 43583

1. Input may be terminated by either EOF or a blank line. So you need to use something like while(cin>>str&&str!=""){/*...*/}; rather than just while(str!=""){/*...*/}; 2. Basically the same thing as gets(str);gets(str); , meaning you do two gets-calls where the second overwrites the first. This is ...
by dumb dan
Tue May 10, 2005 8:50 am
Forum: Volume 100 (10000-10099)
Topic: 10055 - Hashmat the Brave Warrior
Replies: 166
Views: 46207

Your current method for reading input should works perfectly ok. When your program is tested by the judge, your program recieves a file from standard input. This is perfectly normal and you don't need to think about that. Basically what they mean is that you should read input as long as there is mor...
by dumb dan
Mon May 09, 2005 3:17 pm
Forum: Volume 103 (10300-10399)
Topic: 10327 - Flip Sort
Replies: 81
Views: 22710

I'm guessing you're getting the following compile error:

conio.h: No such file or directory

conio.h is not part of the C standard. It is a Borland extension, and works only with Borland compilers (and perhaps some other commercial compilers)
by dumb dan
Mon May 09, 2005 2:07 pm
Forum: Volume 104 (10400-10499)
Topic: 10415 - Eb Alto Saxophone Player
Replies: 21
Views: 6495

There are at most 200 notes in a song, and the song may be empty.

input:

Code: Select all

2

CbCbCb
output:

Code: Select all

0 0 0 0 0 0 0 0 0 0
0 3 3 0 0 0 0 0 0 0
by dumb dan
Mon May 09, 2005 1:05 am
Forum: Volume 103 (10300-10399)
Topic: 10363 - Tic Tac Toe
Replies: 54
Views: 24376

Did you consider that only the player that moved last can be in a winning position?

Ex:

Code: Select all

2
OO.
O..
XXX

XX.
XX.
OOO

no
no
by dumb dan
Sat May 07, 2005 2:27 pm
Forum: Volume 107 (10700-10799)
Topic: 10763 - Foreign Exchange
Replies: 45
Views: 17749

You misunderstood the problem.

if a student wants to go from A to B, there must be another student who wants to go from B to A

So no single exchange is allowed to include more than 2 students.
That means it should be:

3
1 2
2 3
3 1
NO
by dumb dan
Fri May 06, 2005 4:50 pm
Forum: Volume 102 (10200-10299)
Topic: 10200 - Prime Time
Replies: 202
Views: 61402

The first thing you should do is remove this line: if(k%3==0 || k%5==0 || k%7==0 || k%11==0 && k>3) continue; I assume you were trying to save time, but all that line accomplishes is making sure you do between 1 and 5 modulos each step in the loop instead of just 1 modulo. Removing that line alone w...
by dumb dan
Thu May 05, 2005 4:29 pm
Forum: Volume 3 (300-399)
Topic: 375 - Inscribed Circles and Isosceles Triangles
Replies: 19
Views: 2698

Actually it isn't wrong, it clearly states: you may limit the radius of the smallest inscribed circle in the stack to a single precision floating point value of 0.000001 That is, they aren't looking for the total sum, but rather the total sum not counting any circles with radius smaller than 0.00000...

Go to advanced search