Search found 150 matches

by plamplam
Thu Jul 14, 2011 7:32 pm
Forum: Volume 103 (10300-10399)
Topic: 10375 - Choose and divide
Replies: 23
Views: 11759

Re: 10375 - Choose and Divide

First of all, you can't get AC with double. You must use long double to get Accepted and remember you can't use log or ln for this problem as this would cause precision error. (May be it is possible to solve this using log or ln by adding/subtracting or looping less, but I wouldn't recommend using i...
by plamplam
Wed Jul 13, 2011 11:42 pm
Forum: Volume 106 (10600-10699)
Topic: 10642 - Can You Solve It?
Replies: 10
Views: 17978

Re: 10642 - Can You Solve It?

It's a mess....shitty thing...the graph is actually inverted. I mean the x-axis labeled is the traditional y-axis and the y-axis is the traditional x-axis. Very easy problem but it took me some time to solve this just because of this inversion thing. :x :x
by plamplam
Wed Jul 13, 2011 7:02 pm
Forum: Volume 5 (500-599)
Topic: 545 - Heads
Replies: 67
Views: 44391

Re: 545

I solved both 545 and 474 without log or log10 or pow or bigint. For 474, after you calculate the result, use the following snippet to output your result. cout << showpoint << setprecision(4) << result; The correct output for 6 is 1.562e-2 and not 1.563e-2 for 474. This is because the number is not ...
by plamplam
Wed Jul 13, 2011 12:12 pm
Forum: Volume 101 (10100-10199)
Topic: 10196 - Check The Check
Replies: 77
Views: 24309

Re: 10196 - Check The Check

And follow stcheung's advice. His 5th advice is very important (Actually it saves you a lot of time and your code will be shorter so there will be lesser probability for error to creep in). I created a 40 x 40 char array and stored the board in the middle of my array.
by plamplam
Wed Jul 13, 2011 12:06 pm
Forum: Volume 101 (10100-10199)
Topic: 10196 - Check The Check
Replies: 77
Views: 24309

Re: 10196 - Check The Check

Nice problem, although it actually tests your patience and how much cautious you are :)...May be I enjoyed solving this because I like to play chess :wink: If you get Wrong Answer, just try the sample inputs posted by jud (Thanks jud nice I/O) on page 2. Be careful when you are checking whether the ...
by plamplam
Mon Jul 11, 2011 8:48 pm
Forum: Volume 104 (10400-10499)
Topic: 10493 - Cats, with or without Hats
Replies: 13
Views: 6984

Re: 10493 - Cats, with or without Hats

Really amazing problem...although it took me some time to figure out the last special case, i.e, when n= 1 and m = 1. (I just tried harder because I couldn't find any test cases at first for which multiple solutions exist). My solution is also a bit different. Yeah at first I drew some trees on pape...
by plamplam
Sun Jul 10, 2011 7:54 pm
Forum: Volume 113 (11300-11399)
Topic: 11384 - Help is needed for Dexter
Replies: 8
Views: 4744

Re: 11384 - Help is needed for Dexter

Awesome problem lol.....I found out all the minimum moves from 1 to 16 on paper first :wink: , may be this is not the way to solve this problem, but I like do it in my way. Nice recurrence relation. Thanks to the problem setter :)
by plamplam
Fri Jul 08, 2011 12:56 pm
Forum: Volume 108 (10800-10899)
Topic: 10815 - Andy's First Dictionary
Replies: 116
Views: 31955

Re: 10815 - Andy's First Dictionary

Use a faster sorting algorithm (I think you are using bubble-sort) to sort the words in dictionary order. I used qsort to get AC in 0.115 seconds. Good luck.
by plamplam
Thu Jul 07, 2011 7:49 pm
Forum: Volume 6 (600-699)
Topic: 642 - Word Amalgamation
Replies: 9
Views: 5973

Re: 642 - Word Amalgamation

This is a very simple problem, just make sure you are doing the sorting correctly. A simple letter frequency is enough to solve this. And you should really not get Wrong Answer if you manage to pass the sample input. If you do get Wrong Answer, then it is most probably because of your sorting functi...
by plamplam
Wed Jul 06, 2011 8:09 pm
Forum: Volume 119 (11900-11999)
Topic: 11959 - Dice
Replies: 6
Views: 2643

Re: 11959 - Dice

Sure, its a pleasure. Flip the dice once side-wise to the right. Now you have this combination: 463251 Now turn the dice once(90 degrees) clockwise, and there you go 461325. At first I checked if there are three pairs in the second string with the same opposite faces as in the first string, but then...
by plamplam
Wed Jul 06, 2011 7:41 pm
Forum: Volume 116 (11600-11699)
Topic: 11646 - Athletics Track
Replies: 2
Views: 2400

Re: 11646 Atheletics Track

I solved it in C. Input is terminated in this problem by eof.

for (; ;)
{
gets(str);
if (feof(stdin)) break;
}
by plamplam
Tue Jul 05, 2011 5:12 pm
Forum: Volume 118 (11800-11899)
Topic: 11827 - Maximum GCD
Replies: 22
Views: 4282

Re: 11827 - Maximum GCD (Why RE??)

Mamu I checked your program...your code doesn't output anything for my test case.
1
10 20 30 40(space)(space)(space).
Hope it helps you. :wink: :roll:
by plamplam
Tue Jul 05, 2011 5:10 pm
Forum: Volume 118 (11800-11899)
Topic: 11827 - Maximum GCD
Replies: 22
Views: 4282

Re: 11827 - Maximum GCD (Why RE??)

I got 3 Runtime Errors before I finally got AC so here are some reasons you can get Runtime error. 1. Your Array size is not big enough (100000 is enough). 2. The judge data contains inputs with 0. My first approach was to find the minimum and maximum of the two numbers. So then I check if max % min...
by plamplam
Sun Jul 03, 2011 4:58 pm
Forum: Volume 104 (10400-10499)
Topic: 10409 - Die Game
Replies: 7
Views: 4365

Re: 10409 - Die Game

Try these inputs 1 north 1 east 1 south 1 west 5 north south east west south 2 south east 2 south west 2 north north 3 east east east 4 east east south west 10 east west east north north west south north north west 0 Output should be: 5 3 2 4 2 3 4 6 4 3 3 I got 2 Wrong Answers before AC because of ...
by plamplam
Sun Jul 03, 2011 3:47 pm
Forum: Volume 120 (12000-12099)
Topic: 12019 - Doom's Day Algorithm
Replies: 8
Views: 2808

Re: 12019 Doom's Day Algorithm..WA!! Help me

Okay this is better and more funny.
Try this input:

Code: Select all

2
9 30
10 1
Do you see it? There is a big hole in your program. Its like I slept on Friday night and woke up to see it was Sunday instead of Saturday. May be it was a dream?
Who told you September has 31 days anyway?

Go to advanced search