摘要: 传送门 D. One-Dimensional Battle Ships time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output D. On 阅读全文
posted @ 2015-08-07 04:04 Pat 阅读(384) 评论(0) 推荐(0)
摘要: 传送门 Even the most successful company can go through a crisis period when you have to make a hard decision — to restructure, discard and merge departme 阅读全文
posted @ 2015-08-06 11:33 Pat 阅读(481) 评论(0) 推荐(0)
摘要: scanf()是C语言中用于读入格式化数据(formatted data)的函数。 我们可能对scanf()的一般用法已经了然,而至于scanf()读入数据的机制恐怕并不十分清楚。 下面我将比较详细地介绍scanf()的工作机制,并指出其丰富且强大的格式化方式。 内容来自这个链接 Function 阅读全文
posted @ 2015-08-04 01:57 Pat 阅读(554) 评论(0) 推荐(0)
摘要: 传送门D. Sum of Medianstime limit per test3 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputIn one well-known algorithm ... 阅读全文
posted @ 2015-08-02 19:12 Pat 阅读(456) 评论(0) 推荐(0)
摘要: 传送门 The task is to find the length of the longest subsequence in a given array of integers such that all elements of the subsequence are sorted in asc 阅读全文
posted @ 2015-08-01 20:00 Pat 阅读(403) 评论(0) 推荐(0)
摘要: 【一更】2015/4/5线段树是『维护区间』的数据结构,它能高效计算一个关于区间的函数 『F([a, b])』,计算方法是对区间进行『分治』。题目_________1.『RMQ』传送门_________假设整个货架上从左到右摆放了N种商品,并且依次标号为1到N,每次小Hi都给出一段区间[L, R], 阅读全文
posted @ 2015-07-31 17:04 Pat 阅读(180) 评论(0) 推荐(0)
摘要: 传送门 题意 给出一正多边形三顶点的坐标,求此正多边形的面积最小值。 分析 为了叙述方便,定义正多边形的单位圆心角 $u$ 为正多边形的某条边对该正多边形外心(外接圆的圆心)所张的角(即外接圆的某条弦所对的圆心角)。 思路 P.S. 这道题还有更简便的解法,不必求外接圆圆心坐标,也不必求圆心角。有下 阅读全文
posted @ 2015-07-31 13:05 Pat 阅读(257) 评论(0) 推荐(0)
摘要: 传送门D. Parking Lottime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputNowadays it is becoming increas... 阅读全文
posted @ 2015-07-28 22:04 Pat 阅读(336) 评论(0) 推荐(0)
摘要: 矩阵快速幂可认为是快速幂算法的扩展。 有一种借助于 typedef 的较为方便的写法。 采用这种方式定义矩阵,既简洁又可以很方便地调用 memset, memcpy 等函数。 矩阵(方阵)乘法,推荐写成参数较少的形式 mat_mul(mat a, mat b, int dim) 其中 a 相当于目的 阅读全文
posted @ 2015-07-28 21:05 Pat 阅读(694) 评论(0) 推荐(0)
摘要: 传送门A. Greg and Arraytime limit per test 1.5 secondsmemory limit per test 256 megabytesinput standard inputoutput standard outputGreg has an arr... 阅读全文
posted @ 2015-07-27 13:45 Pat 阅读(515) 评论(0) 推荐(0)