http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemCode=3212

题意:构造出一个n*m的有k个上下左右的和等于中间数的小矩阵的任意矩阵。

就是输出k个全是0的矩阵(符合条件),然后其他的矩阵用数字填掉

 #include<bits/stdc++.h>
using namespace std;
int main()
{
int T, n, m, k, i, j;
scanf("%d", &T);
while(T--) {
scanf("%d%d%d", &n, &m, &k);
k = (n-)*(m-) - k;//不符合条件的矩阵
for(i = ; i <= n; i++) {
printf("");
for(j = ; j <= m-; j++) {
if(k>)
printf(" %d", k--);
else
printf("");
}
printf(" 0\n");
}
}
return ;
}

The 6th Zhejiang Provincial Collegiate Programming Contest->ProblemK:K-Nice的更多相关文章

  1. The 6th Zhejiang Provincial Collegiate Programming Contest->Problem I:A Stack or A Queue?

    http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemCode=3210 题意:给出stack和queue的定义,一个是先进后出(FILO), ...

  2. zoj The 12th Zhejiang Provincial Collegiate Programming Contest Capture the Flag

    http://acm.zju.edu.cn/onlinejudge/showContestProblem.do?problemId=5503 The 12th Zhejiang Provincial ...

  3. zoj The 12th Zhejiang Provincial Collegiate Programming Contest Team Formation

    http://acm.zju.edu.cn/onlinejudge/showContestProblem.do?problemId=5494 The 12th Zhejiang Provincial ...

  4. zoj The 12th Zhejiang Provincial Collegiate Programming Contest Beauty of Array

    http://acm.zju.edu.cn/onlinejudge/showContestProblem.do?problemId=5496 The 12th Zhejiang Provincial ...

  5. zoj The 12th Zhejiang Provincial Collegiate Programming Contest Lunch Time

    http://acm.zju.edu.cn/onlinejudge/showContestProblem.do?problemId=5499 The 12th Zhejiang Provincial ...

  6. zoj The 12th Zhejiang Provincial Collegiate Programming Contest Convert QWERTY to Dvorak

    http://acm.zju.edu.cn/onlinejudge/showContestProblem.do?problemId=5502  The 12th Zhejiang Provincial ...

  7. zoj The 12th Zhejiang Provincial Collegiate Programming Contest May Day Holiday

    http://acm.zju.edu.cn/onlinejudge/showContestProblem.do?problemId=5500 The 12th Zhejiang Provincial ...

  8. zoj The 12th Zhejiang Provincial Collegiate Programming Contest Demacia of the Ancients

    http://acm.zju.edu.cn/onlinejudge/showContestProblem.do?problemId=5504  The 12th Zhejiang Provincial ...

  9. zjuoj The 12th Zhejiang Provincial Collegiate Programming Contest Ace of Aces

    http://acm.zju.edu.cn/onlinejudge/showContestProblem.do?problemId=5493 The 12th Zhejiang Provincial ...

  10. 140 - The 12th Zhejiang Provincial Collegiate Programming Contest(第二部分)

    Floor Function Time Limit: 10 Seconds      Memory Limit: 65536 KB a, b, c and d are all positive int ...

随机推荐

  1. 海量小文件存储与Ceph实践

    海量小文件存储(简称LOSF,lots of small files)出现后,就一直是业界的难题,众多博文(如[1])对此问题进行了阐述与分析,许多互联网公司也针对自己的具体场景研发了自己的存储方案( ...

  2. 对XML的操作

    对XML的操作主要使用到的语法示例: using System.Xml; private static string XmlMarketingStaff = AppDomain.CurrentDoma ...

  3. TM4C123GH6PM程序

    模式一&模式二:单次计时&周期计时/******************************************* 开发坏境:CCSv5.4 开发板:TIVA C Launch ...

  4. makefile--编码修改-空格出现错误

    "makefile", line 40: make: 1254-055 Dependency line needs colon or double colon operator. ...

  5. Poj 2993 Emag eht htiw Em Pleh

    1.Link: http://poj.org/problem?id=2993 2.Content: Emag eht htiw Em Pleh Time Limit: 1000MS   Memory ...

  6. js设备判断

    判断设备android,weixin,ios var UserAgent=navigator.userAgent.toLowerCase(); var IS_ANDROID=false; var IS ...

  7. SEO视频教程集合在线观看

    seo是搜索引擎优化(Search Engine Optimization)的英文缩写,是指为了从搜索引擎中获得更多的免费流量,从网站结构.内容建设方案.用户互动传播.页面等角度进行合理规划,使网站更 ...

  8. nand flash相关

    关于nandflash的说明,请参考其他. 现在先贴出来韦东山先生的代码,作我学习之用. @************************************************ @ Fil ...

  9. ArcGIS Server10.1授权文件

    3dengine,101,ecp.arcgis.server,01-jan-2020,UTE784S3EY83ZJKN0085 3dserver,101,ecp.arcgis.server,01-ja ...

  10. c# 两个数组比较,将重复部分去掉,返回不重复部分

    List<string> Ashuzu = new List<string>(); Ashuzu.Add("); Ashuzu.Add("); List&l ...