codeforces 631B Print Check
来源:互联网 发布:ip下载软件 编辑:程序博客网 时间:2024/06/05 10:04
题目大意:给你一个n*m的矩阵,k次操作,1操作是把每一行变成相应的数字,2操作变列
模拟一下,对每一行每一列进行标记
#include<iostream>#include<cstdio>using namespace std;pair<int,int> row[5010];pair<int,int> column[5010];int main(){//freopen("in.txt","r",stdin);int n,m,k;scanf("%d%d%d",&n,&m,&k);for(int test=1;test<=k;test++){int op,x,col;scanf("%d%d%d",&op,&x,&col);if(op==1){row[x].first=col;row[x].second=test;}else{column[x].first=col;column[x].second=test;}}for(int i=1;i<=n;i++){for(int j=1;j<=m;j++){if(row[i].second>column[j].second) printf("%d",row[i].first);else printf("%d",column[j].first);if(j==m) putchar('\n');else putchar(' ');}}}
阅读全文
0 0
- codeforces 631B Print Check
- codeforces 631B Print Check
- CodeForces 631B Print Check
- codeforces 631B Print Check
- Codeforces 631B Print Check 【思维】
- Codeforces 631B Print Check【模拟】
- Codeforces 631 B Print Check【思维】
- codeforces 631B Print Check模拟
- 【Codeforces 631 B Print Check 】+ 简单构造
- 基础题 CodeForces - 631B Print Check
- CodeForces 631 B.Print Check(水~)
- CodeForces 631B B. Print Check(水题水题)
- codeforces 344 B. Print Check解题报告
- Codeforces Round #344 (Div. 2) B. Print Check【思维】
- Codeforces Round #344 (Div. 2) B. Print Check
- Codeforces Round #344 (Div. 2) B. Print Check (模拟)
- Print Check CodeForces
- Codeforces Round #344 (Div. 2)-B. Print Check(贪心+模拟)
- react-native 解决 Can't find variable: __fbBatchedBridge
- NPN 、PNP 三极管开关形式的典型接法(注意上下拉电阻)
- java方法重载和重写的代码区别详解
- Linux99问,适合新手!
- tomcat的内存溢出(转载)
- codeforces 631B Print Check
- solr-4.10.2版本使用tomcat7部署
- oracle合并列的函数wm_concat
- Java一键启动Linux上的tomcat服务器
- Java集合
- Linux(CentOS)下设置开机自动启动和chkconfig管理(nginx为例)
- (亲测有效。)Spring MVC中,Controller中使用service只需使用注解,但是普通类获取 service或 dao 都是null空的。
- ubuntu 上安装 git并上传代码至github
- Qt多线程同步总结