atp

LuoguP5322 [BJOI2019]排兵布阵(DP)

耗尽温柔 提交于 2019-12-02 11:40:45
城为物,人为容,价值?排序后,一切都明了 #include <iostream> #include <cstdio> #include <cstring> #include <cstdlib> #include <algorithm> #include <cmath> #define R(a,b,c) for(register int a = (b); a <= (c); ++a) #define nR(a,b,c) for(register int a = (b); a >= (c); --a) #define Fill(a,b) memset(a, b, sizeof(a)) #define Swap(a,b) ((a) ^= (b) ^= (a) ^= (b)) #define QWQ #ifdef QWQ #define D_e_Line printf("\n---------------\n") #define D_e(x) cout << (#x) << " : " << x << "\n" #define Pause() system("pause") #define FileOpen() freopen("in.txt", "r", stdin) #define FileSave() freopen("out.txt", "w", stdout) #define

2019.10.22-魔法(堆)

和自甴很熟 提交于 2019-12-01 22:45:18
题目大意:给定两个 \(n\) 元组,求其中不同组元素相加得的结果最小前 \(n\) 个 排掉,加上,扔堆,拿出,回去,没了 #include <iostream> #include <cstdio> #include <cstring> #include <algorithm> #include <cmath> #define R(a,b,c) for(register int a = (b); a <= (c); ++a) #define nR(a,b,c) for(register int a = (b); a >= (c); --a) #define Fill(a,b) memset(a, b, sizeof(a)) #define Swap(a,b) ((a) ^= (b) ^= (a) ^= (b)) #define ON_DEBUGG #ifdef ON_DEBUGG #define D_e_Line printf("-----------\n") #define D_e(x) std::cout << (#x) << " : " <<x << "\n" #define FileOpen() freopen("in.txt", "r", stdin) #define FileSave() freopen("out.txt", "w", stdout) #define

BZOJ3037 创世纪(基环树DP)

拜拜、爱过 提交于 2019-11-30 04:22:28
基环树DP,攻的当受的儿子,f表选,g表不选。并查集维护攻受关系。若有环则记录,DP受的后把它当祖宗,再DP攻的。 #include <cstdio> #include <iostream> #include <cstring> #include <algorithm> #include <cmath> #define R(a,b,c) for(register int a = (b); (a) <= (c); ++(a)) #define nR(a,b,c) for(register int a = (b); (a) >= (c); --(a)) #define Fill(a,b) memset(a, b, sizeof(a)) #define Swap(a,b) ((a) ^= (b) ^= (a) ^= (b)) #define ll long long #define u32 unsigned int #define u64 unsigned long long #define ON_DEBUGG #ifdef ON_DEBUGG #define D_e_Line printf("\n----------\n") #define D_e(x) cout << (#x) << " : " << x << endl #define Pause() system("pause")

LuoguP1240 诸侯安置

眉间皱痕 提交于 2019-11-29 22:04:05
本来是来练组合的,不知怎么又开始水普及DP了 #include <cstdio> #include <iostream> #include <cstring> #include <algorithm> #include <cmath> #define R(a,b,c) for(register int a = (b); (a) <= (c); ++(a)) #define nR(a,b,c) for(register int a = (b); (a) >= (c); --(a)) #define Fill(a,b) memset(a, b, sizeof(a)) #define Max(a,b) ((a) > (b) ? (a) : (b)) #define Min(a,b) ((a) < (b) ? (a) : (b)) #define Swap(a,b) ((a) ^= (b) ^= (a) ^= (b)) #define ll long long #define u32 unsigned int #define u64 unsigned long long #define ON_DEBUGG #ifdef ON_DEBUGG #define D_e_Line printf("\n----------\n") #define D_e(x) cout << (#x) << " :