I am glad to remind you that this Saturday will be held 3-rd round of Croatian contest.

I strongly recommend you to participate, as coci is one of the best IOI style competitions.

Hope for discussion of the problems after the round!

# | User | Rating |
---|---|---|

1 | tourist | 3555 |

2 | wxhtxdy | 3519 |

3 | Radewoosh | 3408 |

4 | Benq | 3368 |

5 | mnbvmar | 3280 |

6 | ecnerwala | 3277 |

7 | LHiC | 3276 |

8 | sunset | 3264 |

9 | maroonrk | 3158 |

10 | TLE | 3145 |

# | User | Contrib. |
---|---|---|

1 | Errichto | 189 |

2 | Radewoosh | 177 |

3 | tourist | 173 |

4 | antontrygubO_o | 172 |

5 | Vovuh | 166 |

5 | PikMike | 166 |

7 | rng_58 | 158 |

8 | majk | 156 |

9 | Um_nik | 153 |

9 | farmersrice | 153 |

I am glad to remind you that this Saturday will be held 3-rd round of Croatian contest.

I strongly recommend you to participate, as coci is one of the best IOI style competitions.

Hope for discussion of the problems after the round!

↑

↓

Codeforces (c) Copyright 2010-2019 Mike Mirzayanov

The only programming contests Web 2.0 platform

Server time: Dec/06/2019 09:48:01 (e1).

Desktop version, switch to mobile version.

Supported by

User lists

Name |
---|

6 tasks, 3 hours, no-feedback

IOI style!

PROBLEMS (the main part of each contest) are IOI stylish

Oh no contest is clashing with Codechef Lunch time :(

Yes, I also feel really sad about that.

Just reminder.

2 hours left, enjoy the contest and try to have fun ;)

How to apply DP+BITMASK for C problem?

my solution:

the state is dp[mask] where mask value is at most (2^n)-1 (I started counting form 0)

in this mask if the iTH bit was ON this means the iTH glass is not empty.

if the number of the turned on bits is k the answer is zero.

or you will apply two "for" loops on this mask..

let's say:

Now if the iTH bit or the jTH bit is off or i equals to j ,don't do any thing.

or you will try to pure the water from iTH glass to the jTH glass and the answer is a[i][j]+dp[mask-(1<<i)]

where a[i][j] is the cost to pure the water from the iTH glass to the jTH glass and you will turn off the iTH bit because the iTH glass in empty after that

my code

I put factor "on" in the solve function because I don't want to count the turned on bits everytime (this doesn't effects on the memorization because every mask has unique number of turned on bits).

I hope this information is useful :D

sorry for my bad English.

It seems to me something like (2^n)*(2^n). How about 2^n*n^2 solution?

It's actually n*n*(2^n) because you will do the operation for every mask once and every operation is O(n^2) and the number of masks is 2^n :D

(Note that I used an array to store results so I don't have to calculate the answer for every mask more than one time).

My really easy solution:

http://pastebin.com/4v3sZvk7

What did you mean, when you wrote

vector < int> bit; // bits of our num?

Is num, i?

Yes