HDU 5194 DZY Loves Balls(排列組合瞎搞 ),hdu5194Problem DescriptionThere are n black balls and m white balls in the big box.Now, DZY starts to randomly pick out the balls one by one. It forms a sequence S. If at the i-th operation, DZY takes out the black
CF525 ABCDE,cf525abcde XGG BlogCF525A Vitaliy and PieCF525B Pasha and StringCF525C Ilya and SticksCF525D Arthur and WallsCF525E Anya and CubesSolutionsCF525A Vitaliy and PieBrute force.CF525B Pasha and StringThe effect will be eliminated if
[LeetCode] Binary Tree Right Side View,leetcodebinaryBinary Tree Right Side ViewGiven a binary tree, imagine yourself standing on the right side of it, return the values of the nodes you can see ordered from top to bottom.For example:Given
C++ enum的使用,enum使用enum day {Sun,Mon,Tue,Wed,Thu,Fri,Sat}; 預設情況下,枚舉符的值從0開始,其後值總是前面一個+1。 即Sun=0,Mon=1,Tue=2,Wed=3,Thu=4,Fri=5,Sat=6 也可以自己定義數值,其後值總是前面一個+1 例如: enum day
Median of Two Sorted Arrays--LeetCode,leetcodetwosum題目:There are two sorted arrays A and B of size m and n respectively. Find the median of the two sorted arrays. The overall run time complexity should be O(log (m+n)).思路:這道題比較直接的想法就是用Merge