Search found 15 matches
- Sat Sep 25, 2010 4:20 am
- Forum: Volume 118 (11800-11899)
- Topic: 11847 - Cut the Silver Bar
- Replies: 11
- Views: 5808
Re: 11847 Cut the Silver Bar
You have to read from standard input.
- Thu Sep 23, 2010 2:31 pm
- Forum: Volume 118 (11800-11899)
- Topic: 11847 - Cut the Silver Bar
- Replies: 11
- Views: 5808
Re: 11847 Cut the Silver Bar
Answer is floor(log2(n))
- Wed Sep 22, 2010 10:44 am
- Forum: Volume 118 (11800-11899)
- Topic: 11843 - Guessing Game
- Replies: 10
- Views: 4894
Re: 11843 - Guessing Game
How to solve using dp? I'm stuck at it.
dp(i,j) = min guess (i numbers with at most j strikes). Answer is obviously dp(n,m-1).
if our first guess is k then numbers divided to 0..k-1 and k+1..n-1. Numbers in 0 to k-1 need one strike but k+1..n doesn't need.
so dp(i,j) = min ( max( dp(k,j-1) , dp(n ...
dp(i,j) = min guess (i numbers with at most j strikes). Answer is obviously dp(n,m-1).
if our first guess is k then numbers divided to 0..k-1 and k+1..n-1. Numbers in 0 to k-1 need one strike but k+1..n doesn't need.
so dp(i,j) = min ( max( dp(k,j-1) , dp(n ...
- Mon Sep 20, 2010 3:22 pm
- Forum: Volume 118 (11800-11899)
- Topic: 11841 - Y-game
- Replies: 3
- Views: 1967
Re: 11841 - Y-game
Your tests are incorrect, in each coordinate x+y+z must equal to n
- Mon Sep 20, 2010 4:07 am
- Forum: Volume 118 (11800-11899)
- Topic: 11838 - Come and Go
- Replies: 22
- Views: 11256
Re: 11838 - Come And Go
Problem is asking the given directed graph is connected or not.
You can solve it using Tarjan's algorithm.
You can solve it using Tarjan's algorithm.
- Sat Sep 18, 2010 6:02 am
- Forum: Volume 118 (11800-11899)
- Topic: 11825 - Hackers' Crackdown
- Replies: 5
- Views: 5019
Re: 11825 - Hackers’ Crackdown
Let's denote cover(mask) = true if nodes in mask and their neighbours can cover all nodes. Now problem asks divide all nodes into maximum number of subsets such that all of their cover() = true.
It can solved using dynamic programming.
DP(mask) = maximum number of subsets we can divide into ( using ...
It can solved using dynamic programming.
DP(mask) = maximum number of subsets we can divide into ( using ...
- Tue Feb 02, 2010 12:02 pm
- Forum: General
- Topic: A lot of SPAMs -- Admin please react!
- Replies: 4
- Views: 3946
Re: A lot of SPAMs -- Admin please react!
I agree, spam is really annoying. When i see new thread and open - it's another spam. Too bad 

- Sun Jan 31, 2010 1:39 pm
- Forum: Volume 117 (11700-11799)
- Topic: 11747 - Heavy Cycle Edges
- Replies: 11
- Views: 6834
Re: 11747 - Heavy Cycle Edges
I didn't go through your code, but the answer is some edges those aren't included in Minimum Spanning Tree.
- Sun Jan 03, 2010 5:53 pm
- Forum: Volume 115 (11500-11599)
- Topic: 11592 - Bulb inside a Grid (II)
- Replies: 2
- Views: 2700
Re: 11592 - Bulb inside a Grid (II)
I just got AC (3s) with O(M*sqrt(N)) algorithm.
- Sat Sep 19, 2009 9:22 am
- Forum: Volume 116 (11600-11699)
- Topic: 11668 - How Many Teams
- Replies: 7
- Views: 2487
Re: 11668
Thanks your hint rushel.
I missed this part
I missed this part
Due to the limited number of seats, a department can send at most 3 members.
- Mon Sep 14, 2009 2:58 am
- Forum: Volume 116 (11600-11699)
- Topic: 11675 - Happy Friends
- Replies: 6
- Views: 4090
Re: 116XX -Happy Friends
I think your input has 10 test cases, output is 12.
And my AC code returns
Case 1: 7 26 7 7
Case 2: 33 26 40 40
Case 3: 954724928 522243248 868722089 868722089
Case 4: 476968169 522243248 259687412 259687412
Case 5: 476968169 518586234 259687412 259687412
Case 6: 945782367 500437378 491146889 ...
And my AC code returns
Case 1: 7 26 7 7
Case 2: 33 26 40 40
Case 3: 954724928 522243248 868722089 868722089
Case 4: 476968169 522243248 259687412 259687412
Case 5: 476968169 518586234 259687412 259687412
Case 6: 945782367 500437378 491146889 ...
- Fri Aug 28, 2009 11:42 am
- Forum: Volume 116 (11600-11699)
- Topic: 11654 - Arithmetic Subsequence
- Replies: 6
- Views: 3449
Re: 11654 - Arithmetic Subsequence
Let a[j] = Number of arithmetic subset using number 1 to j and last two number is i'th and j'th.
O(N^3)
O(N^3)
- Tue Jul 14, 2009 8:10 am
- Forum: Off topic (General chit-chat)
- Topic: How old are you? Statistics.
- Replies: 121
- Views: 195412
Re: How old are you? Statistics.
I'm 17 and solved 200. Registered 1 year ago and started from February.
- Thu Jul 02, 2009 4:56 pm
- Forum: Volume 114 (11400-11499)
- Topic: 11490 - Just Another Problem
- Replies: 4
- Views: 3420
Re: 11490 - Just Another Problem
My O(sqrt(S)) algorithm got AC in 1.3sNaani wrote:My O(sqrt(n)) solution is timing out. Any hints are appreciated. I just dont see any different algorithm.
TIA
Vinay Emani

- Tue Jun 23, 2009 2:45 pm
- Forum: Volume 115 (11500-11599)
- Topic: 11514 - Batman
- Replies: 6
- Views: 3338
Re: 11514 - Batman
Because you must destroy villains and use powers input order.wallace wrote:this case:
4 4 3000
pA 9000 44
pB 9000 100
pC 9000 400
pD 9000 100
Joker 4000 pB
Penguin 8000 pD
TwoFace 6000 pC
feroz 4000 pA
0 0 0
answer: No
why?