Duc's blog

By Duc, history, 4 years ago, In English

Code Jam to I/O for Women 2020 registration is open! Back for its seventh year, Code Jam to I/O for Women is an online coding competition that aims to bring more women (external) from around the globe to Google I/O. On Saturday, February 15, the single online-round will test participants' programming skills through a series of intriguing algorithmic challenges. The top 150 participants will receive a ticket to Google I/O along with a travel reimbursement.

Do you like solving fun, challenging problems? Then try your hand at Code Jam to I/O for Women, our coding competition bringing women from around the globe together in a single online round on Saturday, February 15. Register today→ g.co/codejamio.

Full text and comments »

  • Vote: I like it
  • +12
  • Vote: I do not like it

By Duc, history, 6 years ago, In English

I'd like to share my reusable c++ libs I've been using for codeforce contests.

https://github.com/duc0/ContestNeko

Some existing utilities:

  • Binary search
  • Lowest common ancestor
  • Binary Indexed Tree
  • Segment Tree
  • Heavy light decomposition
  • Convex hull
  • Prime generator
  • Simple matrix algebra
  • ...

You are free to use it in contests (subject to codeforces's policy I guess) and any contributions are more than welcome!

Full text and comments »

  • Vote: I like it
  • +57
  • Vote: I do not like it

By Duc, 13 years ago, In English
My explanation on why the number of states is small.

Let a state be (a, b, c, d) - the number of students in each house.

Suppose the sequence is all "?"  - "?????????......?"

Then in a state (a, b, c, d), the largest and the smallest number can differ by at most 1. Let the smallest number be x, then x can take a value from 1 to n/4. And each of a, b, c, d can be either x or x+1. So totally there can be at most n/4 * 2^4 = 4*n states. 

If the sequence contains some characters which are not "?", for example "??RR?G?H", I think intutively the number of states is smaller.

Full text and comments »

  • Vote: I like it
  • +11
  • Vote: I do not like it