【CF1016D】Vasya And The Matrix(构造)
题意:

思路:构造方式见代码……
#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(构造)的更多相关文章
- 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 ...
- CF1016D Vasya And The Matrix
题目描述 我们有一个 n * m 的矩阵,现在我会告诉你每一行和每一列的异或和请求出任意一种可能的矩阵 数据范围 1<=n,m<=100输入数据确保在int范围内 输入输出格式: 输入格式 ...
- 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 ...
- 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 ...
- 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 ...
- CF 1042 E. Vasya and Magic Matrix
E. Vasya and Magic Matrix http://codeforces.com/contest/1042/problem/E 题意: 一个n*m的矩阵,每个位置有一个元素,给定一个起点 ...
- hdu 5015 233 Matrix(构造矩阵)
http://acm.hdu.edu.cn/showproblem.php?pid=5015 由于是个二维的递推式,当时没有想到能够这样构造矩阵.从列上看,当前这一列都是由前一列递推得到.依据这一点来 ...
- AGC027 D - Modulo Matrix 构造
目录 题目链接 题解 代码 题目链接 AGC027 D - Modulo Matrix 题解 从第左上角第一个点开始染色,相邻不同色,染法唯一 那么一个点的四周与他不同色,我们另这个点比四周都大,那么 ...
- AtCoder Grand Contest 027 (AGC017) D - Modulo Matrix 构造
原文链接https://www.cnblogs.com/zhouzhendong/p/AGC027C.html 题解 首先我们假装 max mod min = 1 然后对着这个构造. 将各自黑白染色, ...
随机推荐
- JQuery模拟点击页面上的所有a标签,触发onclick事件
注意: 这种方法需要给所有的a标签加上id属性 页面加载完成模拟点击所有的a标签: <script> $(function () { // 模拟点击页面上的所有a标签,触发onclick事 ...
- 汇编 if else 例子
.text .global _start _start: mov r1,#1 mov r2,#2 cmp r1, r2 bgt branch1 add r3,r1,r2 b end branc ...
- HTML5/CSS3 第三章页面布局
页面布局 1 页面组成 2 布局相关的标签 <div></div> 定义文档中的分区或节 <span></span> 这是一个行内元素,没有任何意义 & ...
- JS的四舍五入问题
最近踩了一个坑,mark一下toFixed四舍五入问题,详见代码: var myFixed = function(num, fix) { num = (parseFloat(num) * + ) / ...
- Django2.1集成xadmin管理后台所遇到的错误集锦,解决填坑
django默认是有一个admin的后台管理模块,但是丑,功能也不齐全,但是大神给我们已经集成好了xadmin后台,我们拿来用即可,但是呢,django已经升级到2.1版本了,xadmin貌似跟不上节 ...
- vba中ListBox控件的使用
给ListBox添加内容 If CheckBox8 = True Then---------------------------checkbox控件被选中 For i = 0 To ListBox1. ...
- D3DXCreateTextureFromFile
HRESULT D3DXCreateTextureFromFile( __in LPDIRECT3DDEVICE9 pDevice, __in LPCTSTR pSrcFile, __out LPDI ...
- python并发编程相关概念总结
1.简述计算机操作系统中的“中断”的作用? 中断是指在计算机执行期间,系统内发生任何非寻常的或非预期的急需处理事件,使得CPU暂时中断当前正在执行的程序而转去执行相应的时间处理程序.待处理完毕后又返回 ...
- C#开发微信公众平台教程
http://www.cnblogs.com/xishuai/p/3625859.html http://www.cnblogs.com/wuhuacong/p/3614175.html http:/ ...
- Windows API 学习记录1
这里面的好多函数不能死记硬背,知道有这个函数就行,等用到了,再回来细看 一.窗口管理函数包括以下几类: 按钮函数(Button) Microsoft提供了对话框和控制来支持应用程序与用户之间的交互通讯 ...