原创 點分治+算法模板

#include<bits/stdc++.h> using namespace std; #define Sheryang main #define TYPE int const int maxn=1e5+7; typedef long

原创 Educational Codeforces Round 61 (Rated for Div. 2) D. Stressful Training(貪心+二分)

Educational Codeforces Round 61 (Rated for Div. 2) 題意:有n臺電腦要使用,一共m分鐘,每臺電腦初始電量ai,每分鐘消耗bi,若你有一臺充電寶,那麼每分鐘至少衝多少電量,才能保證每分鐘所

原创 Codeforces Global Round 1 E. Magic Stones(思維+構造+差分)

Codeforces Global Round 1 題意:給出長度爲n的數組c和長度爲n的數組t,已知對於數組c的每一項都可以使得c[i]=c[i+1]+c[i-1]−c[i],判斷是否可以使得c數組變爲t數組。 題解:c[i]-c[i-

原创 codeforce(等....) dp好題集選

2019年到了,馬上又是省賽區域賽的一年了,但是我的dp水平還是堪憂,所以在衆多網站(主要codeforce)蒐羅一下dp的好題刷一下,並在此發一下解題報告來督促自己.... MemSQL Start[c]UP 3.0 - Round

原创 Sitting in Line 百度之星初賽(狀壓dp)

Sitting in Line Time Limit: 10000/5000 MS (Java/Others)    Memory Limit: 262144/262144 K (Java/Others) Total Submission

原创 P5123 [USACO18DEC]Cowpatibility (容斥 or bitset暴力)

題目描述 研究證明,有一個因素在兩頭奶牛能否作爲朋友和諧共處這方面比其他任何因素都來得重要——她們是不是喜歡同一種口味的冰激凌! Farmer John 的 NN 頭奶牛(2\le N\le 5\times 10^42≤N≤5×104)各

原创 Pollard Rho大整數因子分解算法(模板)

#include<iostream> #include<ctime> #include<algorithm> #include<map> using namespace std; typedef long long ll; map<ll

原创 CF Div 2 D. Game with modulo(交互+二分)

D. Game with modulo time limit per test 1 second memory limit per test 256 megabytes input standard input output standa

原创 D. Makoto and a Blackboard(積性函數,期望dp)

D. Makoto and a Blackboard time limit per test 2 seconds memory limit per test 256 megabytes input standard input outpu

原创 cf div3 F. Elongated Matrix(狀壓dp)

F. Elongated Matrix time limit per test 4 seconds memory limit per test 256 megabytes input standard input output stand

原创 Codeforces Round #525 (Div. 2) D(交互題+思維)

D. Ehab and another another xor problem time limit per test 1 second memory limit per test 256 megabytes input standard

原创 D. Easy Problem cf EC 57 (字符串DP)

D. Easy Problem time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard

原创 Codeforces Round #527 (Div. 3) C. Prefixes and Suffixes (string+multiset+思維)

C. Prefixes and Suffixes time limit per test 1 second memory limit per test 256 megabytes input standard input output s

原创 Wannafly挑戰賽27 C 藍魔法師(樹上dp)

鏈接:https://ac.nowcoder.com/acm/contest/215/C 來源:牛客網   時間限制:C/C++ 1秒,其他語言2秒 空間限制:C/C++ 262144K,其他語言524288K 64bit IO Form

原创 Wannafly挑戰賽29 B 白井黑子 (數論+map)

鏈接:https://ac.nowcoder.com/acm/contest/271/B 來源:牛客網   kuroko 作爲常盤臺唯一的空間系能力者,在每年例行的能力測試中可絕對不能讓 misaka 失望哦,但是由於她的等級只是 lev