摘要: P1407 [国家集训队]稳定婚姻 题目背景 原《工资》重题请做2397 题目描述 我国的离婚率连续7年上升,今年的头两季,平均每天有近5000对夫妇离婚,大城市的离婚率上升最快,有研究婚姻问题的专家认为,是与简化离婚手续有关。 25岁的姗姗和男友谈恋爱半年就结婚,结婚不到两个月就离婚,是典型的“闪 阅读全文
posted @ 2020-06-30 20:44 LightyaChoo 阅读(104) 评论(0) 推荐(0) 编辑
摘要: T1浇水: 题目描述 在一条长n米,宽m米米的长方形草地上放置着k个喷水装置。假设长方形草地的坐标范围为[ 0 , 0 ] ~ [ n , m ],那么第 i 个喷水装置的位置为(ai,m/2),也就是说喷水装置全部位于一条直线上。此外第 i 个喷水装置能向半径ri的圆形区域内喷水。 负责管理喷水装 阅读全文
posted @ 2020-06-30 20:30 LightyaChoo 阅读(199) 评论(2) 推荐(0) 编辑
摘要: P3387 【模板】缩点 #include<bits/stdc++.h> using namespace std; const int N=1e5+10; int head[N],headg[N],dfn[N],low[N],belong[N]; int sta[N],top; int cnt,to 阅读全文
posted @ 2020-06-29 21:11 LightyaChoo 阅读(134) 评论(0) 推荐(0) 编辑
摘要: P3378 【模板】堆 #include<bits/stdc++.h> using namespace std; priority_queue<int,vector<int>,greater<int> >q;//小根堆 int n; int op; int x; int main(){ scanf( 阅读全文
posted @ 2020-06-29 18:01 LightyaChoo 阅读(122) 评论(0) 推荐(0) 编辑
摘要: P1168 中位数 题目描述 给出一个长度为N的非负整数序列A[i],对于所有1 ≤ k ≤ (N + 1) / 2,输出A1, A1~A3, …, A1~A2K-1的中位数。即前1,3,5,……个数的中位数。 输入输出格式 输入格式: 第1行为一个正整数N,表示了序列长度。 第2行包含N个非负整数 阅读全文
posted @ 2020-06-29 18:00 LightyaChoo 阅读(191) 评论(0) 推荐(0) 编辑
摘要: P3368 【模板】树状数组 2 #include<bits/stdc++.h> using namespace std; const int N=5e5+10; int a[N]; int c[N<<2]; int n,m; int lowbit(int x){ return x&-x; } vo 阅读全文
posted @ 2020-06-28 20:00 LightyaChoo 阅读(132) 评论(0) 推荐(0) 编辑
摘要: P3374 【模板】树状数组 1 #include<bits/stdc++.h> using namespace std; const int N=5e5+10; int n,m; int a[N]; int c[N<<2]; int lowbit(int x){ return x&-x; } vo 阅读全文
posted @ 2020-06-28 19:59 LightyaChoo 阅读(120) 评论(0) 推荐(0) 编辑
摘要: P3367 【模板】并查集 #include<bits/stdc++.h> using namespace std; const int N=1e4+10; int a[N]; int n,m; int fa[N]; int find(int x){ if(fa[x]==x){ return x; 阅读全文
posted @ 2020-06-28 19:58 LightyaChoo 阅读(122) 评论(0) 推荐(0) 编辑
摘要: P3372 【模板】线段树 1 #include<bits/stdc++.h> using namespace std; typedef long long ll; const ll N=1e5+10; ll a[N]; struct Node{ ll it; ll l; ll r; ll data 阅读全文
posted @ 2020-06-28 19:56 LightyaChoo 阅读(131) 评论(0) 推荐(0) 编辑
摘要: 题目描述 一个 矩阵由 行 列共 个数排列而成。两个矩阵 和 可以相乘当且仅当 的列数等于 的行数。一个 的矩阵乘以一个 的矩阵等于一个 的矩阵,运算量为 。 矩阵乘法满足结合律, 可以表示成 或者是 ,两者的运算量却不同。例如当 时, 而 。显然第一种顺序节省运算量。 现在给出 个矩阵,并输入 个 阅读全文
posted @ 2020-06-23 16:55 LightyaChoo 阅读(153) 评论(0) 推荐(0) 编辑