Search found 36 matches

by saiqbal
Sat Mar 29, 2003 5:10 pm
Forum: Volume 101 (10100-10199)
Topic: 10126 - Zipf's Law
Replies: 36
Views: 12202

i actually didn't analize your code but when i tried with some input i found your code sometimes prints blank line before an output and sometimes after output and after all it gets messed up. try the following input: 2 abcd abcd EndOfText 2 abcd EndOfText 2 abcd abcd EndOfText 2 abcd EndOfText hope ...
by saiqbal
Sat Mar 29, 2003 3:54 pm
Forum: Volume 101 (10100-10199)
Topic: 10126 - Zipf's Law
Replies: 36
Views: 12202

you are not printing blank line correctly.
by saiqbal
Fri Mar 28, 2003 7:44 pm
Forum: Volume 103 (10300-10399)
Topic: 10324 - Zeros and Ones
Replies: 179
Views: 63062

your problem seems so simple!! :)
declare a character array of size 1000001 and just read an string. following code wud work:
[cpp]char str[1000001];
int main()
{
cin>>str;
return 0;
}
[/cpp]

good luck
-sohel

ps- always declare such large arrays global.
by saiqbal
Wed Mar 26, 2003 6:32 pm
Forum: Volume 103 (10300-10399)
Topic: 10375 - Choose and divide
Replies: 23
Views: 15207

consider the following input:
9999 5000 9999 5256
my program's output is:
521350.34067
your program doesn't seems like giving the same result!!:wink:

good luck
-sohel
by saiqbal
Wed Mar 26, 2003 2:39 pm
Forum: Volume 103 (10300-10399)
Topic: 10375 - Choose and divide
Replies: 23
Views: 15207

using log doesn't work for this problem. i tried to use log too but faild. it seems that the judge solution was not written using log so there exists some precision error. i solved this using brutforce :wink:

i wish this problem cud have been an special judge problem.

thanx
-sohel
by saiqbal
Mon Mar 24, 2003 2:33 pm
Forum: Volume 103 (10300-10399)
Topic: 10394 - Twin Primes
Replies: 101
Views: 44509

you'd better use VC.
TC wud never support such large array required for this problem. :wink:

thanx
-sohel
by saiqbal
Sat Mar 22, 2003 5:15 pm
Forum: Volume 100 (10000-10099)
Topic: 10099 - The Tourist Guide
Replies: 91
Views: 40327

u need to modify your code a little to get AC.

code to change:

Code: Select all

d[i][j] = max(d[i][j], min(d[i][k], d[k][j]));
code to replace with:

Code: Select all

d[i][j] = d[j][i] = max(d[i][j], min(d[i][k], d[k][j]));
hope u can understand why the change was needed. :)

good luck
-sohel
by saiqbal
Sat Mar 22, 2003 11:30 am
Forum: Volume 6 (600-699)
Topic: 677 - All Walks of length "n" from the first node
Replies: 17
Views: 9864

i think your terminating condition is not right.
i can remember that i terminated when i expected -9999 but got something else.

it might help.

thanx
-sohel
by saiqbal
Sat Mar 22, 2003 10:51 am
Forum: Volume 100 (10000-10099)
Topic: 10099 - The Tourist Guide
Replies: 91
Views: 40327

silly mistake!!!
what does this following line mean? :wink:

Code: Select all

printf("Scenario #1\n",cases++);
good luck
-sohel
by saiqbal
Fri Mar 21, 2003 4:51 pm
Forum: Volume 104 (10400-10499)
Topic: 10422 - Knights in FEN
Replies: 49
Views: 23242

i used backtracking a with a little bound. i just checked the last move
not to be repeated.my soln. is not fast enough though! :wink:
but i think the best approach is to use BFS. some ppl used IDS also.

thanx
-sohel
by saiqbal
Wed Mar 19, 2003 5:30 pm
Forum: Volume 7 (700-799)
Topic: 782 - Contour Painting
Replies: 53
Views: 28518

your output seems a bit weird to me, coz u've printed some
spaces after the end of second line. r u sure there will be
spaces? :-?

Code: Select all

XXXXXXXXXXXXX#
X       X######@@@
XXXXXXXXXXXXXXX#
____
you've printed 3 extra spaces at the place where i put '@'.

im actually screwed. getting WA :(

thanx
-sohel
by saiqbal
Mon Mar 17, 2003 9:19 pm
Forum: Volume 4 (400-499)
Topic: 482 - Permutation Arrays
Replies: 159
Views: 48663

u'd better try to use struct and store every number as string (important! bcoz u need to print exactly the same as input) and corresponding indices and sort the array according to the indices. u can use qsort for sorting. following code might help: [c] typedef struct { int index; char num[20]; } arr...
by saiqbal
Mon Mar 17, 2003 8:56 pm
Forum: Volume 1 (100-199)
Topic: 130 - Roman Roulette
Replies: 25
Views: 4630

try the following i/o

Code: Select all

input:

1 1
1 5
5 2
100 53
100 2
5 4
11 93

output:
1
1
3
13
83
5
2
hope this helps :)

-sohel
by saiqbal
Sun Mar 16, 2003 6:27 pm
Forum: Volume 1 (100-199)
Topic: 116 - Unidirectional TSP
Replies: 226
Views: 60354

u can try the following 2 inputs and outputs: input: 5 6 -3 -4 -1 -2 -8 -6 -6 -1 -8 -2 -7 -4 -5 -9 -3 -9 -9 -5 -8 -4 -1 -3 -2 -6 -3 -7 -2 -8 -6 -4 10 100 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 ...
by saiqbal
Mon Mar 10, 2003 9:44 pm
Forum: Volume 103 (10300-10399)
Topic: 10320 - Cow Trouble! Help Please!!
Replies: 27
Views: 12636

its possible bcoz its an special judge problem.
an special corrector program is written for this problem to ignore small precision error. :)

Go to advanced search