自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(18)
  • 收藏
  • 关注

原创 快速幂!!!

???快速幂是个什么东东??确切的定义可以去详细的查找这里举个栗子来说明下什么叫快速幂给出三个字母A B CA的B次方对C取模得到的结果就是快速幂所要的那个结果了!有同学说了这不是很简单吗?直接列公式不就好了吗?so easy!But 这里的A B C 是有范围的其中1<=A,B,C<=10^9;这下如果直接去用公式直接运算的话,那就不行了的,系统会崩的!!...

2018-11-23 11:10:03 127

原创 判断是否为质数!!

基础篇之质数:给你一个数判断他是否为质数,如果是输出YES,否则输出NO!比较简单代码直接奉上:#include<stdio.h>#include<algorithm>using namespace std;int nisprime(int a){ if(a==1) return 0; for(int i=2;i*i<=a;i++...

2018-11-23 10:32:06 199

原创 最小公倍数!!

给你两个数求其最小公倍数:思路其两个数除以他们的gcd!代码奉上:#include<stdio.h>#include<algorithm>using namespace std;int gcd(int a,int b){ return b?gcd(b,a%b):a;}int main(){ int a,b; scanf("%d%d",...

2018-11-20 20:38:25 191

原创 GCD的入门!

问题很简单:给你两个数 啊, a , b;输出其他的最大公约数:以后答题中的小部分!!代码奉上#include<stdio.h>#include<algorithm>using namespace std;int gcd(int a,int b){ return b?gcd(b,a%b):a;}int main(){ int a,b;...

2018-11-20 20:25:22 248

原创 并查集入门

并查集是一种树型的数据结构,用于处理一些不相交集合 (Disjoint Sets)的合并及查询问题。常常在使用中以森林来 表示。集就是让每个元素构成一个单元素的集合,也就是按 一定顺序将属于同一组的元素所在的集合合并。现在举一个通俗的例子来理解并查集。我认为是兄弟情义帮忙问题,即在帮忙时如果是兄弟肯定是要帮的,这个没啥好说的,但如果是兄弟的兄弟照顾兄弟的面子也要帮忙的,但如果一个人过来找你帮忙...

2018-09-08 16:01:37 204

原创 斐波那契数列与三角形结合的例子(思维)

B - Triangle HDU - 5914 Mr. Frog has n sticks, whose lengths are 1,2, 3⋯⋯n respectively. Wallice is a bad man, so he does not want Mr. Frog to form a triangle with three of the sticks here. He dec...

2018-09-05 10:41:52 2678

原创 kmp模板详解

A - Number Sequence HDU - 1711 Given two sequences of numbers : a[1], a[2], ...... , a[N], and b[1], b[2], ...... , b[M] (1 <= M <= 10000, 1 <= N <= 1000000). Your task is to find a nu...

2018-09-04 21:04:26 177

原创 51node1006LCS

 1006 最长公共子序列Lcs 基准时间限制:1 秒 空间限制:131072 KB 分值: 0 难度:基础题给出两个字符串A B,求A与B的最长公共子序列(子序列不要求是连续的)。比如两个串为:abcicbaabdkscabab是两个串的子序列,abc也是,abca也是,其中abca是这两个字符串最长的子序列。Input第1行:字符串A第2行:字符串B(...

2018-08-24 17:12:35 160

原创 查看你的博客百度链接

http://zhanzhang.baidu.com/linksubmit/url

2018-08-24 16:57:10 352

原创 树形dp入门+记忆搜索

There is going to be a party to celebrate the 80-th Anniversary of the Ural State University. The University has a hierarchical structure of employees. It means that the supervisor relation forms a tr...

2018-08-11 21:30:25 169

原创 DFS+记忆标记+递归(其实就是DFS的本质)+dp

 FatMouse has stored some cheese in a city. The city can be considered as a square grid of dimension n: each grid location is labelled (p,q) where 0 <= p < n and 0 <= q < n. At each grid...

2018-08-10 16:44:56 821

原创 尺取得基本应用

B - They Are Everywhere Sergei B., the young coach of Pokemons, has found the big house which consists of nflats ordered in a row from left to right. It is possible to enter each flat from the str...

2018-07-28 21:17:53 158

原创 二分+尺取

  A - StagesNatasha is going to fly to Mars. She needs to build a rocket, which consists of several stages in some order. Each of the stages is defined by a lowercase Latin letter. This way, the r...

2018-07-28 21:11:46 270

原创 凸包

题目:Your friend to the south is interested in building fences and turning plowshares into swords. In order to help with his overseas adventure, they are forced to save money on buying fence posts by ...

2018-07-26 21:45:37 257

原创 STL之map模板

题目信息:Given a number of strings, can you find how many strings that appears T times?input:The input contains multiple test cases. Each case begins with a integer N(the number of strings you will ...

2018-07-25 21:41:23 350

原创 欧几里得模板

C - 乘法逆元 给出2个数M和N(M < N),且M与N互质,找出一个数K满足0 < K < N且K * M % N = 1,如果有多个满足条件的,输出最小的。Input:给出2个数M和N(M < N),且M与N互质,找出一个数K满足0 < K < N且K * M % N = 1,如果有多个满足条件的,输出最小的。Output:输入2个...

2018-07-24 21:55:35 158

原创 欧几里得模板+费马小定理

B - A/B 要求(A/B)%9973,但由于A很大,我们只给出n(n=A%9973)(我们给定的A必能被B整除,且gcd(B,9973) = 1)。 Input:数据的第一行是一个T,表示有T组数据。 每组数据有两个数n(0 <= n < 9973)和B(1 <= B <= 10^9)。Output:对应每组数据输出(A/B)%9973。S...

2018-07-24 21:31:58 180

原创 暑假训练1结构体的基本模板

A - A题目信息:每天第一个到机房的人要把门打开,最后一个离开的人要把门关好。现有一堆杂乱的机房签 到、签离记录,请根据记录找出当天开门和关门的人。Input:      测试输入的第一行给出记录的总天数N ( > 0 )。下面列出了N天的记录。 每天的记录在第一行给出记录的条目数M ( > 0 ),下面是M行,每行的格式为 证件号码 签到时间 签离时间 out...

2018-07-23 21:22:41 158

空空如也

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除