Educational Codeforces Round 16
water。= =。
#include <cstdio>
,,,,,-,-,-};
,-,,,-,,,-,};
#define judge(x,y) x >= 1 && x <= 8 && y >= 1 && y <= 8
int main()
{
char t;
;
scanf("%c%d", &t, &y);
x = t - ;
; i < ; i++)
{
int fx = x + dx[i], fy = y + dy[i];
if(judge(fx,fy)) cnt++;
}
printf("%d\n", cnt);
;
}
题目大意:给你n个坐标,找一个点到n个点的距离之和最小,如果有多解,选最左的。
这个感觉就是一道初中数竞题嘛。。那时候好像是一个区间?求的是。
#include <cstdio>
#include <algorithm>
using namespace std;
typedef long long LL;
* 1e5 + ;
int x[maxn];
int main()
{
int n;
scanf("%d", &n);
; i < n; i++)
scanf("%d", &x[i]);
sort(x, x + n);
printf()/ ]);
;
}
题目大意:给你一个奇数n,然后输出一个幻方什么的?
昂。幻方的解法,组合数学的书里有,翻来覆去就解出来了,很酷。
然后这题好像是个找规律。。你就会发现有块区域放奇数,有一块放偶数就行了。。
#include <cstdio>
#include <cmath>
#include <algorithm>
using namespace std;
typedef long long LL;
* 1e5 + ;
int x[maxn];
int main()
{
, even = ;
scanf("%d", &n);
) / ;
; i <= n; i++)
{
; j <= n; j++)
{
)
{
printf("%d%c", odd, j == n ? '\n' : ' ');
odd +=;
}
else
{
printf("%d%c", even, j == n ? '\n' : ' ');
even +=;
}
}
}
;
}
Educational Codeforces Round 16的更多相关文章
- [Educational Codeforces Round 16]E. Generate a String
[Educational Codeforces Round 16]E. Generate a String 试题描述 zscoder wants to generate an input file f ...
- [Educational Codeforces Round 16]D. Two Arithmetic Progressions
[Educational Codeforces Round 16]D. Two Arithmetic Progressions 试题描述 You are given two arithmetic pr ...
- [Educational Codeforces Round 16]C. Magic Odd Square
[Educational Codeforces Round 16]C. Magic Odd Square 试题描述 Find an n × n matrix with different number ...
- [Educational Codeforces Round 16]B. Optimal Point on a Line
[Educational Codeforces Round 16]B. Optimal Point on a Line 试题描述 You are given n points on a line wi ...
- [Educational Codeforces Round 16]A. King Moves
[Educational Codeforces Round 16]A. King Moves 试题描述 The only king stands on the standard chess board ...
- Educational Codeforces Round 16 E. Generate a String dp
题目链接: http://codeforces.com/problemset/problem/710/E E. Generate a String time limit per test 2 seco ...
- Educational Codeforces Round 16 D. Two Arithmetic Progressions (不互质中国剩余定理)
Two Arithmetic Progressions 题目链接: http://codeforces.com/contest/710/problem/D Description You are gi ...
- Educational Codeforces Round 16 E. Generate a String (DP)
Generate a String 题目链接: http://codeforces.com/contest/710/problem/E Description zscoder wants to gen ...
- Educational Codeforces Round 16 A B C E
做题太久也有点累了..难题不愿做 水题不愿敲..床上一躺一下午..离下一场div2还有点时间 正好有edu的不计分场 就做了一下玩玩了 D是个数学题 F是个AC自动机 都没看明白 留待以后补 A 给出 ...
随机推荐
- JQ001-认识jQuery 和 JQ002-jQuery选择器
JQ001-认识jQuery jQuery环境配置:将jQuery.js文件引入到html页面中即可. 代码如下: <!DOCTYPE html> <html> <hea ...
- Css中的Position属性
Css中的Position属性 Css属性在线查询地址: http://www.css88.com/book/css/properties/index.htm CSS 中的 position 属性 在 ...
- Linux 笔记
权限: rwx rwx rwx 以4 2 1数字表示 rwx x 在目录当中是与『能否进入该目录』有关 w 可以让使用者删除.更新.新建文件或目录 通过 "su - vbird" ...
- 在linux命令行下执行php 程序
如何在linux命令行下,执行php程序. 例子 打印当前时间 php -r "echo time()" 随机输出一个数字 php -r "echo rand(1,20) ...
- Java_Array数组1
package org.array.demo; /** * 数组可以看成一组相同属性的元素的集合 * 1.静态声明 * 静态声明的格式: * 数组类型[] 标识 = new 数组类型[数组长度]; * ...
- mysql 主从master-slave同步复制 配置,为读写分离准备
1.为方便,我在一个windows下安装两个mysql实例,端口分别是 3306.3307 打开 my.ini 或 my-default.ini 文件 配置 basedir datadir 和port ...
- struts标签内容截取
<%@ taglib prefix="tiles" uri="http://tiles.apache.org/tags-tiles"%> <% ...
- JS实现图片预加载无需等待
网站开发时经常需要在某个页面需要实现对大量图片的浏览;用javascript来实现一个图片浏览器,让用户无需等待过长的时间就能看到其他图片 网站开发时经常需要在某个页面需要实现对大量图片的浏览,如果考 ...
- tomcat不安全因素
tomcat的提供了一个非常方便的manager系统,可以远程上传war项目,运行项目,但是这也是一个非常危险的地方,我曾经开发过一块B/S架构的小系统,提供了本地文件扫描,文件浏览,扫描等功能,并且 ...
- 基于winner 滤波平稳降噪效果
https://en.wikipedia.org/wiki/Wiener_filter Wiener filter solutions The Wiener filter problem has so ...