Search found 106 matches

by sapnil
Sat May 30, 2009 6:05 am
Forum: Volume 9 (900-999)
Topic: 929 - Number Maze
Replies: 92
Views: 40220

Re: 929 - Number Maze

WR Help.....
i use simple bfs with 10 queue, bur getting WR....pl help me.

Code: Select all

// find bugs,code remove
by sapnil
Wed Feb 25, 2009 5:00 am
Forum: Volume 115 (11500-11599)
Topic: 11572 - Unique Snowflakes
Replies: 36
Views: 12447

Re: 11572 - Unique Snowflakes

Code: Select all

map<int,int> mp;

mp[1]=1;
mp[2]=2;
mp[3]=3;
mp[2]=4;<
mp[4]=5;
mp[5]=6;
Now when u going for 4'th number(2),you find 2 occured before and location is 2(current location is 4) .
Thats all.

Thanks
by sapnil
Tue Feb 24, 2009 6:28 pm
Forum: Volume 115 (11500-11599)
Topic: 11572 - Unique Snowflakes
Replies: 36
Views: 12447

Re: 11572 - Unique Snowflakes

>> If in input every number is equal, you initilize map n times(It is not needed), it is not enough for pass time limit.
>>try map initilize for each test case,not for each repeated data.

>> hope it helps.

Thanks
by sapnil
Tue Feb 24, 2009 5:42 pm
Forum: Volume 115 (11500-11599)
Topic: 11572 - Unique Snowflakes
Replies: 36
Views: 12447

Re: 11572 - Unique Snowflakes

Code: Select all

1
6
1 2 3 2 4 5
Output is:4
by sapnil
Tue Feb 24, 2009 5:49 am
Forum: Volume 115 (11500-11599)
Topic: 11584 - Partitioning by Palindromes
Replies: 14
Views: 3773

Re: 11584 - Partitioning by Palindromes

I use Dijkstra & get lot of WR, please help me:

Code: Select all

Code remove.....
by sapnil
Mon Feb 23, 2009 3:40 pm
Forum: Volume 115 (11500-11599)
Topic: 11572 - Unique Snowflakes
Replies: 36
Views: 12447

Re: 11572 - Unique Snowflakes

your code do not pass the sample input.
by sapnil
Tue Jan 20, 2009 7:24 pm
Forum: Volume 114 (11400-11499)
Topic: 11466 - Largest Prime Divisor
Replies: 29
Views: 15628

Re: 11466 - Largest Prime Divisor

You use prime factorization here.
For factoring n, you need all primes <= sqrt(n).
sqrt( 14digit ) = 1e7.
But your code only generate primes with in 1e6.
Edit here....

Thanks.
Jony
by sapnil
Tue Jan 20, 2009 6:40 pm
Forum: Volume 9 (900-999)
Topic: 974 - Kaprekar Numbers
Replies: 32
Views: 11840

Re: 974 - Kaprekar Numbers

Trying with initilize.you calculate Kaprekar numbers for each input. its kill your time.
>> there are only maximum <20 Kaprekar numbers in 40000.
Thanks
by sapnil
Mon Jul 28, 2008 6:02 pm
Forum: Volume 111 (11100-11199)
Topic: 11113 - Continuous Fractions
Replies: 16
Views: 11859

Re: 11113 - Continuous Fractions

I'm getting too many WR again. Plz help me Code: #include<stdlib.h> #include<string.h> #include<stdio.h> #include<ctype.h> #include<math.h> #include<algorithm> using namespace std; #define CSE 20009 long long a[CSE],top; long long Digit_cnt(long long num) { long long c; c=0; while(num>0) { num=num/...
by sapnil
Thu Jul 24, 2008 6:30 am
Forum: Volume 114 (11400-11499)
Topic: 11464 - Even Parity
Replies: 6
Views: 5787

Re: 11464 WR

sapnil wrote:I'm getting WR.plz help me

Code: Select all

Code remove
Thanks monish bhi

Thanks
Sapnil
by sapnil
Tue Jul 22, 2008 8:51 pm
Forum: Volume 114 (11400-11499)
Topic: 11464 - Even Parity
Replies: 6
Views: 5787

11464 - Even Parity

I'm getting WR.plz help me

Code: Select all

..........remove
Thanks
Sapnil
by sapnil
Thu Jul 17, 2008 6:25 pm
Forum: Volume 8 (800-899)
Topic: 855 - Lunch in Grid City
Replies: 41
Views: 19271

Re: 855 - Lunch in Grid City

>> Sorry i think the input be negetive number.

>> change here:

Code: Select all

if(f%2==0) printf("(Street: %ld, Avenue: %ld)\n", str[f/2-1], ave[f/2-1]);
else printf("(Street: %ld, Avenue: %ld)\n", str[f/2+1], ave[f/2+1]);
thanks
sapnil
by sapnil
Thu Jul 17, 2008 12:47 am
Forum: Volume 8 (800-899)
Topic: 855 - Lunch in Grid City
Replies: 41
Views: 19271

Re: 855 - Lunch in Grid City

Code: Select all

int cmp(const void *a, const void *b){
return *(int *)a - *(int *)b;
}
>>>> I thing the problem on ur cmp function. sometimes it cross the range of intiger.

Thanks
Sapnil
by sapnil
Thu Jul 17, 2008 12:28 am
Forum: Volume 4 (400-499)
Topic: 495 - Fibonacci Freeze
Replies: 222
Views: 30705

Re: 495 need input

There is no special input.
>> use simple string addition.
plz post in right place
Thanks
Sapnil
by sapnil
Sun Jul 13, 2008 10:09 pm
Forum: Volume 114 (11400-11499)
Topic: 11408 - Count DePrimes
Replies: 12
Views: 5708

Re: 11408 - Count DePrimes

Take input like this:

Code: Select all

while(scanf("%ld",&a)==1)
{
     if(a==0)
    {
         break;
    }
    scanf("%ld",&b);
}
Thanks

Go to advanced search