自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+

AI蜗牛之家

北航烟酒僧~ 腾讯自然语言处理算法工程师~

  • 博客(101)
  • 资源 (4)
  • 收藏
  • 关注

原创 HDU - 5242 Game (树链剖分 OR dfs+贪心 待整理)

GameTime Limit: 3000/1500 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 1421    Accepted Submission(s): 462Problem DescriptionIt is well known that

2017-04-30 22:08:21 818

原创 HDU 5241 Friends(大数+快速幂)

FriendsTime Limit: 2000/1000 MS (Java/Others)    Memory Limit: 262144/262144 K (Java/Others)Total Submission(s): 1356    Accepted Submission(s): 639Problem DescriptionMike has many fri

2017-04-30 21:59:08 1153

原创 SS前待整理临时

大数模板熟悉,外加Java大数

2017-04-30 20:35:42 820

原创 HDU 5245 Joyful(概率 期望)

JoyfulTime Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 1295    Accepted Submission(s): 567Problem DescriptionSakura has a very ma

2017-04-30 20:22:39 809

原创 HDU 5240 Exam(贪心水题)

Problem DescriptionAs this term is going to end, DRD needs to prepare for his final exams.DRD has n exams. They are all hard, but their difficulties are different. DRD will spend at least ri

2017-04-30 20:12:54 898

原创 HDU - 5237 Base64 2015上海邀请赛 (模拟)

Mike does not want others to view his messages, so he find a encode method Base64. Here is an example of the note in Chinese Passport. The Ministry of Foreign Affairs of the People's Republic

2017-04-30 20:01:04 1004

原创 关于C++中的pow小记

几天在敲一个数位DP的问题,但是用到了这个坑D的问题,找了半天错,还以为又是什么奇怪的算法,结果发现思路一致,然后自己各种YY修改,最后不得不和正确答案比对,但是最后发现标准答案和自己的想法几乎一模一样,最后一个函数一个函数替换比对,发现问题竟然出在了pow函数上。其实很早之前再A题的时候就出现过这个pow精度丢失的问题,只是很久没出现过了,出现问题之后才恍然大悟,现在记录一下,以防以后出错,

2017-04-30 19:50:57 1597

原创 SPOJ - BALNUM Balanced Numbers (*数位DP+三进制拆分)

Balanced numbers have been used by mathematicians for centuries. A positive integer is considered a balanced number if:1)      Every even digit appears an odd number of times in its decimal represen

2017-04-30 19:50:19 1276

原创 HDU 4507 吉哥系列故事――恨7不成妻 (平方拆解 + *数位DP 总结)

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

2017-04-28 17:01:59 860

原创 ZOJ 3494 BCD Code (*AC自动机+数位DP 待整理)

Binary-coded decimal (BCD) is an encoding for decimal numbers in which each digit is represented by its own binary sequence. To encode a decimal number using the common BCD encoding, each decimal digi

2017-04-28 11:58:32 842

原创 HDU 4734 F(x)(数位DP)

For a decimal number x with n digits (A nA n-1A n-2 ... A 2A 1), we define its weight as F(x) = A n * 2 n-1 + A n-1 * 2 n-2 + ... + A 2 * 2 + A 1 * 1. Now you are given two numbers A and B, please c

2017-04-28 11:13:03 762

原创 HDU 3652 B-number(*数位DP)

G - B-number HDU - 3652 A 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

2017-04-28 10:14:34 878

原创 HDU 3709 Balanced Number(数位DP)

A 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 digit. When a pivot is

2017-04-28 09:37:32 666

原创 POJ 3252 Round Numbers (组合数学)

The 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) in order to make

2017-04-27 22:04:19 893

原创 HDU 3555 Bomb (数位DP)

The counter-terrorists found a time bomb in the dust. But this time the terrorists improve on the time bomb. The number sequence of the time bomb counts from 1 to N. If the current number sequence inc

2017-04-27 21:30:39 884

原创 HDU 2089 不要62(数位DP)

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

2017-04-27 19:54:36 712

原创 数位DP整理总结

数位动态规划是求解一个大区间[L, R]中间满足条件Q的所有数字的个数(或者和,或其他)的一种方法。它通过分析每一位上的数字,一般用 dp[len][digit][...] 来表示状态“len位长的数字,最高位数字为digit所具有的xx特性”,利用记忆化搜索保存中间结果,从而加快求解速度。 通过求 f(n) 从0到n中满足条件Q的数字的个数,则所求的结果为 f(R) - f(L-1).

2017-04-27 16:22:46 761

原创 CodeForces - 55D Beautiful numbers(*数位DP 取余 LCM 总结)

Volodya 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. We will not argue with

2017-04-27 15:47:25 828

原创 HDU 4352 XHXJ's LIS(*数位DP 记忆化搜索 待整理)

XHXJ's LIS HDU - 4352 #define xhxj (Xin Hang senior sister(学姐)) If you do not know xhxj, then carefully reading the entire description is very important. As the strongest fighting forc

2017-04-27 12:23:33 929

原创 HDU 2476 String painter (*区间DP+基础Dp)

H - String painter HDU - 2476 There are two strings A and B with equal length. Both strings are made up of lower case letters. Now you have a powerful string painter. With the help of th

2017-04-26 16:31:32 849

原创 HDU - 4283 You Are the One(记忆化搜索 * DP)

You Are the One HDU - 4283 题意:有n个男屌丝事先按1,2,3,,,,,,n的顺序排好,每个人都有一个不开心值unhappy[i],如果第i个人第k个上台找对象,那么该屌丝男的不开心值就会为(k-1)*unhappy[i],因为在他前面有k-1个人嘛,导演为了让所有男屌的总不开心值最小,搞了一个小黑屋,可以通

2017-04-26 12:12:50 717

原创 ZOJ 3469 Food Delivery(* 区间DP 总结)

F - Food Delivery ZOJ - 3469 题意:有一家快餐店送外卖,现在同时有n个家庭打进电话订购,送货员得以V-1的速度一家一家的运送,但是每一个家庭都有一个不开心的值,每分钟都会增加一倍,值达到一定程度,该家庭将不会再订购外卖了,现在为了以后有更多的家庭订购,要将外卖送到的情况下使得

2017-04-26 11:01:52 814

原创 二分查找整理

二分查找原博: here 1 //二分查找 2 int binarySearch(int arr[], int len, int key) 3 { 4 int left = 0; 5 int right = len - 1; 6 int mid; 7 8 while (left right) { 9 mid =

2017-04-25 22:08:11 769

原创 zoj 3965 Binary Tree Restoring(* dfs)

Binary Tree RestoringTime Limit: 1 Second      Memory Limit: 65536 KB      Special JudgeGiven two depth-first-search (DFS) sequences of a binary tree, can you find a binary tree which satisf

2017-04-25 21:47:59 1377

原创 ZOJ 3964 Yet Another Game of Stones(Nim博弈 待整理)

Yet Another Game of StonesTime Limit: 1 Second      Memory Limit: 65536 KBAlice and Bob are playing yet another game of stones. The rules of this game are as follow:The game starts with n

2017-04-25 16:55:55 1046

原创 ZOJ 3963 Heap Partition( 并查集 + 贪心 +二分 )

题意 : 构造尽可能少的一种结构,父节点的值小于等于子节点,而且子节点在序列中出现在父节点后面。而且每个父节点至多有两个子节点。开始理解错题意了,卡了好半天啊,这道题不是简单的一个节点可以有两个子节点那么简单,而是递归的,也就是说子节点还可以递归存在子节点,也就是可以是树,坑了好半天啊。。。弱鸡。。。已知每个树上的节点 sj 均可有最多两个子节点 si ,要求 sj≤s

2017-04-25 16:48:25 735

原创 HZAU 1208 Color Circle

Color CircleThere are colorful flowers in the parterre in front of the door of college and form manybeautiful patterns. Now, you want to find a circle consist of flowers with same color. W

2017-04-24 22:19:52 857

原创 HZAU 1203 One Stroke(dfs+二分 Or 双指针)

题意:给你一棵二叉树,点有点权,每次往左或者往右走,求最长走的路,并且点权和小于k;思路:官方题解,尺取,我的写法,树上二分,   对于一条链,枚举每个点为终点,vector存该点到根节点的前缀和,二分一下即可;   详见代码;  借鉴下网友代码!#pragma comment(linker, "/STACK:1024000000,1024000000"

2017-04-24 22:00:51 801

原创 HZAU 1202 GCD( 斐波那契数列+矩阵快速幂)

Problem D: GCDTime Limit: 1 Sec  Memory Limit: 1280 MBSubmit: 194  Solved: 27[Submit][Status][Web Board]DescriptionInput The first line is an positive integer  T . (1<=T<=

2017-04-24 21:47:05 1242

原创 HZAU 1201 Friends(树形DP 待整理)

1201: FriendsTime Limit: 1 Sec  Memory Limit: 1280 MBSubmit: 98  Solved: 16[Submit][Status][Web Board]Description    In a country, the relationship between people can be indicated by a

2017-04-24 18:42:23 841

原创 HZAU 1199 Little Red Riding Hood(水DP)

1199: Little Red Riding HoodTime Limit: 1 Sec  Memory Limit: 1280 MBSubmit: 876  Solved: 139[Submit][Status][Web Board]Description    Once upon a time, there was a little girl. H

2017-04-24 18:33:04 716

原创 HZAU 1205 Sequence Number(最大值前后缀 +双指针 + 二分)

先求求后面的最小值前缀,也就是预处理1~i的最小值,然后从右往左双指针,维护右端点>左端点,如果右端点#include using namespace std;#define MAXN (100000+5)#define INF 0x3f3f3f3fint n,k,arr[MAXN],mmin[MAXN];int main() { while(~scanf("%d",&n

2017-04-24 16:02:37 1004

原创 HZAU 1209 Deadline (hash 贪心 水题不水)

There are N bugs to be repaired and some engineers whose abilities are roughly equal.And an engineer can repair a bug per day. Each bug has a deadline A[i].Question: How many engineers can repair

2017-04-24 10:32:03 936

原创 STL完整版整理

1. STL概论长久以来,软件界一直希望建立一种可重复利用的东西,以及一种得以制造出”可重复运用的东西”的方法,让程序员的心血不止于随时间的迁移,人事异动而烟消云散,从函数(functions),类别(classes),函数库(function libraries),类别库(class libraries)、各种组件,从模块化设计,到面向对象(object oriented ),为的就是复用性

2017-04-24 09:06:02 3470

原创 set集合完整版整理

*set:: begin返回一个迭代器,此迭代器用于发现集中的第一个元素。const_iterator begin() const;iterator begin();返回值发现集或一个空集之后的位置中的第一个元素的双向迭代器。备注如果返回值为开始分配给

2017-04-23 20:10:52 1759

原创 关于ios::sync_with_stdio(false);和 cin.tie(0)加速c++输入输出流

原文地址:http://www.hankcs.com/program/cpp/cin-tie-with-sync_with_stdio-acceleration-input-and-output.html               http://www.clanfei.com/2012/03/235.html在网上查看别人的ACM代码时,发现别人输入输出语句用的总是scanf与p

2017-04-23 17:23:26 3466

原创 ZOJ 3962 Seven Segment Display(*数位DP 总结)

Seven Segment DisplayA seven segment display, or seven segment indicator, is a form of electronic display device for displaying decimal numerals that is an alternative to the more complex dot matr

2017-04-23 17:09:16 993

原创 zoj 3960 What Kind of Friends Are You?(map+哈希)

问题描述:给定 n 个待确定名字的 Friends 和 q 个问题。已知 c 个 Friends 的名字。对于第 i 个问题,有 mi 个 Friends 会回答 yes ,其余 c−mi 个 Friends 均回答 no 。现在给定 n 个待确定名字的 Friends 以及他们对于 q 个问题的回答。若能够确定它的名字,给出;否则,输出 Let's Go to t

2017-04-23 17:00:53 1634

原创 POJ 1651 Multiplication Puzzle (区间DP OR 记忆化搜索)

E - Multiplication Puzzle POJ - 1651 (1)分析最优子结构  在这个问题中想得到a b c d e f之间最小值,比如开始拿d位置的,那么问题就转化成了a b c e和c e f这两个子问题的最小值再加上c*d*e就行了,不过如果真的是这么想的话,也就是把d当成最开始拿的话,怎么表示?开始还想用dp[i][j][k]表示区间i~j之间去掉

2017-04-21 20:39:39 703

原创 ACM点滴经验与记录

题意+数据范围(复杂度估计)+具体问题具体分析

2017-04-21 17:30:04 686

Redis-x64-3.2.100.msi

Redis-x64-3.2.100.msi,因为官网的速度实在是太低了,所以下载下来共享,不过现在最低需要2积分,没法免费了,是在抱歉,若需要留言也可

2017-10-14

STL整理总结

C++的基本库函数STL

2017-04-24

坦克大战游戏,支持声音,配置等

自己写的坦克大战,包括声音等特效,能够对游戏进行坦克数目、地图等进行设置,代码大约1200-1300行,可在此基础上进行深度开发,是对初学者并有部分Java基础的一个很好的锻炼机会,代码由本人自主开发,较为实用。当然也可以作为大作业使用

2015-03-14

C++ API

包含C++以及C语言的库函数,在学习和使用时便于查找和理解库函数

2015-01-24

空空如也

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

TA关注的人

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