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 winpcap 网络抓包 并获取IP TCP 协议的相关信息
以太网协议分析函数: void ethernet_protocol_packet_handle (u_char *argument, const struct pcap_pkthdr *packet_ ...
- podoWeb极品流氓软件
用firefox做页面网络性能测试, 打开网页就会发现页面不停的去请求googleapi.com上的jquery Or swfobject.js,页面就此卡住,一直在等待类似这两个请求的返回,知道Ab ...
- C++模板:读入优化
int scan(int &x){ while(c=getchar(),c<'0'||c>'9');x=c-'0'; while(c=getchar(),c>='0'& ...
- iOS9 白名单问题 -canOpenURL: failed for URL: "xx" - error:"This app is not allowed to query for scheme xx"
[iOS开发]-canOpenURL: failed for URL: "xx" - error:"This app is not allowed to query fo ...
- C# - String与StringBuilder
A String object is called immutable (read-only), because its value cannot be modified after it has b ...
- openstack之Nova
一.Nova简介及其核心组件: Nove在openstack中提供计算服务: Nova核心模块: Controller Nova-api:提供API,包括命令行API; Nova-schedule: ...
- Mysql 查询 字符串 (索引和通配符)
需要查询的 Mission_Info 字段 值 CYVR-0220-1240-ZYTX-1415-1740-ZUUU-9999-9999-ZZZZ-9999-9999-ZZZZ SELECT M ...
- 从开发到部署,使用django创建一个简单可用的个人博客
本文参考于: 简书-Django搭建简易博客教程:http://www.jianshu.com/p/d15188a74104 自强学堂-Django基础教程:http://www.ziqiangxue ...
- BZOJ 1626: [Usaco2007 Dec]Building Roads 修建道路( MST )
计算距离时平方爆了int结果就WA了一次...... ------------------------------------------------------------------------- ...
- vs2010中iostream.h出错
使用 #include <iostream> using namespace std; 替代 VS2010删除了所有非标准库,保留了C++标准库,iostream.h是以前旧版的库,VS2 ...