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. 【Knockout】一、认识Knockout,你会爱上它

    介绍 Knockout简称ko,是一个轻量级的javascript类库,采用MVVM设计模式(即Model.view.viewModel),简单优雅的实现了双向绑定,实时更新,帮助您使用干净的数据模型 ...

  2. django 学习-2 模板

    如何使用渲染模板的方法来显示内容. 1.创建一个项目dream django-admin.py   startproject   dream cd  dream    再创建一个应用 python m ...

  3. C#算法基础之冒泡排序

    using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.T ...

  4. HDOJ2028Lowest Common Multiple Plus

    Lowest Common Multiple Plus Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (J ...

  5. C# 使用Code First迁移更新数据库

    三步完成迁移: 1. 启用迁移: Enable-Migrations Enable-Migrations -ContextTypeName Mvc4WebSite.Models.MvcGuestboo ...

  6. Memcached学习(三)

    通过Java客户端实现与Memcached的交互,Java客户端的实现了使用了开源的Memcached-Java-Client,开源地址在GitHub上. 如下是通过该开源库实现的Memcached交 ...

  7. orcale 循环插入 测试数据

    以前开发一直用的是sql server   定义临时变量 循环插入数据到表中已经成为一种固定的模式,本来想orcale应该也一样吧 都是数据库.. 结果被现实无情的打击到了.在网上找办法,求大神 最后 ...

  8. eclipse中英文切换--四种方式

    若转载,请注明出处 http://www.cnblogs.com/last_hunter/p/5627009.html 谢谢! ------------------------------------ ...

  9. 我对c++对象内存布局的理解

    引言 结合网上的一些资料,通过自己的一番摸索,得出了一点个人见解.现在写下来,希望与各位同学共同探讨,共同进步. 以下所有代码均是在VS2012下测试. 一个普通的基类 1: #include < ...

  10. 关于apache Alias斜杠/的实验

    1.Alias /icons/ "D:/wamp/bin/apache/Apache2.2.17/icons/" 访问http://localhost/icons/正常,访问htt ...