Entries from 2016-01-01 to 1 year
TopCoder Statistics - Problem Statement This problem is short. Note that we just need to count the count of number's positions to change. We don't care the number of moves we did. So we sort the original array, compare it to the original a…
TopCoder Statistics - Problem Statement This problem is Easy. Note that write clean and easy-reading code, do not use much tricky. Because it may cause some bugs that can not be found easily. For each substring, compare the first half of t…
I have a huge document directory in my Linux which I copied from my external hard drive long long ago. My hard disk is almost full on my Linux. So I want to move these files to the external to save more space for my Linux. However, I am no…
codeforces.com Problem There are N cars, each car's price is C[i] and its fuel tank capacity is V[i]. The road length is S. There are K stations on the road. We must pass the road in T minutes. Fuel is free. Car can drive in two mode: (1) …
Today(11/21) is my 24's birthday. It's snowy. Nothing special happens and everything is as usual. Linux Mint 18 Today I install Plasma to the Linux Mint 18, because I chose the Xfce version when I installed Linux Mint 18. This is what I do…
codeforces.com Problem: There are N grid on a row, there are A ships, each ship's length is B. Let an int array Array[N] represents the grids. Array[i] == 0 or Array[i] == 1. Ships can only be placed on 0's. Guess some positions that there…
codeforces.com Because Xi < Xi+1, for i in [1, N). The plants are given in order "from left to the right". So all of Xi values are not important in this problem. We can discard them. Now the problem is: Given N numbers S[N]. Given a number…
iI use MacVim on macOS as well as Emacs. In MacVim, I use a plugin called neocomplete: github.com It requires Lua support in Vim. So I reinstall MacVim with Homebrew: brew uninstall macvim brew install macvim --with-lua --with-override-sys…
Codeforces support perl 5.20 and the perl version on macOS is 5.18. So I want to install perl 5.20 on macOS. There is a installation management toll for perl. It is Perlbrew. Just follow the homepage of the Perlbrew to install it: \curl -L…
Sometime I mess up my iTerm2 settings and forget where or which configuration I set before. It's annoying to find the exact option I need to reset. It is much easier if I can reset all of the settings to iTerm2's default. So this is the so…