跳到正文

Memory_Lin

705081

我们笑着说再见,却深知再见已是遥遥无期

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

资料

编号
705081
抓取

·我想和你爬上屋顶

·看佛罗伦萨的白鸽如何稀释但丁

·看宇宙被折成凝冻的星星

·看每一颗尘埃一样的魂灵

·你会听见我的心跳吗

·那是德彪西的月光

·你会吻我的眼睛吗

·那是被青藏高原深埋的海洋

·当太阳从地平线上升起

·昼夜再这里交替

·我们坐在晨昏线上,平分世界


初三OIer,OI小白,两年没有比赛的FJ怨种

歌单强推!!!纯音!!!入!!

(转载)宝藏-星空下的孤独守望者

###自建歌单,持续更新ing

大事祭(、、少(比)得(纸)可(还)怜(白)¥@……&*%¥%)

2022.09.15 绿名祭

2022.09.18第一次CSP含泪没过S

2022.10.04 100AC祭

2022.10.19 第一篇题解P8586但是没过(哭哭

2022.10.28 含泪取消J组

2022.11.06 150AC祭

2022.01.23 橙名祭

2022.01.23 200AC祭(P1219)

NOI大纲

C++
#include<bits/stdc++.h>//链式前向星O(n+m) 
using namespace std;
const int N=1e5+10;
const int M=1e7+10;
int n,m,x,y,w;
int head[N],ver[M],ed[M],ne[M],tot;
void add(int x,int y,int w){//建边函数 
	tot++;
	ver[tot]=y;//编号为tot边出去的结点为y
	ed[tot]=w;//边权为w 
	ne[tot]=head[x];head[x]=tot;//在头插入边 
}
int main(){
	scanf("%d%d",&n,&m);//n个点,m条边
	memset(head,-1,sizeof(head));
	for(int i=1;i<=m;i++){
		scanf("%d%d%d",&x,&y,&w);//x→y  w
		add(x,y,w); 
		//add(y,x,w);//无向图 ,与m有关的数组开两倍 
	}
	for(int i=1;i<=n;i++){
		for(int j=head[i];j!=-1;j=ne[j]){
			int y=ver[j];
			int w=ed[j];
			cout<<"点"<<i<<"到点"<<y<<"有一条边权为"<<w<<"的边"<<endl; 
		}
	} 
	return 0;
}
C++
#include<bits/stdc++.h>
using namespace std;
struct node
{
	int x,y,z;
	bool operator <(const node &a)const//重载大根堆运算符 
	{
		return x>a.x;
	}
};
priority_queue<node > q;//大根堆
int n,x,y,z; 
int main()
{
	scanf("%d",&n);
	for(int i=1;i<=n;i++)
	{
		scanf("%d%d%d",&x,&y,&z);
		q.push({x,y,z});
	}
	while(!q.empty())
	{
		printf("%d %d %d\n",q.top().x,q.top().y,q.top().z);
		q.pop();
	}
	return 0;
} 

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