题意:

思路:构造方式见代码……

 #include<cstdio>
#include<cstring>
#include<iostream>
#include<algorithm>
typedef long long ll;
using namespace std;
#define N 110
#define oo 10000000
#define MOD 1000000007 int a[N],b[N]; int main()
{
int n,m;
scanf("%d%d",&n,&m);
int s1=,s2=;
for(int i=;i<=n;i++)
{
scanf("%d",&a[i]);
s1^=a[i];
}
for(int i=;i<=m;i++)
{
scanf("%d",&b[i]);
s2^=b[i];
}
if(s1!=s2)
{
printf("NO\n");
return ;
}
printf("YES\n");
for(int i=;i<=n;i++)
{
for(int j=;j<=m;j++)
{
if(i==&&j==){printf("%d ",s1^a[]^b[]); continue;}
if(i==){printf("%d ",b[j]); continue;}
if(j==){printf("%d ",a[i]); continue;}
printf("0 ");
}
printf("\n");
}
return ;
}

【CF1016D】Vasya And The Matrix(构造)的更多相关文章

  1. Educational Codeforces Round 48 (Rated for Div. 2) D 1016D Vasya And The Matrix (构造)

    D. Vasya And The Matrix time limit per test 2 seconds memory limit per test 256 megabytes input stan ...

  2. CF1016D Vasya And The Matrix

    题目描述 我们有一个 n * m 的矩阵,现在我会告诉你每一行和每一列的异或和请求出任意一种可能的矩阵 数据范围 1<=n,m<=100输入数据确保在int范围内 输入输出格式: 输入格式 ...

  3. codeforces1016 D. Vasya And The Matrix(思维+神奇构造)

    D. Vasya And The Matrix time limit per test 2 seconds memory limit per test 256 megabytes input stan ...

  4. Vasya And The Matrix CodeForces - 1016D (思维+构造)

    Now Vasya is taking an exam in mathematics. In order to get a good mark, Vasya needs to guess the ma ...

  5. D. Vasya And The Matrix(Educational Codeforces Round 48)

    D. Vasya And The Matrix time limit per test2 seconds memory limit per test256 megabytes inputstandar ...

  6. CF 1042 E. Vasya and Magic Matrix

    E. Vasya and Magic Matrix http://codeforces.com/contest/1042/problem/E 题意: 一个n*m的矩阵,每个位置有一个元素,给定一个起点 ...

  7. hdu 5015 233 Matrix(构造矩阵)

    http://acm.hdu.edu.cn/showproblem.php?pid=5015 由于是个二维的递推式,当时没有想到能够这样构造矩阵.从列上看,当前这一列都是由前一列递推得到.依据这一点来 ...

  8. AGC027 D - Modulo Matrix 构造

    目录 题目链接 题解 代码 题目链接 AGC027 D - Modulo Matrix 题解 从第左上角第一个点开始染色,相邻不同色,染法唯一 那么一个点的四周与他不同色,我们另这个点比四周都大,那么 ...

  9. AtCoder Grand Contest 027 (AGC017) D - Modulo Matrix 构造

    原文链接https://www.cnblogs.com/zhouzhendong/p/AGC027C.html 题解 首先我们假装 max mod min = 1 然后对着这个构造. 将各自黑白染色, ...

随机推荐

  1. 【思维题 最大权闭合子图】loj#6045. 「雅礼集训 2017 Day8」价

    又是经典模型的好题目 题目描述 人类智慧之神 zhangzj 最近有点胖,所以要减肥,他买了 NN 种减肥药,发现每种减肥药使用了若干种药材,总共正好有 NN 种不同的药材. 经过他的人脑实验,他发现 ...

  2. 使用Navicat连接阿里云ECS服务器上的MySQL数据库

    一.首先要mysql授权 mysql>GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY '你的mysql数据库密码' WITH GR ...

  3. Python 正则表达式 匹配次数

    管道可以匹配多个正则表达式中的一个 >>> >>> m=re.search(r'Batman|Tina Fey','Batman and Tina Fey')> ...

  4. jquery 省市区联动插件

    使用方式: <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF ...

  5. 读书笔记-JavaScript面向对象编程(二)

    第5章 原型 5.1 原型属性(所有函数拥有一个prototype属性,默认为空对象) 5.1.1 利用原型添加方法和属性 function Gadget(name,color){ this.name ...

  6. bootmem API总结

    bootmem_init()函数执行完成后,linux启动初期的bootmem分配器就初始化完成了,可以调用bootmem提供的API分配内存. 这些API在include/linux/bootmem ...

  7. A * B Problem Plus HDU - 1402 (FFT)

    A * B Problem Plus HDU - 1402 (FFT) Calculate A * B.  InputEach line will contain two integers A and ...

  8. Codeforces Round #462 (Div. 2) A Compatible Pair

    A. A Compatible Pair time limit per test1 second memory limit per test256 megabytes Problem Descript ...

  9. 怎么把myeclipse项目导入IDEA中

    先把myeclipse下的项目拷贝到IDEA的部署目录中,把一些不用的配置文件删除,只留下一个干净的项目 打开IDEA,点击import Project,引入一个项目,选择IDEA部署目录下刚拷贝过去 ...

  10. 11,scrapy框架持久化存储

    今日总结 基于终端指令的持久化存储 基于管道的持久化存储 今日详情 1.基于终端指令的持久化存储 保证爬虫文件的parse方法中有可迭代类型对象(通常为列表or字典)的返回,该返回值可以通过终端指令的 ...