随笔分类 - 数据结构 - hash
摘要:题目描述 NOIP 复赛之前,HSD 桑进行了一项研究,发现人某条染色体上的一段 DNA 序列中连续的 kkk 个碱基组成的碱基序列与做题的 AC 率有关!于是他想研究一下这种关系。现在给出一段 DNA 序列,请帮他求出这段 DNA 序列中所有连续 kkk 个碱基形成的碱基序列中,出现最多的一种的出
阅读全文
摘要:A . After Incident, a feast is usually held in Hakurei Shrine. This time Reimu asked Kokoro to deliver a Nogaku show during the feast. To enjoy the sh
阅读全文
摘要:B. Feeling hungry, a cute hamster decides to order some take-away food (like fried chicken for only 303030 Yuan). However, his owner CXY thinks that t
阅读全文
摘要:题目描述Two undirected simple graphs and where are isomorphic when there exists a bijection on V satisfying if and only if {x, y} ∈ E2.Given two graphs an
阅读全文
摘要:链接:https://www.nowcoder.com/acm/contest/141/E来源:牛客网 题目描述 Eddy likes to play with string which is a sequence of characters. One day, Eddy has played wi
阅读全文
摘要:哈利波特在魔法学校的必修课之一就是学习魔咒。据说魔法世界有100000种不同的魔咒,哈利很难全部记住,但是为了对抗强敌,他必须在危急时刻能够调用任何一个需要的魔咒,所以他需要你的帮助。 给你一部魔咒词典。当哈利听到一个魔咒时,你的程序必须告诉他那个魔咒的功能;当哈利需要某个功能但不知道该用什么魔咒时
阅读全文
摘要:#include #include #include #include using namespace std; typedef long long ll; pairpp; pair Hash(ll a[21]) { ll ans1=0,ans2=0; for(ll i=0;i<21;i++) ans1=(ans1*1000000013+a[i])%1000000007; for(ll...
阅读全文
摘要:百度文库 : https://wenku.baidu.com/view/b7d3d1c6804d2b160a4ec090.html 求一个字符串的hash值: •现在我们希望找到一个hash函数,使得每一个字符串都能够映射到一个整数上 •比如hash[i]=(hash[i-1]*p+idx(s[i]
阅读全文