- 博客(13)
- 资源 (3)
- 收藏
- 关注
原创 Codeforces 652 B. z-sort
B. z-sortA student of z-school found a kind of sorting calledz-sort. The array a withn elements are z-sorted if two conditions hold:ai ≥ ai - 1 for all eveni, ai ≤ ai - 1 for all o
2016-03-26 11:03:30 573
原创 codeforces 652 A. Gabriel and Caterpillar
A. Gabriel and CaterpillarThe 9-th grade student Gabriel noticed a caterpillar on a tree when walking around in a forest after the classes. The caterpillar was on the heighth1 cm from the
2016-03-26 10:36:55 639
原创 Spreadsheets (26进制转换)
SpreadsheetsTime Limit:10000MS Memory Limit:65536KB 64bit IO Format:%I64d & %I64uDescriptionIn the popular spreadsheets systems (for example, in Excel) the following numeration of co
2016-03-21 17:20:53 487
原创 Ladder (单调栈)
LadderTime Limit:2000MS Memory Limit:262144KB 64bit IO Format:%I64d & %I64uDescriptionYou've got an array, consisting of n integersa1, a2, ..., an. Also, you've gotm queries,
2016-03-21 17:14:05 551
原创 HDU 2196 Computer(树形dp 求结点到叶子的最远距离)
ComputerTime Limit:1000MS Memory Limit:32768KB 64bit IO Format:%I64d & %I64uDescriptionA school bought the first computer some time ago(so this computer's id is 1). During the re
2016-03-11 09:21:57 656
原创 POJ 2342 Anniversary party (树形dp入门)
Anniversary partyTime Limit:1000MS Memory Limit:32768KB 64bit IO Format:%I64d & %I64uDescriptionThere is going to be a party to celebrate the 80-th Anniversary of the Ural Stat
2016-03-10 12:05:51 401
原创 SPOJ ARCTAN Use of Function Arctan (三角公式atrtan 高中数学)
Use of Function ArctanDescriptionIt's easy to know that arctan(1/2)+arctan(1/3)=arctan(1).The problem is,to some fixed number A,you have to write a program to calculate the minimum sum B+C.A
2016-03-08 16:25:09 1393
原创 UVA 11234 ( 二叉树 前序 后续遍历方法)
ExpressionsFont Size: Arithmetic expressions are usually written with the operators in between the two operands (which is called infix notation). For example,(x+y)*(z-w) is an arithmetic exp
2016-03-07 16:43:15 159
原创 URAL 1017 Staircases
对于一个最小划分数k和总数n来说,考虑两种情况1.最小划分数刚好等于k2.最小划分数大于k那么就有 dp[k][n]=dp[k+1][n]+dp[k+1][n-k];其含义为第一种情况刚好是 k+1 时将 n-k 的所有情况前面加上一个k 第二种情况刚好就是 k+1时 n的划分那么初始化dp[i][i]=1再递推下去就行了#include#include
2016-03-07 14:26:57 132
原创 HDU 3333 Turing Tree (离线树状数组)
对Q个询问按照右端点离线,每次查询只需要判断那个数是否已经在树状数组里面了对于30000个数据全部存在数组里,去重,二分查询位置判断是否存在#include#include#include#include#include#include#include#include#include#include//#pragma comment(linker, "/ST
2016-03-06 10:53:55 112
原创 HDU 4614 Vases and Flowers (线段树 + 二分)
Vases and FlowersTime Limit:2000MS Memory Limit:32768KB 64bit IO Format:%I64d & %I64uDescription Alice is so popular that she can receive many flowers everyday. She has N vases nu
2016-03-02 18:51:26 569
原创 HDU 4027 Can you answer these queries?
最大的数开根号最多7次到1,每次单点更新,对于全是1的区间标记不用再更新。注意l>r的情况#include#include#include#include#include#include#include#include#include#include//#pragma comment(linker, "/STACK:1024000000,1024000000")
2016-03-02 12:54:28 340
原创 POJ 2155 Matrix (二维线段树)
MatrixTime Limit:3000MS Memory Limit:65536KB 64bit IO Format:%I64d & %I64uDescriptionGiven an N*N matrix A, whose elements are either 0 or 1. A[i, j] means the number in the i-th
2016-03-01 11:06:26 432
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人