CE,
  • 板块灌水区
  • 楼主Nostopathy
  • 当前回复0
  • 已保存回复0
  • 发布时间2024/4/19 20:20
  • 上次更新2024/4/19 20:21:35
查看原帖
CE,
1286053
Nostopathy楼主2024/4/19 20:20
#include<bits/stdc++.h>
using namespace std;
struct inf1{
	int x,y;
};
struct inf2{
	int h,c;
};
map<inf1,inf2>s;
int main(){
	int n,m,k;
	cin>>n>>m>>k;
	for(int i=1;i<=k;++i){
		inf1 a;
		cin>>a.x>>a.y;
		inf2 b;
		cin>>b.h>>b.c;
		if(s.find(a)!=s.end())if(s[a].h>b.h)s[a].h=b.h,s[a].c=b.c;
		else s[a]=b;
	}
	for(int i=1;i<=n;++i){
		for(int j=1;j<=m;++j){
			inf1 p;
			p.x=i,p.y=j;
			if(s.find(p)==s.end())cout<<"0 ";
			else cout<<s[p].c<<' ';
		}
		putchar('\n');
	}
}

xiexie,QAQ.

2024/4/19 20:20
加载中...