信息的表示和处理最重要的数字表示:无符号(unsigned)编码基于传统的二进制表示法,表示大于或者等于零的数字。补码(two’s-complement)编码是表示有符号整数的最常见的方式,有符号整数就是可以为正或者为负的数字。浮点数(floating-point)编码是表示实数的科学记数法的以二为...
分类:
其他好文 时间:
2015-10-02 16:05:25
阅读次数:
197
---------9.21cf 519 ehttp://codeforces.com/problemset/problem/519/E补了之前说的要滚去学的lca有4种情况1. u 是lca,v是lca,这种不合法2. u 是lca,v不是lca,这种要找他们的中点是不是存在3.u 不是lca,v是...
分类:
其他好文 时间:
2015-09-22 01:19:22
阅读次数:
262
DescriptionThere areNmarbles, which are labeled1, 2,...,N. TheNmarbles are put in a circular track in an arbitrary order. In the top part of the track...
分类:
编程语言 时间:
2015-08-06 10:59:01
阅读次数:
147
A permutation on the integers from 1 to n is, simply put, a particular rearrangement of these integers. Your task is to generate a given permutation f...
分类:
编程语言 时间:
2015-08-06 10:56:21
阅读次数:
155
原题:poj3061题意:给你一个数s,再给出一个数组,要求你从中选出m个连续的数,m越小越好,且这m个数之和不小于s这是一个二分查找优化题,那么区间是什么呢?当然是从1到数组长度了。比如数组长度为10,你先找5,去枚举每一个区间为5的连续的数,发现存在这样的数,那么就可以继续往左找,反之则往右找,...
分类:
编程语言 时间:
2015-08-05 20:21:46
阅读次数:
136
原题:UVA11078题意:给你一个数组,设a[],求一个m=a[i]-a[j],m越大越好,而且i必须小于j怎么求?排序?要求i小于j呢。枚举?只能说超时无上限。所以遍历一遍数组,设第一个被减数为a【0】,之后遇到比a【0】大的数就更新它,再拿这个被减数去减数组中的每一个元素,同时也要不断地更新这...
分类:
编程语言 时间:
2015-08-05 20:07:36
阅读次数:
135
DescriptionJohn Doe is a famous DJ and, therefore, has the problem of optimizing the placement of songs on his tapes. For a given tape and for each so...
分类:
编程语言 时间:
2015-08-05 19:58:38
阅读次数:
138
UVA 11572 唯一的雪花题意:给你从1到n的数组,要求求得其中的最长连续不重复子序列,经典的滑窗问题,方法是维护一个窗口,设置左框和右框,然后不断的进行维护和更新方法一:#include"iostream"#include"set"#include"cstring"#include"cstdi...
分类:
编程语言 时间:
2015-08-05 18:15:17
阅读次数:
157
DescriptionThe SUM problem can be formulated as follows: given four listsA,B,C,Dof integer values, compute how many quadruplet(a,b,c,d)AxBxCxDare such...
分类:
编程语言 时间:
2015-08-05 18:10:09
阅读次数:
219
G -贪心Time Limit:3000MSMemory Limit:0KB64bit IO Format:%lld & %lluSubmitStatusDescriptionSimon and Garfunkel Corporation (SG Corp.) is a large steel-ma...
分类:
编程语言 时间:
2015-08-05 17:56:49
阅读次数:
275