原创 Codeforces 472D. Design Tutorial: Inverse the Problem
D. Design Tutorial: Inverse the Problem time limit per test2 seconds memory limit per test256 megabytes inputsta
原创 hdu 1166 敵兵佈陣(線段樹+單點更新)
敵兵佈陣 Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 7876
原创 CCPC/ACM(杭州)熱身賽
There are some positive integer numbers, and you want to divide them into two nonempty sets (every integer should b
原创 hdu 5895 Mathematician QSC(快速冪+指數循環節)
Mathematician QSC Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 131072/131072 K (Java/Others) Total Submissi
原创 Codeforces Round #368 (Div. 2) 707B. Bakery
B. Bakery time limit per test2 seconds memory limit per test256 megabytes inputstandard input outputstandard ou
原创 poj 3667 Hotel
Hotel Time Limit: 3000MS Memory Limit: 65536K Total Submissions: 16373 Accepted: 7108 Description Th
原创 RSA加密原理
首先先解決這樣一個問題,b和m已知求滿足下面條件的x, xk≡b(modm)xk≡b(modm) 這個問題若是沒有限制條件的話會變得很棘手,那麼假設條件變得更強讓gcd(b,m)=1;便會想到利用歐拉函數求出ϕ(m)ϕ(m)
原创 POJ 3468 A Simple Problem with Integers
A Simple Problem with Integers Time Limit: 5000MS Memory Limit: 131072K Total Submissions: 96328 Acce
原创 Codeforces 711D Directed Roads
ZS the Coder and Chris the Baboon has explored Udayland for quite some time. They realize that it consists of n tow
原创 Codeforces 514C . Watto and Mechanism
C. Watto and Mechanism time limit per test3 seconds memory limit per test256 megabytes inputstandard input outp
原创 POJ 1845 Sumdiv(數論+快速冪)
Sumdiv Time Limit: 1000MS Memory Limit: 30000K Total Submissions: 19576 Accepted: 4930 Description Consider two
原创 SG函數與組合博弈問題
把組合博弈問題抽象成一個有向無環圖,有n個棋子在上面移動,當AB兩方其中一方移動不了時另一方獲勝. 定義mex運算爲集合內沒有出現過的最小的自然數,則SG(x)=mex{SG(y)(其中y爲x所擴展出的狀態)} 結論:當有K組
原创 Codeforces 711E ZS and The Birthday Paradox
E. ZS and The Birthday Paradox time limit per test 2 seconds memory limit per test 256 megabytes input sta
原创 HDU 2222 AC自動機 模板
Keywords Search Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 131072/131072 K (Java/Others) Total Submis
原创 poj 2528 Mayor's posters
Mayor’s posters Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 59553 Accepted: 17255 Des