当前位置:网站首页>F. Jinyu and its outer matrix (construction)
F. Jinyu and its outer matrix (construction)
2022-08-04 14:14:00 【Harris-H】
F.The outer matrix of gold and jade(构造)
The impossible case is that the matrix lengths are divisible separately,显然与2矛盾.
否则有解,Consider putting negative numbers in the upper right corner of each submatrix,then and for-1.There must be more lines in the end,Just a positive number.
selected base m x mx mx要大于 n h × m w \dfrac{n}{h}\times \dfrac{m}{w} hn×wm,The final sum is guaranteed to be positive.
#include<bits/stdc++.h>
using namespace std;
long long n,m,h,w;
int main()
{
cin>>n>>m>>h>>w;
if(n%h==0&&m%w==0)
{
puts("N");
return 0;
}
int mx = (n/h)*(m/w)+1;
puts("Y");
for(int i=1;i<=n;i++)
{
for(int j=1;j<=m;j++)
{
if(i%h==0&&j%w==0)
{
printf("%d ",-mx*w*h+(mx-1));
}
else printf("%d ",mx);
}
printf("\n");
}
}
边栏推荐
猜你喜欢
【LeetCode】38、外观数列
开放麒麟 openKylin 版本规划敲定:10 月发布 0.9 版并开启公测,12 月发布 1.0 版
Lixia Action | Kyushu Yunzhang Jinnan: Open source is not a movement for a few people, popularization is the source
State security organs conduct criminal arrest and summons review on Yang Zhiyuan, a suspect suspected of endangering national security
【毕设选题推荐】机器人工程专业毕设选题推荐
Is there a replacement for the LM2596?LM2576 can
人像分割技术解析与应用
量化细胞内的信息流:机器学习时代下的研究进展
c#之winform(软件开发)
零基础可以转行软件测试吗 ?这篇文章告诉你
随机推荐
开放麒麟 openKylin 版本规划敲定:10 月发布 0.9 版并开启公测,12 月发布 1.0 版
Set partition minimum difference problem (01 knapsack)
砺夏行动|九州云章津楠:开源不是少数人的运动,大众化才是源泉
七夕当然要学会SQL优化好早点下班去找对象
第六届未来网络发展大会,即将开幕!
SLAM 05.视觉里程计-2-特征法
LCP 06. 拿硬币-遍历
橄榄枝大课堂APP正式启动上线
【硬件架构的艺术】学习笔记(1)亚稳态的世界
FreeConfig.h文件
相似文本聚类与调参
小 P 周刊 Vol.13
谁说 Mysql 单表最大 2000 W ?我硬要塞它 1 个亿
metaRTC5.0新版本支持mbedtls(PolarSSL)
爬虫——selenium基本使用、无界面浏览器、selenium的其他用法、selenium的cookie、爬虫案例
Map common traversal methods - keySet and entrySet
Kyushu Cloud attended the Navigator Online Forum to discuss the current status, challenges and future of 5G MEC edge computing
【模型部署与业务落地】基于量化芯片的损失分析
How to install postgresql and configure remote access in ubuntu environment
按键控制开关4017芯片数字电路