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. ...
随机推荐
- 高质量程序设计指南C/C++语言——C++/C常量(2)
- C指针(转)
第一章 指针的概念 指针是一个特殊的变量,它里面存储的数值被解释成为内存里的一个地址. 要搞清一个指针需要搞清指针的四方面的内容:指针的类型,指针所指向的 类型,指针的值或者叫指针所指向的内存区,还有 ...
- HDU 1108 最小公倍数
#include <cstdio> int gcd(int a,int b) { ) return a; else return gcd(b,a%b); } int main() { in ...
- Struts2 学习笔记15 Struts标签 part1
来说一下Struts标签,之前我们也很多地方用到了,还是来总结一下. 首先是property标签. <li>property:<s:property value="user ...
- p2.js物理引擎学习
P2简介 P2是一款基于Javascript编写的HTML5 2D物理引擎,和Box2D.Nape等2D物理引擎一样,P2集成了各种复杂的物理公式和算法,可以帮助我们轻松的实现碰撞.反弹等物理现象的模 ...
- CSS找到 (div+css请讲)
CSS 定位和浮动 CSS 定位和浮动提供了一些特性,使用这些属性,你可以建立栏布局,的重叠布局的一部分,并有一些.也可多年来完成通常需要使用的多个表格能力完成的任务. 定位的基本思路是非常easy. ...
- 对象图(Object Diagram)—UML图(三)
一.用一张图来介绍一下对象图的基本内容 二.对象图与类图的基本差别 三.对象图实例
- STL之priority_queue为复合结构排序
priority_queue为复合结构排序: #include <iostream> #include <queue> using namespace std; struct ...
- 怎么取消 Windows Server 2012 RDP 限制每个用户只能进行一个会话
在 Windows Server 2008 / 2008 R2 上,如果希望多个远程用户使用同一个账号同时访问服务器的 Remote Desktop(RDP),只需通过管理工具-远程桌面下的“远程桌面 ...
- js 常用的一些函数
//设置默认焦点 var setFocus = function SetFocus(elementId) { document.onkeydown = function (even ...