Search found 9 matches

by mehdiii
Sat Jul 20, 2013 5:40 am
Forum: Volume 107 (10700-10799)
Topic: 10724 - Road Construction
Replies: 7
Views: 7939

Re: 10724 - Road Construction

Some Correct input and output : Input : 10 20 23 62 15 28 72 83 56 80 30 30 98 82 51 76 39 21 65 83 72 9 1 2 1 3 2 4 2 5 4 6 4 7 6 8 3 9 7 10 7 5 4 9 1 2 10 2 9 8 6 9 6 5 9 7 1 4 8 2 8 6 10 20 41 40 10 85 9 57 37 43 17 92 55 32 47 21 69 44 87 23 8 78 1 2 2 3 3 4 1 5 3 6 5 7 4 8 3 9 4 10 8 1 6 4 8 9 ...
by mehdiii
Fri Mar 29, 2013 4:10 pm
Forum: Volume 124 (12400-12499)
Topic: 12466 - Ancestors
Replies: 0
Views: 1740

12466 - Ancestors

Hi I tried to solve this problem but I can not proceed any more, can you give me a hint? I was thinking like this : dp[node][t] means from node and it's subtree the t-th largest value which also satisfies the conditions. then I can update dp [k] using it's children. O( n * k * log(k) ) But I can not...
by mehdiii
Fri Mar 29, 2013 12:22 am
Forum: Volume 112 (11200-11299)
Topic: 11270 - Tiling Dominoes
Replies: 6
Views: 4641

Re: 11270 - Tiling Dominoes

By the way, Thank you, I changed it a little bit and got ACCEPTED ;-)
by mehdiii
Fri Mar 29, 2013 12:20 am
Forum: Volume 112 (11200-11299)
Topic: 11270 - Tiling Dominoes
Replies: 6
Views: 4641

Re: 11270 - Tiling Dominoes

That's so strange, last night I was testing my program with Visual Studio 2010, and it worked very good, generated correct output as I said in my previous post, but now, after your reply I tested it with MinGW/G++ and it didn't work, I checked my code again and noticed line 19 : return dp[v] = f(row...
by mehdiii
Thu Mar 28, 2013 10:49 pm
Forum: Volume 115 (11500-11599)
Topic: 11512 - GATTACA
Replies: 23
Views: 12521

Re: 11512 - GATTACA

Yeah Thank you, I got TLE exceeded too (using hash), I solved it using TRIE.
Do you have any idea on the dp approach of mak(cse_DU)?
by mehdiii
Thu Mar 28, 2013 5:13 pm
Forum: Volume 115 (11500-11599)
Topic: 11512 - GATTACA
Replies: 23
Views: 12521

Re: 11512 - GATTACA

Has anybody solved this problem using Hashing??? I don't think the running time of hashing is good enough to pass all tests. I know other ways of solving this problem, I'm just curious about solving it using hashing. They have tagged it as "hashing" in this page http://uvatoolkit.com/probl...
by mehdiii
Thu Mar 28, 2013 1:01 am
Forum: Volume 119 (11900-11999)
Topic: 11952 - Arithmetic
Replies: 11
Views: 5617

Re: 11952 - Arithmetic

Just check for bases up to 50, and the only special case is when base = 1 (which is clearly explained in the problem statement).
by mehdiii
Thu Mar 28, 2013 12:53 am
Forum: Volume 107 (10700-10799)
Topic: 10751 - Chessboard
Replies: 21
Views: 16185

Re: 10751 - Chessboard

I checked it for small n, then I found a pattern, but I have no proof for it.

Input :

Code: Select all

10
1
2
3
4
5
6
7
8
9
10
Output :

Code: Select all

0.000

4.000

9.414

17.657

28.728

42.627

59.355

78.912

101.296

126.510
by mehdiii
Wed Mar 27, 2013 10:22 pm
Forum: Volume 112 (11200-11299)
Topic: 11270 - Tiling Dominoes
Replies: 6
Views: 4641

Re: 11270 - Tiling Dominoes

neither n nor m is zero in the judge data. I have a problem here : When I produce all possible inputs and I put it in my source code just to print in UVa OJ it gets ACCEPTED. .... mat[25][4] = 114079985111LL; mat[26][1] = 1LL; mat[26][2] = 196418LL; mat[26][3] = 21489003LL; .... But when I calculate...

Go to advanced search