Ural 1313 - Some Words about Sport
Input
Output
Sample
input | output |
---|---|
4 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 |
// Ural Problem 1313. Some Words about Sport
// Verdict: Accepted
// Submission Date: 20:50:20 14 Jan 2014
// Run Time: 0.031s
//
// 版权所有(C)acutus (mail: acutus@126.com)
// 博客地址:http://www.cnblogs.com/acutus/// [解题方法]
// 简单题,直接找矩阵规律即可 #include<stdio.h> void solve()
{
int i, t, j, N, a[][], M;
scanf("%d",&N);
for(i = ; i < N; i++) {
for(j = ; j < N; j++) {
scanf("%d", &a[i][j]);
}
}
t = ;
M = * N - ;
printf("%d", a[][]);
while(t <= M) {
if(t <= N - ) {
for(j = ; j <= t; j++) {
printf(" %d",a[t - j][j]);
}
} else {
for(j = t - (N - ); j <= N - ; j++) {
printf(" %d", a[t - j][j]);
}
}
t++;
}
printf("\n");
} int main()
{
solve();
return ;
}
Ural 1313 - Some Words about Sport的更多相关文章
- URAL 1779 F - The Great Team 构造
F - The Great TeamTime Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://acm.hust.edu.cn/vjudge/contest ...
- Ural Sport Programming Championship 2015
Ural Sport Programming Championship 2015 A - The First Day at School 题目描述:给出课程安排,打印一个课程表. solution 暴 ...
- 后缀数组 POJ 3974 Palindrome && URAL 1297 Palindrome
题目链接 题意:求给定的字符串的最长回文子串 分析:做法是构造一个新的字符串是原字符串+反转后的原字符串(这样方便求两边回文的后缀的最长前缀),即newS = S + '$' + revS,枚举回文串 ...
- ural 2071. Juice Cocktails
2071. Juice Cocktails Time limit: 1.0 secondMemory limit: 64 MB Once n Denchiks come to the bar and ...
- ural 2073. Log Files
2073. Log Files Time limit: 1.0 secondMemory limit: 64 MB Nikolay has decided to become the best pro ...
- ural 2070. Interesting Numbers
2070. Interesting Numbers Time limit: 2.0 secondMemory limit: 64 MB Nikolay and Asya investigate int ...
- ural 2069. Hard Rock
2069. Hard Rock Time limit: 1.0 secondMemory limit: 64 MB Ilya is a frontman of the most famous rock ...
- ural 2068. Game of Nuts
2068. Game of Nuts Time limit: 1.0 secondMemory limit: 64 MB The war for Westeros is still in proces ...
- ural 2067. Friends and Berries
2067. Friends and Berries Time limit: 2.0 secondMemory limit: 64 MB There is a group of n children. ...
随机推荐
- shell学习-读取输入
功能:读取输入,打印:如果长度小于MINLEN,那么输出空格. #!/bin/bash # paragraph-space.sh # Insert a blank line between parag ...
- 64位系统未注册"MSDAORA.1"提供程序
原因:如错误,64位系统未注册"MSDAORA.1"提供程序 解决:在IIS应用程序池中找到自己的网站,打开高级设置,设置“启用32位应用程序”为“True”即可. 另外还有其他解 ...
- ASP.net WebAPI 上传图片
[HttpPost] public Task<Hashtable> ImgUpload() { // 检查是否是 multipart/form-data if (!Request.Cont ...
- ASCII码图
图片转ASCII码图 效果图 基本思路 把图片每个像素点的信息拿出来,最重要的是拿到rgb的值 把每个像素点由rgb转成灰度图像,即0-255 给0-255分级,把每个等级的像素点转换成ascii ...
- MySQL FEDERATED 存储引擎
MySQL中针对不同的功能需求提供了不同的存储引擎.所谓的存储引擎也就是MySQL下特定接口的具体实现. FEDERATED是其中一个专门针对远程数据库的实现.一般情况下在本地数据库中建表会在数据库目 ...
- java.lang.ClassCastException: oracle.sql.TIMESTAMP cannot be cast to java.sql.Timestamp
http://stackoverflow.com/questions/13269564/java-lang-classcastexception-oracle-sql-timestamp-cannot ...
- DropDownList控件学习
using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.We ...
- Lua学习笔记5:类及继承的实现
-- Lua中类的实现 -------------------------------- 基类 ---------------------------- classBase = {x = 0,y = ...
- 解决shell脚本中 echo 怎么写入换行到文件
測试环境:ubuntu12.04 LTS版本号 echo >> file.txt就可以, 这样的方法对于脚本开头是bash和sh效果都一样, 而echo -e >> file. ...
- js 字符串为空
content.replace(/(^\s)|(\s$)/g, "")