#include<bits/stdc++.h>
using namespace std;
long long n,m,k;
struct Node{
long long x,y,h,px;
}a[1001];
struct node{
long long h1,xp;
}c[1001][1001];
signed main(){
cin>>n>>m>>k;
for(int i=1;i<=n;i++){
for(int j=1;j<=m;j++){
c[i][j].h1=INT_MAX;
}
}
for(int i=1;i<=k;i++){
cin>>a[i].x>>a[i].y>>a[i].h>>a[i].px;
if(a[i].x < 0||a[i].x > n || a[i].y > m || a[i].y<0)continue;
if(c[a[i].x][a[i].y].h1 > a[i].h){
c[a[i].x][a[i].y].h1=a[i].h;
c[a[i].x][a[i].y].xp=a[i].px;
}
}
for(int i=1;i<=n;i++){
for(int j=1;j<=m;j++){
cout<<c[i][j].xp<<' ';
}
cout<<'\n';
}
return 0;
}
UKE 就是 RE。
subtask 1:AC 1
subtask 2:AC3 其余全部 UKE