light oj 1248,oj1248Given a dice with n sides, you have to find the expected number of times you have to throw that dice to see all its faces at least once. Assume that the dice is fair, that means when you throw the dice, the probability
3Sum——解題報告,3sum解題 【題目】 Given an array S of n integers, are there elements a, b, c in S such that a + b + c = 0? Find all unique triplets in the array which gives the sum of zero.Note:Elements in a triplet (a,b,
[LeetCode]203.Remove Linked List Elements,leetcode203.remove 題目Remove all elements from a linked list of integers that have value val.Example Given: 1 –> 2 –> 6 –> 3 –> 4 –> 5 –> 6, val = 6 Return: 1 –> 2 –> 3 –> 4 –
HDU 5090 Game with Pearls,hdu5090直接貪心就可以了,接收的時候把0都加上k,每次從最小的數開始找,如果有多個相同的,那麼保留一個,其他的都加上k#include<stdio.h>#include<algorithm>using namespace std;int a[105];int main(){#ifndef
POJ1143:Number Game(狀態壓縮),poj1143numberDescriptionChristine and Matt are playing an exciting game they just invented: the Number Game. The rules of this game are as follows. The players take turns choosing integers greater than 1. First,