Search found 149 matches

by nymo
Tue May 08, 2007 3:59 pm
Forum: Volume 106 (10600-10699)
Topic: 10653 - Bombs! NO they are Mines!!
Replies: 36
Views: 17586

Isn't this a plain BFS? I am getting WAs. Can someone provide some cases? and I guess there is always a path to the destination...
by nymo
Sat May 05, 2007 10:16 pm
Forum: Volume 104 (10400-10499)
Topic: 10462 - Is There A Second Way Left?
Replies: 29
Views: 14268

Test Cases please...

I get correct answers for the inputs I 've found... Some more test cases needed. What is the catch? I am getting WAs :(
I 've entirely used 32-bit ints. Is it okay? No range for cost value is specified ...
by nymo
Fri May 04, 2007 2:40 pm
Forum: Volume 5 (500-599)
Topic: 580 - Critical Mass
Replies: 4
Views: 3198

How to solve this?

Can anyone give some idea how to solve this? Thanks.
by nymo
Mon Apr 30, 2007 12:09 pm
Forum: Volume 6 (600-699)
Topic: 622 - Grammar Evaluation
Replies: 13
Views: 6739

Need some more IO, please.

Please, can someone provide some more IO? please... I need help.
and can any line starts with spaces like

Code: Select all

1
                (5)
Thanks.

EDIT: I 'VE GOT ACC... I 've truncated all the spaces now...
by nymo
Sat Apr 28, 2007 8:16 pm
Forum: Volume 1 (100-199)
Topic: 112 - Tree Summing
Replies: 137
Views: 12664

Thanks to both of you... this IO set really helps me out...
by nymo
Fri Apr 27, 2007 8:07 am
Forum: Off topic (General chit-chat)
Topic: I win !!
Replies: 361
Views: 121024

No one want to deal with me
:D you are right :wink:
by nymo
Fri Apr 06, 2007 4:03 pm
Forum: Volume 109 (10900-10999)
Topic: 10944 - Nuts for nuts..
Replies: 35
Views: 14823

Thanks

I 've got ACC with topdown approach (recursion with memoization) ... at last.
Thanks everyone. I 've done pretty much what ayon said.
by nymo
Sat Mar 31, 2007 5:14 pm
Forum: Volume 105 (10500-10599)
Topic: 10533 - Digit Primes
Replies: 108
Views: 30617

TO NEWTON...

to Newton, your algo is slow... even if you don't get CE, it will probably be a TLE... in your code, you use long prime[10000001]; just for marking whether i is prime or not; 1 and 0 respectively. you can obviously use #define SIZE THE_SIZE_YOU_WANT char prime[SIZE]; it will reduce the size to 1/4 :...
by nymo
Sat Mar 31, 2007 4:51 pm
Forum: Volume 5 (500-599)
Topic: 583 - Prime Factors
Replies: 171
Views: 35272

to Newton, for(i=0;num!=1;i++) { if(num%array[i]==0 && num!=1) { while(num%array[i]==0 && num!=1) { num /= array[i]; if(num == 1) printf(" %d",array[i]); else printf(" %d x",array[i]); } } In this portion index i can overflow to access outside the array. void set_prime() { int i,j; memset(prime,0,si...
by nymo
Fri Mar 30, 2007 2:04 pm
Forum: Volume 100 (10000-10099)
Topic: 10019 - Funny Encryption Method
Replies: 45
Views: 5256

conio.h is a non standard header. NEVER include this header in files to be submitted in UVa.
If you are uncertain about other functions or headers, try checking their portability first.

NEVER open a new thread when there are already many...
by nymo
Wed Mar 28, 2007 4:47 pm
Forum: Volume 108 (10800-10899)
Topic: 10803 - Thunder Mountain
Replies: 47
Views: 23275

mohsincsedu, I 've just an overview of your code... Min() should be changed... may be some other flaws... I don't know... your FW() implementation is not okay ....

/* EDIT: I missed the part that you were not finding the actual distance */
by nymo
Wed Mar 28, 2007 4:39 pm
Forum: Volume 108 (10800-10899)
Topic: 10803 - Thunder Mountain
Replies: 47
Views: 23275

To mohsincsedu...

Correct way to FW():

Code: Select all

for (k=0; k<n; k++)     // According to your code, k should be the outermost
     for (i=0; i<n; i++)  // index ... 
        for (j=0; j<n; j++)
            {
               Process...
            }
by nymo
Wed Mar 28, 2007 4:33 pm
Forum: Volume 5 (500-599)
Topic: 583 - Prime Factors
Replies: 171
Views: 35272

to Newton, I 've just skim through your code... From your code, I suppose you are trying to find out the primes upto 10000; but why 10000? input range is -2^31 to 2^31 (not inclusive); you should have gone upto at least the squre root of 2^31. for(i=2;i<=10000;i++) { for(j=2;i*j<=10000;j++) prime[i*...
by nymo
Wed Mar 28, 2007 4:16 pm
Forum: Volume 108 (10800-10899)
Topic: 10803 - Thunder Mountain
Replies: 47
Views: 23275

To mohsincsedu,

Code: Select all

      for(i = 0;i<n;i++)
         for(j = 0;j<n;j++)
            for(k = 0;k<n;k++)
            {
               T[i][j] = Min(T[i][j],T[i][k],T[k][j]);
            } 
is this the way to do FW() ?
by nymo
Mon Mar 19, 2007 7:18 pm
Forum: Volume 6 (600-699)
Topic: 673 - Parentheses Balance
Replies: 243
Views: 43937

To jainal cse du ...

To jainal cse du,
I just skim through your code, not going thorougly ...
however, your code breaks when a mismatching end bracket occurs... think about a test case when upto the mismatching end bracket (left == right) ;) ; your code will output Yes though it shouldn't.

Go to advanced search