摘要: 1. 排一次序后就可以得到答案 2. 排一次序只能得到这次的最优选择,需要多次排序,得到全部的最优答案 阅读全文
posted @ 2019-09-21 13:05 cabbage-leaf 阅读(89) 评论(0) 推荐(0) 编辑
摘要: "题目描述" 思路 代码 c++ include int n, ans, pre; bool rec[1000006]; struct Node { int a, b; } arr[1000006], tmp; void qsort(int L, int R) { int l = L, r = R; 阅读全文
posted @ 2019-09-21 12:56 cabbage-leaf 阅读(151) 评论(0) 推荐(0) 编辑
摘要: "题目描述" 思路 代码 c++ include int n, ans, pre; struct Node { int a, b; } arr[1000006], tmp; inline int read() { int s = 0, f = 1; char ch = getchar(); whil 阅读全文
posted @ 2019-09-21 11:00 cabbage-leaf 阅读(130) 评论(0) 推荐(0) 编辑
摘要: "题目描述" 思路 代码 c++ include include include using namespace std; int n, arr[50005], save[50005]; int tmp[50005]; long long maxx, minn; const int inf = 0x 阅读全文
posted @ 2019-09-21 10:10 cabbage-leaf 阅读(247) 评论(0) 推荐(0) 编辑
摘要: 1. 变量名和等号之间不能有空格 2. 单引号字符串里面的变量不会解析 3. 双引号字符串里面的变量会解析 阅读全文
posted @ 2019-09-20 18:27 cabbage-leaf 阅读(137) 评论(0) 推荐(0) 编辑
摘要: "题目描述" 思路 代码 阅读全文
posted @ 2019-09-20 16:28 cabbage-leaf 阅读(115) 评论(0) 推荐(0) 编辑
摘要: "题目描述" 思路 代码 c++ include int n, na, nb, ans; struct Node { int a, b, c; } aa[1005], bb[1005], tmp; inline int read() { int s = 0, f = 1; char ch = get 阅读全文
posted @ 2019-09-20 16:02 cabbage-leaf 阅读(133) 评论(0) 推荐(0) 编辑
摘要: "题目描述" 思路 代码 阅读全文
posted @ 2019-09-20 14:37 cabbage-leaf 阅读(114) 评论(0) 推荐(0) 编辑
摘要: "题目描述" 思路 代码 阅读全文
posted @ 2019-09-20 11:17 cabbage-leaf 阅读(117) 评论(0) 推荐(0) 编辑
摘要: "题目描述" 思路 代码 c++ include include struct Node { int a, b; } arr[1005], tmp; int ans, pre, n; inline int read() { int s = 0, f = 1; char ch = getchar(); 阅读全文
posted @ 2019-09-20 10:43 cabbage-leaf 阅读(149) 评论(0) 推荐(0) 编辑