当前位置:网站首页>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");
}
}
边栏推荐
- C# 复制列表
- 考研上岸又转行软件测试,从5k到13k完美逆袭,杭州校区小哥哥拒绝平庸终圆梦!
- Crawler - basic use of selenium, no interface browser, other uses of selenium, cookies of selenium, crawler cases
- ICML 2022 | 图神经网络的局部增强
- Redis 复习计划 - Redis主从数据一致性和哨兵机制
- BZOJ 1798 维护序列 (多校连萌,对线段树进行加乘混合操作)
- (记录)异步并发,多线程处理表的统计
- 九州云出席领航者线上论坛,共话5G MEC边缘计算现状、挑战和未来
- 2042. 检查句子中的数字是否递增-力扣双百代码-设置前置数据
- 第四讲 SVN
猜你喜欢

相似文本聚类与调参

电子行业MES管理系统有哪些特殊功能

Redis 复习计划 - Redis主从数据一致性和哨兵机制

State security organs conduct criminal arrest and summons review on Yang Zhiyuan, a suspect suspected of endangering national security

开放麒麟 openKylin 版本规划敲定:10 月发布 0.9 版并开启公测,12 月发布 1.0 版

【模型部署与业务落地】基于量化芯片的损失分析

企业应当实施的5个云安全管理策略

考研上岸又转行软件测试,从5k到13k完美逆袭,杭州校区小哥哥拒绝平庸终圆梦!

卷积神经网络 基础

【硬件架构的艺术】学习笔记(1)亚稳态的世界
随机推荐
【HMS core】【Media】【视频编辑服务】 在线素材无法展示,一直Loading状态或是网络异常
Set partition minimum difference problem (01 knapsack)
B.构造一个简单的数列(贪心)
token 过期后,如何自动续期?
ssm学习心得(完结篇
错误 AttributeError type object 'Callable' has no attribute '_abc_registry' 解决方案
CCF GLCC正式开营|九州云开源专家携丰厚奖金,助力高校开源推广
并发刺客(False Sharing)——并发程序的隐藏杀手
解题-->在线OJ(十八)
数据库恢复
Oracle RAC环境下vip/public/private IP的区别
CF1527D MEX Tree(mex&树&容斥)
Keycloak 6.0.0 正式发布,身份和访问管理系统
橄榄枝大课堂APP正式启动上线
自监督学习未来是掩码自编码器?KAIST最新《自监督学习掩码自编码器》研究进展
干掉visio,这个画图神器真的绝了
【LeetCode】38、外观数列
ACL 2022 | 社会科学理论驱动的言论建模
State security organs conduct criminal arrest and summons review on Yang Zhiyuan, a suspect suspected of endangering national security
MySQL【窗口函数】【共用表表达式】