Problem Description Derek and Alfia are good friends.Derek is Chinese,and Alfia is Austrian.This summer holiday,they both participate in the summer ca ...
分类:
其他好文 时间:
2017-07-30 21:10:05
阅读次数:
258
题目链接 题意:n个数m个查询,问[l,r]中的数是否为1到r-l+1的一个排列。 做法1:hash一下,对于[1...n],每个数都随机分配一个hash值,一个集合的hash值为元素异或和。预处理出[1...n]的hash值及其前缀的hash,然后就可以O(1)查询了 做法二:线段树若(l,r)中 ...
分类:
其他好文 时间:
2017-07-29 22:14:41
阅读次数:
192
Farm Tour Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 17307 Accepted: 6687 Description When FJ's friends visit him on the farm, he like ...
分类:
其他好文 时间:
2017-07-28 23:40:14
阅读次数:
261
http://acm.hdu.edu.cn/showproblem.php?pid=5172 判断一个区间是否为全排列是: 1、区间总和 = (1 + R - L + 1) * (R - L + 1) / 2; 2、区间没有重复数字 记录数组a[i]表示第i个数上一次在那个位置出现。 那么最需要在[ ...
分类:
其他好文 时间:
2017-07-28 00:59:40
阅读次数:
188
题目: Derek and Alfia are good friends.Derek is Chinese,and Alfia is Austrian.This summer holiday,they both participate in the summer camp of Borussia D ...
分类:
其他好文 时间:
2017-07-27 15:43:29
阅读次数:
425
最近做项目需要设计数据库,其中涉及到用户之间好友以及亲戚关系,暂时提出两个解决方案: 1 建立中间表,将有关系的两个人ID相互对应 2 增加一张关系表,将用户的朋友以及亲戚的ID取出来,用","隔开,存入其中的关系字段,比如friendship字段,设置为varchar类型,读取的时候将内容按照“, ...
分类:
数据库 时间:
2017-07-26 17:33:12
阅读次数:
400
Virtual Friends Font: Times New Roman | Verdana | Georgia Font Size: ← → Problem Description These days, you can do all sorts of things online. For ex ...
分类:
其他好文 时间:
2017-07-26 01:51:10
阅读次数:
241
Being a programmer, you like arrays a lot. For your birthday, your friends have given you an array a consisting of n distinct integers. Unfortunately, ...
分类:
其他好文 时间:
2017-07-25 21:16:47
阅读次数:
155
Make a program that filters a list of strings and returns a list with only your friends name in it. If a name has exactly 4 letters in it, you can be ...
分类:
其他好文 时间:
2017-07-25 12:33:50
阅读次数:
200