摘要: 模拟队列 #include <cstring> #include <iostream> #include <algorithm> using namespace std; const int N = 100010; int n, m; int h[N], e[N], ne[N], idx;//邻接表 阅读全文
posted @ 2019-11-10 21:37 晴屿 阅读(237) 评论(0) 推荐(1)
摘要: 队列 #include <cstdio> #include <cstring> #include <iostream> #include <algorithm> #include <queue> using namespace std; const int N = 100010; int n, m; 阅读全文
posted @ 2019-11-10 21:36 晴屿 阅读(178) 评论(0) 推荐(0)
摘要: #include <cstdio> #include <cstring> #include <iostream> #include <algorithm> using namespace std; const int N = 100010, M = N * 2; int n; int h[N], e 阅读全文
posted @ 2019-11-10 21:35 晴屿 阅读(192) 评论(0) 推荐(0)
摘要: Ujan has been lazy lately, but now has decided to bring his yard to good shape. First, he decided to paint the path from his house to the gate. The pa 阅读全文
posted @ 2019-11-10 11:26 晴屿 阅读(250) 评论(0) 推荐(0)
摘要: This problem is different from the easy version. In this version Ujan makes at most 2n2n swaps. In addition, k≤1000,n≤50k≤1000,n≤50 and it is necessar 阅读全文
posted @ 2019-11-10 11:25 晴屿 阅读(146) 评论(0) 推荐(0)
摘要: This problem is different from the hard version. In this version Ujan makes exactly one exchange. You can hack this problem only if you solve both pro 阅读全文
posted @ 2019-11-10 11:24 晴屿 阅读(255) 评论(0) 推荐(0)
摘要: Ujan decided to make a new wooden roof for the house. He has nn rectangular planks numbered from 11 to nn. The ii-th plank has size ai×1ai×1 (that is, 阅读全文
posted @ 2019-11-10 11:24 晴屿 阅读(186) 评论(0) 推荐(0)
摘要: vector, 变长数组,倍增的思想 size() 返回元素个数 empty() 返回是否为空 clear() 清空 front()/back() push_back()/pop_back() begin()/end() [] 支持比较运算,按字典序 pair<int, int> first, 第一 阅读全文
posted @ 2019-11-10 01:08 晴屿 阅读(222) 评论(0) 推荐(1)
摘要: //快速判断两次字符串是不是相等 #include<bits/stdc++.h> using namespace std ; typedef unsigned long long ULL; const int N=100010,P=131;//经验值 13331 这两个出错情况最少 int n,m; 阅读全文
posted @ 2019-11-10 01:03 晴屿 阅读(193) 评论(0) 推荐(0)
摘要: 拉链法 #include<cstring> #include<iostream> using namespace std ; const int N=100003; int h[N],e[N],ne[N],idx; void insert(int x) { int k=(x%N+N)%N;//哈希函 阅读全文
posted @ 2019-11-10 01:01 晴屿 阅读(169) 评论(0) 推荐(0)