1 solutions
-
1
#include<bits/stdc++.h> using namespace std; struct s{ int c,time; };s h[100005],l[100005]; int main(){ int t; cin>>t; while(t--){ memset(h,0,sizeof(h)); memset(l,0,sizeof(l)); int n,m,q; cin>>n>>m>>q; for(int i=1;i<=q;i++){ int o,x,cc; cin>>o>>x>>cc; if(o==0){ h[x].c=cc; h[x].time=i; }else{ l[x].c=cc; l[x].time=i; } } for(int i=1;i<=n;i++){ for(int j=1;j<=m;j++){ if(h[i].time>l[j].time){ cout<<h[i].c<<" "; }else{ cout<<l[j].c<<" "; } } cout<<endl; }
}
return 0;
}
- 1
Information
- ID
- 395
- Time
- 1000ms
- Memory
- 256MiB
- Difficulty
- 6
- Tags
- (None)
- # Submissions
- 28
- Accepted
- 11
- Uploaded By