跳到正文

_Ater_

547595

但愿绝望和无奈远走高飞

2026年11月29日抓取时,洛谷已只让登录用户或作者本人查看这个页面。下面是本站之前保存的内容。

在洛谷打开
资料、奖项与版本

资料

编号
547595
抓取

版本

抓取失败
洛谷只让登录用户或作者查看
  1. v1当前

大事祭:

第一道绿题祭 P1439 最长公共子序列

AC100祭 P1443 马的遍历

初赛rp++

有点用?

去学分块 去学扩欧 去学数学 去学Trajan 去学二分图 去学图论

目标:

高一加油打出提高组省一!

一些板子:

fast read()

C++
inline int read(){
	int x=0,f=1;char ch=getchar();
	while (ch<'0'||ch>'9'){if (ch=='-') f=-1;ch=getchar();}
	while (ch>='0'&&ch<='9'){x=x*10+ch-48;ch=getchar();}
	return x*f;
}

邻接表建图:

C++
priority_queue<node>q;
struct edge_ {
	int to,next,w;
} edge[maxn];
int cnt;
inline void add_edge(int u,int v,int w) {
	
	edge[++cnt].to=v;
	edge[cnt].w=w;
	edge[cnt].next=head[u];
	head[u]=cnt;
}

重载运载符

C++
struct node{
	int res,id;
};
bool operator < (node a,node b) {
	return a.res>b.res;
};

cin /cout 优化

C++
ios::sync_with_stdio(false);
cin.tie(0),cout.tie(0);

离散化

C++
for(int i=1;i<=n;i++){cin>>a[i];b[i]=a[i];} 
sort(b+1,b+n+1);
int len=unique(b+1,b+n+1)-b-1;
for(int i=1;i<=n;i++) a[i]=lower_bound(b+1,b+len+1,a[i])-b;

还没有收录这位用户的文章。