上一页 1 ··· 9 10 11 12 13 14 15 下一页
摘要: 1 #include 2 using namespace std; 3 inline void read(int &tmp) 4 { 5 int x=1;char c=getchar(); 6 for(tmp=0;!isdigit(c);c=getchar()) if(c=='-') x=-1; 7 for(;isdigit(c);tmp=tmp*10+c-... 阅读全文
posted @ 2019-01-12 23:08 宇興 阅读(161) 评论(0) 推荐(0) 编辑
摘要: 1 #include 2 #include 3 #include 4 using namespace std; 5 struct data{ 6 int ID,Time_A,Time_B,rank; 7 inline data(int ID=0,int Time_A=0,int Time_B=0,int rank=0): 8 ID(ID),Time_A(T... 阅读全文
posted @ 2019-01-07 16:35 宇興 阅读(143) 评论(0) 推荐(0) 编辑
摘要: 1 /* 2 并查集(树实现) 3 路径压缩、按秩合并 4 使用前调用init() 5 find(x) 查找x的根节点(路径压缩) 6 Union(x,y) 启发式合并 7 */ 8 #include 9 using namespace std; 10 const int size=100005;//集合大小 11 int n,m;//n--元素个数 m--查询次数 1... 阅读全文
posted @ 2018-12-31 21:43 宇興 阅读(150) 评论(0) 推荐(0) 编辑
摘要: 1 #include 2 #include 3 #include 4 #include 5 using namespace std; 6 int n,h,f[100],d[100],t[100],ans,Time,nowt; 7 typedef pair P; 8 priority_queueq; 9 int main() 10 { 11 scanf("%d%d",&n... 阅读全文
posted @ 2018-12-29 22:43 宇興 阅读(130) 评论(0) 推荐(0) 编辑
摘要: 1 #include 2 #include 3 #include 4 using namespace std; 5 struct data{ int ID,val; data(int ID=0,int val=0):ID(ID),val(val){} }; 6 deque minn; 7 int n,k; 8 inline void read(int &tmp) 9 { 10 ... 阅读全文
posted @ 2018-12-29 00:41 宇興 阅读(92) 评论(0) 推荐(0) 编辑
摘要: 1 ////KMP模式匹配 2 ////a、b字符串下标均从1开始 3 #include 4 using namespace std; 5 const int maxn=1000005; 6 int lena,lenb; 7 char a[maxn],b[maxn]; 8 int Next[maxn];//注意这里为int 9 inline void init()//预... 阅读全文
posted @ 2018-12-29 00:22 宇興 阅读(134) 评论(0) 推荐(0) 编辑
摘要: 1 #include 2 #include 3 #include 4 #include 5 using namespace std; 6 inline void read(int &tmp) 7 { 8 int x=1;char c=getchar(); 9 for(tmp=0;!isdigit(c);c=getchar()) if(c=='-') x=-1; ... 阅读全文
posted @ 2018-12-25 23:51 宇興 阅读(115) 评论(0) 推荐(0) 编辑
摘要: 1 #include 2 using namespace std; 3 const int INF=0x3f3f3f3f; 4 int f[6][6],a[6][6],n; 5 int dx[]={0,-1,0,0,1}; 6 int dy[]={0,0,-1,1,0}; 7 inline void go(int x,int y) 8 { 9 for(int i=0;i... 阅读全文
posted @ 2018-12-23 10:30 宇興 阅读(301) 评论(0) 推荐(0) 编辑
摘要: 1 #include 2 #include 3 #include 4 #include 5 using namespace std; 6 typedef long long LL; 7 struct node{ 8 int id; 9 LL h; 10 LL e; 11 node(int id=0,LL h=0,LL e=0):id(id),h(... 阅读全文
posted @ 2018-12-22 23:35 宇興 阅读(109) 评论(0) 推荐(0) 编辑
摘要: 1 #include 2 #include 3 #include 4 #include 5 #include 6 using namespace std; 7 typedef long long LL; 8 typedef pair p;//存储相同身高的人的数目 防止出现多个相同身高的人 9 inline void read(LL &tmp) 10 { 11 in... 阅读全文
posted @ 2018-12-22 23:09 宇興 阅读(193) 评论(0) 推荐(0) 编辑
上一页 1 ··· 9 10 11 12 13 14 15 下一页