原创 正宇丨你的不自律,會毀了你一輩子

兩個月前,與一位朋友打賭,如果一個暑假的時間他能成功減去20斤的體重,算我輸,賭約是2000塊錢。   期間,由於大家都比較忙,也懶得聯繫。   昨天,這小子屁顛屁顛地來找我,我真的被驚到了,整個人真瘦了一圈,一大圈。   我把他往家裏的

原创 逆序數的幾種求法

轉載原地址:https://blog.csdn.net/Du_Mingm/article/details/81203260 首先,逆序數的定義 什麼叫逆序數 對於某一個數來說,它的逆序數等於在它之前有多少個比它大的數 對於某一個序列來說,

原创 Small Multiple(最短路)/// (雙向隊列)

題目原址:http://exam.upc.edu.cn/problem.php?cid=1368&pid=2 題意:給一個數 k,問在k的倍數中,求各個位數相加之和的最小的一個k的倍數。 看了題解才知道題意,我也來感嘆一番,題解的用法真是

原创 map(映射)c++

map的定義:                map 是一種關聯容器,是從(鍵)key到(值)value的映射,因爲重載了[ ] 運算符,map像是數組中的高級版 例如,可以使用map<string ,int  month_name這樣的

原创 Game Map (容器的使用+貪心)

[提交] [狀態] [討論版] [命題人:admin] 題目描述 The ICPC-World is the most popular RPG game for ACM-ICPC contestants, whose objective

原创 Happy Number(找規律)

[提交] [狀態] [討論版] [命題人:admin] 題目描述 Consider the following function f defined for any natural number n: f(n) is the numbe

原创 Formula

[提交] [狀態] [討論版] [命題人:admin] 題目描述 Tim is quite a bookworm. Each Saturday he goes to the local library and spends the wh

原创 Slot Machines + (KMP)

題目描述 Slot machines are popular game machines in casinos. The slot machine we are considering has six places where a fig

原创 Selling CPUs(DP)

[提交] [狀態] [討論版] [命題人:admin] 題目描述 You are very happy, that you got a job at ACME Corporation’s CPU factory. After a har

原创 Dwarves(拓撲排序+字符串使用map量化表示)

題目描述 Once upon a time, there arose a huge discussion among the dwarves in Dwarfland. The government wanted to introduce

原创 FANG FANG

Fang Fang says she wants to be remembered. I promise her. We define the sequence F of strings. F0 = “f”, F1 = “ff”, F2

原创 LARGEST POINT

Given the sequence A with n integers t1 , t2 , …… , tn . Given the integral coefficients a and b. The fact that select

原创 Coins I

Alice and Bob are playing a simple game. They line up a row of n identical coins, all with the heads facing down onto t

原创 Origami

[提交] [狀態] [討論版] [命題人:admin] 題目描述 Master Grus is a famous origami (paper folding) artist, who is enthusiastic about exp

原创 組合數的幾種求法

直接求解的組合數,不需要進行取模運算。 爲了避免中間結果的溢出,僅使用一個簡單的方法:n! / m! =(m+1)*(m+2)*......(n-1)* n; long long C(int n,int m) { if(m<n-m)