![](https://img-blog.csdnimg.cn/20201014180756919.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
算法竞赛入门经典(训练指南)----实用数据结构
wang2147483647
这个作者很懒,什么都没留下…
展开
-
UVA 11991(p187)----Easy Problem from Rujia Liu?
#include #define debu using namespace std; int n,m; map > a; int main() { #ifdef debug freopen("in.in","r",stdin); #endif // debug while(scanf("%d%d",&n,&m)!=EOF) { for(int i=0; i<原创 2016-03-02 17:09:13 · 312 阅读 · 0 评论 -
LA 3135(p188)----Argus
#include #define debu using namespace std; const int maxn=1010; char st[10]; struct point { int id,t; point(int a=0,int b=0):id(a),t(b){} }; point b[maxn]; vector a; int cmp(point a,point b) {原创 2016-03-02 17:13:58 · 392 阅读 · 0 评论 -
LA 3644(p191)----X-Plosives
#include #define debu using namespace std; const int maxn=1e5+50; int ans; int fa[maxn],Rank[maxn]; int Find(int root) { int k,j,x; x=root; while(x!=fa[x]) x=fa[x]; k=root; while(k原创 2016-03-02 17:16:43 · 313 阅读 · 0 评论 -
UVA 11995(p186)----I Can Guess the Data Structure!
#include #define debu using namespace std; int n,flag[3]; stack s; queue q; priority_queue,less >pq; void enter(int x) { s.push(x); q.push(x); pq.push(x); } int output(int i) { int tmp原创 2016-03-02 21:42:02 · 270 阅读 · 0 评论 -
LA 3027(p192)----Corporative Network
#include #define debu using namespace std; const int maxn=2*1e4+50; int fa[maxn],ans[maxn],n; int Find(int x) { if(x!=fa[x]) { int root=Find(fa[x]); ans[x]+=ans[fa[x]];原创 2016-03-04 14:13:44 · 267 阅读 · 0 评论 -
LA 4329(p197)----Ping pong
#include #define debu using namespace std; typedef long long LL; const int maxn=2*1e4+50; const int maxnn=1e5+50; int a[maxn]; int n,l[maxn],maxx; int c[maxnn],r[maxn]; inline int lowbit(int x) {原创 2016-03-04 17:14:49 · 226 阅读 · 0 评论 -
UVA 11136(p245)----Hoax or what
#include #define debu using namespace std; int n; multiset s; int main() { #ifdef debug freopen("in.in","r",stdin); #endif // debug while(scanf("%d",&n)==1&&n) { s.clear();原创 2016-03-10 21:57:25 · 305 阅读 · 0 评论 -
LA 2191(p247)----Potentiometers
#include #define debu using namespace std; typedef long long LL; const int maxn=1e6+50; int n,cas=0; char cmd[4]; LL c[maxn]; LL a[maxn]; inline int lowbit(int x) { return x&(-x); } void add(int x原创 2016-03-10 22:02:37 · 628 阅读 · 0 评论