自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+

Dch19990825的博客

大三 退役Acmer,CCPC银牌+ICPC铜牌

  • 博客(36)
  • 收藏
  • 关注

原创 c++调用类成员和属性的几种方法

c++类关于类静态成员和方法和类的普通成员和方法的关系以及区别下面把静态属性(方法)称为类的属性(方法) ,普通属性(方法)称为对象的属性(方法)调用类成员和属性的几种方法/*调用类成员和属性的几种方法: 类名::属性或方法名 对象.属性或对象名*/#include<cstdio>#include<iostream>using namesp...

2019-01-31 23:35:46 6145 1

原创 扩展欧几里得算法 以及一次同余方程的几种方法

扩展欧几里得算法:ax+by=gcd(a,b)​ax+by=gcd(a,b)​ax+by=gcd(a,b)​ 求出满足条件唯一的x,y的值设:设:设:r0=q1∗r1+r2r_{0}=q_{1}*r_{1}+r_{2}r0​=q1​∗r1​+r2​r1=q2∗r2+r3r_{1}=q_{2}*r_{2}+r_{3}r1​=q2​∗r2​+r3​r2=q3∗r3+r4​r_{2}=q_{3...

2019-01-31 23:34:37 558

原创 中国剩余定理

中国剩余定理看介绍和解方程:前提:MiM_{i}Mi​互质例题:POJ1006代码:#include<cstdio>#include<algorithm>#include<iostream>using namespace std;typedef long long ll;const int maxn=1e

2019-01-31 23:34:22 145

原创 C - Race to 1 Again

C - Race to 1 AgainRimi learned a new thing about integers, which is - any positive integer greater than 1 can be divided by its divisors. So, he is now playing with this property. He selects a numbe...

2019-01-25 20:43:05 201

原创 B - Discovering Gold

B - Discovering GoldYou are in a cave, a long cave! The cave can be represented by a 1 x N grid. Each cell of the cave can contain any amount of gold.Initially you are in position 1. Now each turn y...

2019-01-25 20:42:42 259

原创 A - A Dangerous Maze

A - A Dangerous MazeYou are in a maze; seeing n doors in front of you in beginning. You can choose any door you like. The probability for choosing a door is equal for all doors.If you choose the ith...

2019-01-25 20:42:07 338

原创 枚举子集的几种方法

程序设计挑战竞赛上156页说了枚举组合和子集的几种方法,我觉得挺好的,收藏一下都是利用二进制数的模型来进行枚举子集或者组合下面枚举集合都是在二进制位上进行枚举。##枚举k个数的子集void EunmSet(int k)//用k个二进制位数枚举k个状态{ for(int i=0;i<1<<k;++i) { // 对子集的处理 }}...

2019-01-25 17:11:05 2309

原创 nth_element() O(n)复杂度求第k小元素

nth_element() O(n)复杂度求第k+1小元素函数原型void nth_element(_RAIter, _RAIter, _RAIter);void nth_element(_RAIter, _RAIter, _RAIter, _Compare);void nth_element(_RandomAccessIterator __first, _RandomAccessIte...

2019-01-25 17:10:28 1227

原创 CodeForces - 949B

##CodeForces - 949B 题意:现在给你一个n,表示有2*n-1个方格,第奇数方格上会有一个数字 1-n按顺序放。第偶数个方格上是没有数字的。变动规则是排在最后一个位置的数字,移动到它前边最近的空位 。 直到数字之间没有空位。最终的数列是由n已经确定的。给你q,表示q次查询,每次查询输入一个x,问数列第x位上的数字是多少? .InputThe first line contai...

2019-01-25 17:10:04 162

原创 HDU - 5698

有一个无限大的矩形,初始时你在左上角(即第一行第一列),每次你都可以选择一个右下方格子,并瞬移过去(如从下图中的红色格子能直接瞬移到蓝色格子),求到第nn行第mm列的格子有几种方案,答案对1000000007取模。Input多组测试数据。两个整数n,m(2≤n,m≤100000)n,m(2≤n,m≤100000)Output一个整数表示答案Sample Input...

2019-01-24 18:00:25 145

原创 杜教BM

杜教BM递推,据说可以输入矩阵,但是我还不太清楚,初始数据在初始化vector容器时候输入就ok ,输出第n项#include <bits/stdc++.h> using namespace std;#define rep(i,a,n) for (long long i=a;i<n;i++)#define per(i,a,n) for (long long i=n-1...

2019-01-23 08:56:36 202

原创 M - God of War

M - God of WarAt 184~280 A.D ,there were many kingdoms in China. Three strongest among them are “Wei”, “Shu”, “Wu”. People call this period as “Three Kingdoms”.HH is a super “Three Kingdoms” fan, be...

2019-01-23 08:56:10 233

原创 L - Tiling Dominoes

L - Tiling Dominoes闲聊在大白书上383383383页,上面有详细讲解这道题的dpdpdp方法,第一次做这类状压dp的题时,用的dp的时间复杂度是O(2m∗2m∗n)O(2^m*2^m*n)O(2m∗2m∗n) 可以过另一个一模一样的题,当时是把每一行的放置情况当作状态进行转移,但是那个算法在这道题上过不去,于是开始寻找博客,网上说大白书上有一道一模一样的题,正好旁边就有...

2019-01-23 08:55:58 217

原创 J - Hie with the Pie

J - Hie with the PieThe Pizazz Pizzeria prides itself in delivering pizzas to its customers as fast as possible. Unfortunately, due to cutbacks, they can afford to hire only one driver to do the deli...

2019-01-23 08:55:41 133

原创 H - Imperishable Night(曼哈顿类似回路的时间复杂度O(2^n))

H - Imperishable NightAfter coding so many days,Mr Acmer wants to have a good rest.So travelling is the best choice!He has decided to visit n cities(he insists on seeing all the cities!And he does no...

2019-01-22 18:01:28 274

原创 G - Corn Fields

G - Corn FieldsFarmer John has purchased a lush new rectangular pasture composed of M by N (1 ≤ M≤ 12; 1 ≤ N ≤ 12) square parcels. He wants to grow some yummy corn for the cows on a number of squares...

2019-01-22 17:59:16 174

原创 E - Mondriaan's Dream

E - Mondriaan’s DreamSquares and rectangles fascinated the famous Dutch painter Piet Mondriaan. One night, after producing the drawings in his ‘toilet series’ (where he had to use his toilet paper to...

2019-01-22 17:58:52 181

原创 D - Relocation

D - Relocationmma and Eric are moving to their new house they bought after returning from their honeymoon. Fortunately, they have a few friends helping them relocate. To move the furniture, they only...

2019-01-22 17:58:13 194

原创 A - LianLianKan

A - LianLianKanI like playing game with my friend, although sometimes looks pretty naive. Today I invent a new game called LianLianKan. The game is about playing on a number stack.Now we have a numb...

2019-01-22 17:57:27 153

原创 三分求函数极值详解

问题:假设现在有一个开头向上的抛物线,怎么快速求出其极值点呢?例子:当然就是三分了图片借用https://www.cnblogs.com/whywhy/p/4886641.html博主假设在[L,R]区间内仅有一极值点,要求该极值点,则可令M1=L+(R-L)/3,M2=R-(R-L)/3。如果像上面的抛物线一下具有则极小值点,那么存在下列性质:因为M1<...

2019-01-16 21:26:50 584

原创 H - Turn the corner hdu2438(三分)

Mr. West bought a new car! So he is travelling around the city.One day he comes to a vertical corner. The street he is currently in has a width x, the street he wants to turn to has a width y. The c...

2019-01-16 21:01:01 113

原创 G - Light Bulb(几何/三分)

G - Light BulbCompared to wildleopard’s wealthiness, his brother mildleopard is rather poor. His house is narrow and he has only one light bulb in his house. Every night, he is wandering in his incom...

2019-01-16 20:50:43 177

原创 E - River Hopscotch(二分)

E - River HopscotchEvery year the cows hold an event featuring a peculiar version of hopscotch that involves carefully jumping from rock to rock in a river. The excitement takes place on a long, stra...

2019-01-16 20:47:35 216

原创 D - Expanding Rods(二分)

D - Expanding RodsWhen a thin rod of length L is heated n degrees, it expands to a new length L’=(1+n*C)*L, where C is the coefficient of heat expansion.When a thin rod is mounted on two solid walls...

2019-01-16 20:46:52 175

原创 B - Bound Found(POJ2566)尺取

B - Bound FoundSignals of most probably extra-terrestrial origin have been received and digitalized by The Aeronautic and Space Administration (that must be going through a defiant phase: “But I want...

2019-01-16 20:46:28 186

原创 A - Jessica's Reading Problem(尺取法入门题)

A - Jessica’s Reading Problem(尺取法入门题)Jessica’s a very lovely girl wooed by lots of boys. Recently she has a problem. The final exam is coming, yet she has spent little time on it. If she wants to pas...

2019-01-16 20:46:07 275

原创 I - Toxophily (三分加二分)

I - ToxophilyThe recreation center of WHU ACM Team has indoor billiards, Ping Pang, chess and bridge, toxophily, deluxe ballrooms KTV rooms, fishing, climbing, and so on.We all like toxophily....

2019-01-16 18:05:54 178

原创 C语言课程设计作业--图书馆系统

C语言课程设计作业–图书馆系统这系统功能挺强大的,管理员密码:666666#include<stdio.h>#include<stdlib.h>#include<math.h>#include<string.h>#include<

2019-01-14 17:50:49 1973 1

原创 J - 吉哥系列故事――恨7不成妻(HDU4507)

J - 吉哥系列故事――恨7不成妻单身!  依然单身!  吉哥依然单身!  DS级码农吉哥依然单身!  所以,他生平最恨情人节,不管是214还是77,他都讨厌!    吉哥观察了214和77这两个数,发现:  2+1+4=7  7+7=72  77=711  最终,他发现原来这一切归根到底都是因为和7有关!所以,他现在甚至讨厌一切和7有关的数!什么样的数和7有关呢?如果一...

2019-01-14 17:50:14 214

原创 B - XHXJ's LIS(hdu4352)

B - XHXJ’s LISdefine xhxj (Xin Hang senior sister(学姐))If you do not know xhxj, then carefully reading the entire description is very important.As the strongest fighting force in UESTC, xhxj grew up...

2019-01-14 17:49:27 392

原创 B - XHXJ's LIS(hdu4352)

B - XHXJ’s LISdefine xhxj (Xin Hang senior sister(学姐))If you do not know xhxj, then carefully reading the entire description is very important.As the strongest fighting force in UESTC, xhxj grew up...

2019-01-13 20:58:12 324

原创 G - B-number(HDU3652,水)

G - B-numberA wqb-number, or B-number for short, is a non-negative integer whose decimal form contains the sub- string “13” and can be divided by 13. For example, 130 and 2613 are wqb-numbers, but 14...

2019-01-13 18:19:48 264

原创 F - Balanced Number(HDU3709)

F - Balanced NumberA balanced number is a non-negative integer that can be balanced if a pivot is placed at some digit. More specifically, imagine each digit as a box with weight indicated by the dig...

2019-01-13 18:18:38 253

原创 E - Round Numbers(POJ3252)

E - Round NumbersThe cows, as you know, have no fingers or thumbs and thus are unable to play Scissors, Paper, Stone’ (also known as ‘Rock, Paper, Scissors’, ‘Ro, Sham, Bo’, and a host of other names...

2019-01-13 18:17:30 164

原创 A - Beautiful numbers(CF 55D)

A - Beautiful numbersVolodya is an odd boy and his taste is strange as well. It seems to him that a positive integer number is beautiful if and only if it is divisible by each of its nonzero digits. ...

2019-01-09 10:52:16 211

原创 C - 不要62(hdu2089)

C - 不要62杭州人称那些傻乎乎粘嗒嗒的人为62(音:laoer)。杭州交通管理局经常会扩充一些的士车牌照,新近出来一个好消息,以后上牌照,不再含有不吉利的数字了,这样一来,就可以消除个别的士司机和乘客的心理障碍,更安全地服务大众。不吉利的数字为所有含有4或62的号码。例如:62315 73418 88914都属于不吉利号码。但是,61152虽然含有6和2,但不是62连号,所以不属于不...

2019-01-09 10:51:18 609

空空如也

空空如也

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

TA关注的人

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