摘要: 很直观的一个gauss题;用的是以前用过的一个模板;#include#include#include#include#define maxn 12#define eps 0.00001using namespace std;double matrix[15][15];double ans[15];void exchange_col(int p1,int p2,int n){ double t; int i; for(int i=0; ifabs(matrix[p][i])) p=j; if(p!=i) exch... 阅读全文
posted @ 2013-12-04 21:27 Yours1103 阅读(215) 评论(0) 推荐(0) 编辑
摘要: 先对a排序,a相等的话就对b排序;维护一个栈,每次取栈的头两个,和当前的直线相比较;如果当前的直线把头第一个屏蔽,就将他出栈,一直到不能屏蔽为止;代码:#include#include#include#define maxn 500005using namespace std;int st[maxn],top;int num[maxn];struct line{ int a,b; int id; bool operatort.b; else return a1) { if(check(i,st[top-1],st[top-2]... 阅读全文
posted @ 2013-12-04 18:50 Yours1103 阅读(169) 评论(0) 推荐(0) 编辑
摘要: 图上的最小的染色方案;学习了陈丹绮的论文: MCS算法#include#define maxn 10005#define maxm 2000005using namespace std;int head[maxn],next[maxm],edge[maxm];int cnt;int d[maxn],f[maxn];void add(int a,int b){ edge[++cnt]=b; next[cnt]=head[a]; head[a]=cnt;}int main(){ int n,m,x,y; scanf("%d%d",&n,&m); while(m- 阅读全文
posted @ 2013-12-04 17:05 Yours1103 阅读(163) 评论(0) 推荐(0) 编辑