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 给出 ...
随机推荐
- 常见linux命令释义(第八天)—— Bash Shell 的操作环境
换了新公司,公司的领导很不错.自己感受比较多的地方是,自己的工作效率明显比以前高了.以前会对频繁变动的需求十分不耐烦,现在接到需求后会仔细的思考,进行整体构建.即使以后需求有变动,也能够比较轻易的在原 ...
- OSI参考模型及各层功能,TCP与UDP的区别
OSI参考模型:ISO/IEC 7498标准定义了网络互联的7层结构模型,即开放系统互连参考模型. OSI参考模型定义了开放系统的层次结构.层次之间的相互关系,以及各层所包括的可能的服务.OSI的服务 ...
- Java字节数组转按radix进制输出
代码如下: public class Main_bytesToStr { public static void main(String[] args) throws IOException { // ...
- wordpress 函数、条件判断以及文件的总结
WordPress基本模板文件 一套完整的WordPress模板应至少具有如下文件: style.css : CSS(样式表)文件 index.php : 主页模板 archive.php : Arc ...
- 作为一名前端er,从武汉来到深圳三个月有感
来到深圳已经三个月了,从最开始的担心自己的能力不够怕不能够在深圳这个互联网产品及其发达的城市立足下来,到现在已经慢慢地拾起了一丁点的信心了 (虽然还有很多知识是不够的.但是相当于之前我的,我是觉得我已 ...
- 原生JavaScript技巧
时常在技术论坛有看见一些比较好的示例,于是就出于一种收集并学习的态度,于是就保留下来啦~ 当然现在展示的也只是一部分,先放一部分出来尝尝鲜~~~
- HTML5+CSS3 - 代码简写篇
有话先说:我是一只菜鸟,还是一只刚步入前端这个领域的小菜年,在不断的进阶,理解最深刻的还是代码,既爱又恨却不知如何去感悟. background属性简写: background-position属性组 ...
- PHP计算一年有多少周,每周开始日期和结束日期
一年有多个周,每周的开始日期和结束日期 参考代码一:[正在使用的版本] <?php header("Content-type:text/html;charset=utf-8" ...
- CentOS6.3编译安装Memcached的PHP客户端memcache
在安装Memcached的PHP客户端memcache之前,可先看下先前的工作笔记: PHP5不重新编译,如何安装自带的未安装过的扩展,如soap扩展? 安装PHP的memcache扩展 cd /us ...
- 进阶系列三【绝对干货】----Log4.Net的介绍
一.介绍 当我们开发软件时,一般都会加入运行期的跟踪手段,以方便后续故障分析和Bug调试..net framework本身提供了一个System.Diagnostics.Trace类来实现流程跟踪功能 ...