Search found 150 matches

by plamplam
Sat Jun 09, 2012 12:04 am
Forum: Volume 110 (11000-11099)
Topic: 11039 - Building designing
Replies: 9
Views: 5494

Re: 11039 - Building designing

Try this

Code: Select all

7
5
-1
-2
-3
-4
-5
5
1
2
3
4
5
2
5
-1
0
1
5
5
7
-2
6
9
-3
8
11
-9
2
5
18
17
-15
4
Output:

Code: Select all

1
1
2
0
1
2
5
by plamplam
Thu May 17, 2012 8:00 pm
Forum: Volume 117 (11700-11799)
Topic: 11751 - Installing Diagnostic Software
Replies: 2
Views: 1733

11751 - Installing Diagnostic Software

What's wrong with this problem? I want to know is the judge data correct or I misunderstood it? I always got wrong answer but I don't understand the reason. Can anyone tell me the output of this input? 20 30 0 1 0 2 4 5 12 1 1 13 13 14 1 7 8 2 9 1 15 16 17 18 13 2 14 4 14 19 14 12 14 11 14 10 14 1 1...
by plamplam
Fri Apr 06, 2012 3:25 pm
Forum: Volume 116 (11600-11699)
Topic: 11645 - Bits
Replies: 9
Views: 4278

Re: 11645 - Bits

There is a much simpler recurrence using the powers of 2.
by plamplam
Fri Mar 30, 2012 11:27 am
Forum: Volume 104 (10400-10499)
Topic: 10433 - Automorphic Numbers
Replies: 41
Views: 23351

Re: 10433 - Automorphic Numbers

I got accepted with java, just squared the input using biginteger multiplication. Note that, I didn't use substring but a loop to check. Also take the input as string to conserve leading zeros. The length of the squared number might be less then the original number, which if you don't check will lea...
by plamplam
Mon Mar 05, 2012 2:25 pm
Forum: Volume 102 (10200-10299)
Topic: 10285 - Longest Run on a Snowboard
Replies: 10
Views: 6593

Re: 10285 - Longest Run on a Snowboard

backtracking...DP....lol? seriously guys....r and c are not bigger than 100 and there are not more than 15 test cases. Just run dfs with a counter from each height. Got accepted in 40 ms
by plamplam
Thu Feb 23, 2012 6:23 pm
Forum: Volume 100 (10000-10099)
Topic: 10044 - Erdos Numbers
Replies: 102
Views: 39753

Re: 10044 - Erdos Numbers

My accepted code produces different results on your input @Imti: Scenario 1 ghj,P. infinity ghj, P. infinity Scenario 2 ghj,P. infinity ghj, P. 1 Scenario 3 ghj,P. infinity ghj, P. 1 Scenario 4 ghj,P. 1 ghj, P. infinity Scenario 5 ghj, P. infinity ghj, P. infinity You don't need to remove extra spac...
by plamplam
Fri Jan 27, 2012 5:35 pm
Forum: Volume 106 (10600-10699)
Topic: 10668 - Expanding Rods
Replies: 38
Views: 20328

Re: 10668 - Expanding Rods

I used binary search on theta, after getting a couple of wrong answers, when I handled cases like n = 0, l = 0 or c = 0, I got Accepted. Here are some cases: 1000 100 0.0001 0 100 0.0001 1000 0 0.0001 1000 100 0 15000 10 0.00006 10 0 0.001 -112 -1121212 -1324 61.329 0.000 0.000 0.000 225.020 0.000
by plamplam
Thu Jan 26, 2012 5:30 pm
Forum: Volume 116 (11600-11699)
Topic: 11699 - Rooks
Replies: 2
Views: 3229

Re: 11699- getting WA

Some i/o: ............... ............... ............... ............... .......#....... ............... ............... .......#....... ............... ............... ............... ............... #......#......# ............... ............... #.............# .#...........#. ..#.........#.# .....
by plamplam
Sun Jan 08, 2012 8:52 pm
Forum: Volume 102 (10200-10299)
Topic: 10245 - The Closest Pair Problem
Replies: 92
Views: 10784

Re: 10245 - The Closest Pair Problem

With certainty that it will get Time Limit, I submitted my O(n^2) program to the judge and guess what? I got Accepted in less than 1 second!! Now I read in the board that everyone is saying O(n^2) can't pass the time limit, etc etc. So, I just wanted to inform future viewers that a O(n^2) algorithm ...
by plamplam
Sun Jan 08, 2012 8:55 am
Forum: Volume 124 (12400-12499)
Topic: 12405 - Scarecrow
Replies: 5
Views: 3294

Re: 12405

Code: Select all

8
5
.....
5
..*..
10
....##..#.
10
.....#....
9
....#....
12
....#....#..
10
..#..##...
13
..#..##....#.
by plamplam
Tue Jan 03, 2012 11:09 am
Forum: Volume 108 (10800-10899)
Topic: 10887 - Concatenation of Languages
Replies: 49
Views: 18719

Re: 10887 - Concatenation of Languages

I got Accepted with STL map, just don't use cin/getline, use gets() you should pass the Time Limit.
by plamplam
Sat Dec 31, 2011 2:16 pm
Forum: Volume 113 (11300-11399)
Topic: 11386 - Triples
Replies: 23
Views: 8591

Re: 11386 - Triples

I don't know why, but my O(n ^ 2) * log(n) algorithm gets Time Limit Exceeded. I used sort + grouping with frequency + binary search. I later got Accepted at 6.732 seconds after using STL map and changing everything to long long. And yeah, writing a hashing function would be much faster, probably th...
by plamplam
Wed Dec 21, 2011 10:22 pm
Forum: Volume 106 (10600-10699)
Topic: 10683 - The decadary watch
Replies: 35
Views: 12853

Re: 10683 - The Decadary Watch

Glad to help :)
by plamplam
Fri Dec 16, 2011 9:41 am
Forum: Volume 107 (10700-10799)
Topic: 10722 - Super Lucky Numbers
Replies: 25
Views: 9616

Re: 10722 - Super Lucky Numbers

Your program produced incorrect output for both these inputs: 100 100 128 100 0 0 Correct Output: 9802449187172393445684320037312434586197322829928031 154573622788994506666403435308121275605063788856396567109 341214204216189281001106446450619006029982302442616751647 355509210488248066053665166225500...
by plamplam
Fri Dec 09, 2011 8:33 pm
Forum: Volume 105 (10500-10599)
Topic: 10519 - !! Really Strange !!
Replies: 35
Views: 13646

Re: 10519 - Really Strange

Nice problem but lame description. It took me a lot of time just to understand what the problem-setter was saying. I suggest this problem-setter guy needs to learn how to communicate properly.
Best Regards.

Go to advanced search