poj 1284 Primitive Roots 求素數元根數
題意:給奇素數p,求p有多少原根。分析:phi(p-1),數論有具體證明。代碼: //poj 1284#include using namespace
poj 3468 A Simple Problem with Integers (線段樹區間更新入門)
A Simple Problem with Integers Time Limit: 5000MS Memory Limit:
POJ2635 The Embarrassed Cryptographer 簡單數論
看到這題的示意圖也是醉了~題意:給你一個k,他是兩個素數之積,然後給了一個數字L,然後找到具體是哪兩個素數相乘等於k,較小的那個素數是否小於L,若小
[LeetCode] Reverse Words in a String
Reverse Words in a String Given an input string, reverse the string w
C++ 實現判斷一個輸入日期是星期幾,是一年中的第幾天
/*通過輸入年月日,計算出這一天是星期幾,計算這一天是這一年的多少天,判斷這一年是否為閏年*/#includeusing namespace std;struc
ZOJ3868:GCD Expectation
Edward has a set of n integers {a1, a2,...,an}. He randomly picks a nonempty sub
ZOJ3860:Find the Spy
Whoooa! There is a spy in Marjar University. All we know is that the spy has a s
LeetCode—Reverse Bits ,1 Bit和數字的二進制情況相關
Reverse bits of a given 32 bits unsigned integer.For example, given input
[Practical.Vim(2012.9)].Drew.Neil.Tip28 學習摘要
Tip28Use Line Numbers as an AddressIf we press the : key now, the command-line p
ZOJ3864:Quiz for EXO
Exo (Korean: ??; Chinese:愛咳嗽; often stylized as EXO) is a Chinese-South Korean b
c++11 函數內部返回對象使用move語義的最佳實踐
一句話,直接返回即可,不用任何變化。當啟動了c++11選項後,通過函數返回代碼沒有發生任何變化,但是已經使用了move語義,而不需要之前的NRVO編譯器優化技術
[LeetCode] Find Peak Element
Find Peak ElementA peak element is an element that is greater than its nei