Search found 78 matches

by Articuno
Fri Dec 12, 2008 2:21 pm
Forum: Volume 4 (400-499)
Topic: 401 - Palindromes
Replies: 196
Views: 31093

Re: 401- Palindromes WA. I'm going crazy

Your output is not correct for this test case:

Code: Select all

AAAAAGAAAAA
it is a regular palindrome, not a mirrored one.
by Articuno
Mon Dec 08, 2008 6:36 pm
Forum: Volume 113 (11300-11399)
Topic: 11388 - GCD LCM
Replies: 18
Views: 10148

Re: 11388 - GCD LCM

Well, your approach is not correct i think. Its a very simple but interesting problem.Just try some test cases in a paper by hand. You should read the previous posts and you will figure out the trick to solve this problem.
Hope it will help.
Good luck :D
by Articuno
Mon Dec 08, 2008 4:52 pm
Forum: Volume 2 (200-299)
Topic: 275 - Expanding Fractions
Replies: 47
Views: 21698

Re: 275

Well i have edited your code. It should be OK now:

Code: Select all

Removed
Hope it will help.
:)
by Articuno
Sun Dec 07, 2008 7:05 pm
Forum: Volume 2 (200-299)
Topic: 275 - Expanding Fractions
Replies: 47
Views: 21698

Re: 275

Yes, your this output is correct. What about this case: 2 2 it should be: .0 This expansion terminates. The rule about the newline is also applicable for the cases where the expansion terminates but there are more than 50 characters in a single line. Did you chechk this? I have changed a little in y...
by Articuno
Sun Dec 07, 2008 8:51 am
Forum: Volume 2 (200-299)
Topic: 275 - Expanding Fractions
Replies: 47
Views: 21698

Re: 275

Your program is not getting correct answer for all test cases. Try this case: 1 2 And there is another thing: multiple line expansions should each contain exactly 50 characters on each line(except the last line, which, of course, may be shorter) - that includes the beginning decimal point. You forgo...
by Articuno
Fri Dec 05, 2008 8:17 pm
Forum: Volume 101 (10100-10199)
Topic: 10107 - What is the Median?
Replies: 74
Views: 18618

Re: 10107 - What is the Median?

I submiited your code and it was 2.430s not TLE. Your problem is in data type. Pls recheck and declare all variables as long long. Check carefully. You shouldn't get TLE with this code though it will take more than 2 seconds. And also replace this part of your code: sort(input,input+c); with this: s...
by Articuno
Fri Dec 05, 2008 12:19 pm
Forum: Volume 101 (10100-10199)
Topic: 10107 - What is the Median?
Replies: 74
Views: 18618

Re: 10107 - What is the Median?

You are using wrong format specifier. Change the data type to long long. That will do. Good luck
by Articuno
Thu Dec 04, 2008 6:18 pm
Forum: Volume 114 (11400-11499)
Topic: 11487 - Gathering Food
Replies: 11
Views: 3833

Re: 11487 - Gathering food

Thanks a lot Sohel vai. Thanks a lot for your suggestion. Got AC
by Articuno
Wed Dec 03, 2008 6:59 pm
Forum: Volume 114 (11400-11499)
Topic: 11487 - Gathering Food
Replies: 11
Views: 3833

Re: 11487 - Gathering food

Thanks Sohel vai for your help. I think i have found my error. I can not figure out the way how to find the total number of distinct paths. Can you help me a little more. Please give me some hints about how to count the number of distinct paths. My program can count the shortest distance correctly b...
by Articuno
Wed Dec 03, 2008 12:14 pm
Forum: Volume 114 (11400-11499)
Topic: 11487 - Gathering Food
Replies: 11
Views: 3833

Re: 11487 - Gathering food

I have changed that part of my code into this: else { ans1=0; for(i=0;i<tp;i++) { ans1=ans1+totaldist[i]; } ans2=1; for(i=0;i<tp;i++) { ans2=(((ans2)%20437)*(totalpath[i]%20437))%20437; } ans2=ans2%20437; printf("Case %lld: %lld %lld\n",cas,ans1,ans2); } :cry: But still it is WA. I had also changed ...
by Articuno
Tue Dec 02, 2008 11:31 am
Forum: Volume 100 (10000-10099)
Topic: 10018 - Reverse and Add
Replies: 169
Views: 17718

Re: 10018 - Reverse and Add

Well hi abid. Your code is alright. But you have done a little mistake. In your code you forgot a simple thing.
Have a close look:

Code: Select all

Removed
Set the flag to 0.
You will get Ac.
Wish you good luck. :-?
by Articuno
Mon Dec 01, 2008 6:51 pm
Forum: Volume 108 (10800-10899)
Topic: 10843 - Anne's game
Replies: 19
Views: 9480

Re: 10843 - Anne's game

Thanks mf for your info. I didn't know about that. Now i understand. Thanks again. :)
by Articuno
Mon Dec 01, 2008 6:41 pm
Forum: Volume 108 (10800-10899)
Topic: 10843 - Anne's game
Replies: 19
Views: 9480

Re: 10843 - Anne's game

Well hi Abid, I told u that the formula i gave is a recursive method. U have to use recursion. Try using the formula in a recursive function not in main(). Well, what u have to do is just like below : long long bigmod(long long B,long long P,long long M) //Here pass n as B, n-2 as P and 2000000011 a...
by Articuno
Mon Dec 01, 2008 5:24 pm
Forum: Volume 108 (10800-10899)
Topic: 10843 - Anne's game
Replies: 19
Views: 9480

Re: 10843 - Anne's game

Well mf, thank u for your comments. In my reply to abid_iut, what i meant was : if you do this type of thing: ans=1; for(i=1;i<=98;i++) { ans=ans*100; } If i am right it will cause an overflow. In abid_iut's code, he does the similar thing and thus he is not getting the correct answer as there is an...
by Articuno
Mon Dec 01, 2008 5:00 pm
Forum: Volume 106 (10600-10699)
Topic: 10673 - Play with Floor and Ceil
Replies: 11
Views: 6658

Re: 10673 - Play with Floor and Ceil

I have solved this problem using my own method and it is giving correct output. But it has got TLE. Can anyone suggest any bug in my code?
Or is my poor approach is the cause of this TLE. Please help....

Here is my code

Code: Select all

Got AC
My algo was not good enough

Go to advanced search