Search found 29 matches

Sat Oct 01, 2011 5:46 pm
Forum: Volume 122 (12200-12299)
Topic: 12299 - RMQ with Shifts
Replies: 0
Views: 1423

12299 - RMQ with Shifts

What is wrong with my code for 12299 - RMQ with Shifts? #include<cstdio> #include<cstring> #include<cmath> #include<iostream> #include<vector> #include<set> #include<map> #include<algorithm> #include<string> using namespace std; typedef vector<int> VI; #define REP(i,N) for(int i=0; i<(N); ++i) #defi...
Sun Sep 12, 2010 8:52 am
Forum: Volume 114 (11400-11499)
Topic: 11466 - Largest Prime Divisor
Replies: 29
Views: 15347

Re: 11466 - Largest Prime Divisor

Can anyone please guide me as to what is wrong in my code. It seems to give correct solution for all cases that i tried.

Code: Select all

``````Got AC.
my bad. i thought we had to display -1 only for prime numbers.``````
Fri Dec 12, 2008 12:16 pm
Forum: Volume 100 (10000-10099)
Topic: 10090 - Marbles
Replies: 43
Views: 22076

Re: 10090 - Marbles

Thanks mf
Got AC finally.
But some clarification :
First of all the range is
not ceil(x0*d/b) <= t <= floor(y0*d/a)
it is ceil(-x0*d/b) <= t <= floor(y0*d/a)
Fri Dec 12, 2008 9:14 am
Forum: Volume 100 (10000-10099)
Topic: 10090 - Marbles
Replies: 43
Views: 22076

Re: 10090 - Marbles

My program gives correct output for all test cases here still WA.

Code: Select all

``````Got AC
``````
anyone please point out my mistake.
Wed Dec 10, 2008 5:04 pm
Forum: Volume 100 (10000-10099)
Topic: 10090 - Marbles
Replies: 43
Views: 22076

Re: 10090 - Marbles

thanks mf and i will make sure to write in proper english.
can u explain with an example.
Wed Dec 10, 2008 3:46 pm
Forum: Volume 4 (400-499)
Topic: 490 - Rotating Sentences
Replies: 212
Views: 19266

Re: 490 : why WA with this simple looking problem?

Please tell me why m i getting PE? Got AC sorry to say but there are more confusing posts on this than clarifying. we simply have to print the matrix as such. If there is nuthing to print print a space. For example if input is aaa aaa aaa aaa aaa a aaaaaaaaaaaaaaaaaaaaaaa Output is : where * denotes...
Wed Dec 10, 2008 12:35 pm
Forum: Volume 3 (300-399)
Topic: 332 - Rational Numbers from Repeating Fractions
Replies: 83
Views: 19416

My AC Code different output from the one above for input 2 0.318 1 0.3 2 0.09 6 0.714285 6 0.714285000 1 0.9999 9 0.123456789 8 0.987654321 9 0.574454131 5 0.83777471 1 0.22222222 9 0.111111111 9 0.222222222 9 0.333333333 9 0.444444444 9 0.555555555 9 0.666666666 9 0.777777777 9 0.888888888 9 0.9999...
Tue Dec 09, 2008 11:14 pm
Forum: Volume 100 (10000-10099)
Topic: 10090 - Marbles
Replies: 43
Views: 22076

Re: 10090 - Marbles

can sumbdy plz elaborate on how to minimise after getting x nd y for ax + by = GCD?
Sun Sep 21, 2008 12:56 pm
Forum: Volume 1 (100-199)
Topic: 151 - Power Crisis
Replies: 56
Views: 4676

Re: 151 WA

My program seems to work for all cases but donno why it gives wrong answer.Someone Plz Help.

Code: Select all

``````I was doing the same mistake as above.
The answer for N=13 is 1``````
Thu Aug 07, 2008 4:46 pm
Forum: Volume 107 (10700-10799)
Topic: 10789 - Prime Frequency
Replies: 38
Views: 21126

Re: 10789 - Prime Frequency

Plz help me.First time i m trying to submit a code in Java and it gives RTE.I have done all my previous submissions in C++.

Code: Select all

``GOT AC``
I submitted the same code using C++ and i got accepted.I just changed only the usual input/output and string functions.
Mon Jul 28, 2008 2:11 pm
Forum: Volume 101 (10100-10199)
Topic: 10161 - Ant on a Chessboard
Replies: 10
Views: 5206

Re: 10161 - Ant on a Chessboard

I am getting wrong answer while my code gives expected output for all test cases put here.Plz help.

Code: Select all

``````Got AC
Silly Mistake
``````
Sat May 31, 2008 9:08 pm
Forum: Volume 102 (10200-10299)
Topic: 10229 - Modular Fibonacci
Replies: 53
Views: 16768

Re: 10229 - Modular Fibonacci

so how can i avoid that???
Sat May 31, 2008 9:03 pm
Forum: Volume 4 (400-499)
Topic: 446 - Kibbles "n" Bits "n" Bits "n" Bits
Replies: 50
Views: 4394

can u pls point wats wrong with my program??? it gives run time error. #include<iostream> using namespace std; #include<math.h> int main() { char h1[4],h2[4],t[1]; char con[16][5]={"0000","0001","0010","0011","0100","0101","0110","0111","1000","1001","1010","1011","1100","1101","1110","1111"}; int v...
Sat May 31, 2008 4:09 pm
Forum: Volume 102 (10200-10299)
Topic: 10229 - Modular Fibonacci
Replies: 53
Views: 16768

Re: 10229 - Modular Fibonacci

can somebody please point out why am i getting WA? #include<iostream> using namespace std; long long p; long long pow(int i,int j) { long long val=1; int k; for (k=1;k<=j;k++) val=val*i; return val; } long long conquer_fibonacci(long long n) { long long i,h,j,k,t; i=h=1; j=k=0; while(n>0) { if(n%2==...
Sat May 31, 2008 2:56 pm
Forum: Volume 3 (300-399)
Topic: 343 - What Base Is This?
Replies: 72
Views: 21138

Re: 343(What Base is This?)

plz help donno why my code gives WA.Checked all the posts nd got expected answers. #include<iostream> using namespace std; long long pow(int i,int j) { long long val=1; int k; for (k=1;k<=j;k++) val=val*i; return val; } int main() { char X[1000],Y[1000]; int l1,l2,maxx,maxy,i,j,k,FLAG; long long N1,...