Search found 94 matches

by the LA-Z-BOy
Tue Jun 13, 2006 8:02 am
Forum: Volume 103 (10300-10399)
Topic: 10343 - Base64 Decoding
Replies: 20
Views: 7938

To pipo

1. You print the output using printf("%s")... which is not good here because you might have to print ASCII value 0's.
2. Your program does not differentiate the following cases ... (It treats the same...)

Code: Select all

AA==#
`or'
AAA=#
`or'
AAAA#
You have to check for '='.... more carefully.
by the LA-Z-BOy
Tue Jun 13, 2006 7:56 am
Forum: Volume 103 (10300-10399)
Topic: 10343 - Base64 Decoding
Replies: 20
Views: 7938

#include <stdio.h> int getindex( char ch ) { if( ch >= 'A' && ch <= 'Z' ) return ( ch - 'A' ); else if ( ch >= 'A' && ch <= 'z' ) return ( ch - 'a' ) + 26; ..... ;) as you might have seen it already ... else if (ch >='A' && ch <='z') ... shouldn't it be 'a' instead of 'A' :D? [ and there are charac...
by the LA-Z-BOy
Tue Jun 13, 2006 6:42 am
Forum: Volume 1 (100-199)
Topic: 135 - No Rectangles
Replies: 24
Views: 4811

By the way, the problem number is 136, not 135.
by the LA-Z-BOy
Tue Jun 13, 2006 6:40 am
Forum: Volume 1 (100-199)
Topic: 135 - No Rectangles
Replies: 24
Views: 4811

Yes, the first 100s are okay.
Check for overflows in your code. Or may be any other error, depends on which method you use.
by the LA-Z-BOy
Tue Jun 13, 2006 6:24 am
Forum: Volume 1 (100-199)
Topic: 146 - ID Codes
Replies: 35
Views: 6002

for(i=n-1;i>=0;i--){ if(cod[i]>cod[i-1]) ehalfabetico=1; ... } Carefully check this.... I think you should figure out what happens when i = 0.... if (cod[0]>cod[-1]) ... :O This is not what you intended i suppos, so change the loops to for ( i = n-1; i > 0; --i) then it's fine. PS. 1. Please when p...
by the LA-Z-BOy
Tue Jun 13, 2006 6:04 am
Forum: Volume 1 (100-199)
Topic: 108 - Maximum Sum
Replies: 233
Views: 24159

Yes, mine was (as many others) O(N ^ 3).

BTW, what is your complexity of solving maximum sum of One Dimensional array ?
by the LA-Z-BOy
Thu Feb 10, 2005 12:44 am
Forum: Volume 6 (600-699)
Topic: 612 - DNA Sorting
Replies: 122
Views: 16953

as n<=50 && m<=100 you have to take char dna[100][51] not char dna[100][50] , that will make your prog `Output Limit Exceed' free, but it seems you still have error in your algorithm. If two or more strings are equally sorted, list them in the same order they are in the input file. your sort here is...
by the LA-Z-BOy
Wed Feb 02, 2005 7:18 pm
Forum: Other words
Topic: HELP WITH NCPC
Replies: 54
Views: 14092

dear shamim , Some of my favorites of this site [ Shahriar Manzoor, Kamruzzaman ] were involved in this topic, thats why I did take it too seriously as I should have. Now that I know that it was just a misunderstanding, It's okay to me now. It shouldn't have happened though, if you were a bit more c...
by the LA-Z-BOy
Mon Jan 24, 2005 8:02 am
Forum: Other words
Topic: HELP WITH NCPC
Replies: 54
Views: 14092

what the heck!!!

- - - CUT CUT CUT - - -
by the LA-Z-BOy
Sat Oct 23, 2004 9:24 pm
Forum: Volume 103 (10300-10399)
Topic: 10338 - Mischievous Children
Replies: 56
Views: 20607

hi, Each word will have at most 20 letters. then char in[20]; should be char in[21]; ( one extra for 0 termination, blah blah) printf("Data set %d: %ld\n", i+1, r); well, unsigned long's should be printed using %lu , isn't it? 294967296 / r Now, 294967296 = 2^32, which does not fit in even unsigned ...
by the LA-Z-BOy
Thu Oct 14, 2004 11:16 pm
Forum: Volume 104 (10400-10499)
Topic: 10407 - Simple division
Replies: 34
Views: 11943

Code: Select all

cout<<a;
should be

Code: Select all

cout<<a<<endl;
by the LA-Z-BOy
Wed Aug 25, 2004 10:57 am
Forum: Volume 1 (100-199)
Topic: 196 - Spreadsheet
Replies: 42
Views: 10336

But still could be tests where columns = 18278 or rows = 999, so maximum values for this two variables are necessary i never said that these two variables are unnecessary. :wink: In problem like this you cannot deal with static tables of maximal size (it's stupid at all for such big tables) but you...
by the LA-Z-BOy
Mon Aug 23, 2004 12:48 pm
Forum: Volume 1 (100-199)
Topic: 196 - Spreadsheet
Replies: 42
Views: 10336

This problem is almost impossible ( well, for me at least! ) to solve it within the memory limits ( 32meg) if there were inputs of 999 x 18278 spreadsheet. But the stupid thing is that ROW*COLUMN is lot smaller than 999*18278.. yeah it seemed stupid to me because there was no indication about it in ...
by the LA-Z-BOy
Mon Aug 23, 2004 9:56 am
Forum: Volume 8 (800-899)
Topic: 833 - Water Falls
Replies: 5
Views: 3580

?, the problem statement clearly says Also no coincidences exist in the vertical projection of all points (the x coordinates of the end points and of the source points are all different). so the input suggested by jagadish won't be valid i think. a test case to try 1 8 10 12 1 3 4 8 6 10 2 5 7 10 12...
by the LA-Z-BOy
Mon Aug 02, 2004 1:51 pm
Forum: Volume 105 (10500-10599)
Topic: 10568 - n Group k
Replies: 9
Views: 2753

:)

i just got it AC :). the problem was in sorting the output in lexic order...
thanks.

Go to advanced search