albertluf的博客

私信 关注
还是太年轻
码龄3年
  • 110,294
    被访问量
  • 552
    原创文章
  • 11,744
    作者排名
  • 52
    粉丝数量
  • 于 2017-10-30 加入CSDN
获得成就
  • 获得32次点赞
  • 内容获得23次评论
  • 获得133次收藏
荣誉勋章
兴趣领域
  • #人工智能
    #数据分析#NLP#神经网络#Python#深度学习#图像处理#机器学习#自然语言处理#算法#语音识别#TensorFlow
TA的专栏
  • 竞赛
    87篇
  • 搜索
    46篇
  • 动态规划
    22篇
  • 数据结构
    12篇
  • 区间dp
    10篇
  • 背包问题
    18篇
  • 组合dp
    4篇
  • 记忆化搜索
    4篇
  • 贪心
    29篇
  • 模拟
    4篇
  • 并查集
    22篇
  • 最短路问题
    19篇
  • 最小生成树
    12篇
  • 差分约束系统
    8篇
  • 大数运算
    6篇
  • 题目分类
    1篇
  • 基础dp
    35篇
  • 杂题
    5篇
  • 矩阵
    7篇
  • 数学技巧
    13篇
  • KMP
    9篇
  • 字典树
    9篇
  • 二分,三分
    19篇
  • 算法之小技巧
    12篇
  • 哈希
    3篇
  • 各种理论的学习和证明
    4篇
  • 欧几里得与扩展欧几里得
    4篇
  • 数论
    5篇
  • C#小程序
    1篇
  • 线段树
    27篇
  • 树状数组
    7篇
  • 博弈论
    9篇
  • 状态压缩dp
    6篇
  • 扫描线
    5篇
  • 连通图
    7篇
  • 二叉树
    3篇
  • LCA
    2篇
  • 倍增
    4篇
  • 数位dp
    10篇
  • 网络流
    16篇
  • 树形dp
    11篇
  • 舞蹈链
    4篇
  • A*搜索
    1篇
  • 脑力激活
    8篇
  • 分治
    8篇
  • 二分
    2篇
  • 三分
    2篇
  • 主席树
    4篇
  • 莫队算法
    2篇
  • 凸包
    2篇
  • 2-sat
    3篇
  • 斜率dp
    3篇
  • dfs序
    1篇
  • 启发式搜索
    3篇
  • 概率期望
    2篇
  • 树链剖分
    3篇
  • 线性基
    3篇
  • codeforces
    2篇
  • 区域赛
    5篇
  • kd tree
    1篇
  • 高斯消元
    1篇
  • 启发式合并
    1篇
  • 思维
  • 最近
  • 文章
  • 资源
  • 问答
  • 课程
  • 帖子
  • 收藏
  • 关注/订阅

hdu 6299 Balanced Sequence

Balanced SequenceTime Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 973    Accepted Submission(s): 218 Problem DescriptionChiaki has n stri...
原创
402阅读
6评论
2点赞
发布博客于 3 年前

牛客练习赛45

A QAQ:dp[i][0]表示前i个字符可以组成的"Q",dp[i][1]表示前i个字符可以组成的"QA",dp[i][2]表示前i个字符可以组成的"QAQ"。扫一遍即可。#include<bits/stdc++.h>using namespace std;#define ll long longconst int maxn=1e5+10;char t[5005]...
原创
119阅读
0评论
1点赞
发布博客于 2 年前

Wannafly挑战赛1 C:MMSet2

题面最优的点一定在给定点集中最远的两点的简单路径上。#include<bits/stdc++.h>using namespace std;const int maxn=3e5+10;int head[maxn],To[maxn*2],Next[maxn*2],tol;void add_edge(int x,int y){ To[tol]=y; Nex...
原创
119阅读
1评论
1点赞
发布博客于 2 年前

Codeforces Round #549 (Div. 1) B. Lynyrd Skynyrd(倍增)

题面按照贪心策略,枚举以每个位置为结尾,则往前遍历,找到它的前一个数字最近的出现位置,然后往前跳n-1步,倍增判断一下跳到了哪个点。然后线段树查询一下区间最大值即可。#include<bits/stdc++.h>using namespace std;const int maxn=2e5+10;vector<int>G[maxn];int n,m,Q,...
原创
93阅读
0评论
1点赞
发布博客于 2 年前

牛客挑战赛30 C-小G砍树(换根)

题面先考虑1号店最后移除时候的贡献,我们可以钦定1号点为根,并钦定他最后移除然后就是一个树形dp设fifi表示i号点子树移除方案数量,sizeisizei表示1为根时子树大小显然有dp式子fx=(sizex−1)!∏(sizei)!∏fifx=(sizex−1)!∏(sizei)!∏fi(满足1为根时x是i的爹)然后最后移除点1的情况的贡献就算出来了我们考虑换根先考虑...
原创
130阅读
0评论
0点赞
发布博客于 2 年前

BZOJ 4423: [AMPPZ2013]Bytehattan(对偶图+并查集维护连通性)

题面/*转成对偶图,若删这条边之前此边对应对偶图中的两个点已经联通,则对偶图中这两点在连一条边就形成了一个割,所以删除这条边两点不连通。*/#include&lt;bits/stdc++.h&gt;using namespace std;const int maxn=3e6+10;int par[maxn],n,k;int Find(int x){ if(x==pa...
原创
189阅读
0评论
0点赞
发布博客于 2 年前

hdu 6184 Counting Stars(三元环计数)

题目链接题解链接#include&lt;bits/stdc++.h&gt;using namespace std;const int maxn=2e5+10;int n,m,from[maxn],to[maxn];vector&lt;int&gt;G[maxn],s[maxn];int in[maxn],re[maxn],rev[maxn],val[maxn];int mai...
原创
89阅读
0评论
1点赞
发布博客于 2 年前

hdu 6191 Query on A Tree(字典树+启发式合并)

题目链接每个节点建一颗字典树,启发式合并就好了。内存n*logn*logn,内存超限,考虑合并完之后废弃的字典树的节点存一下,后面再次利用。#include&lt;bits/stdc++.h&gt;using namespace std;#define ll long longconst int maxn=1e5+10;int tree[maxn*55][2],a[maxn]...
原创
97阅读
0评论
0点赞
发布博客于 2 年前

hihoCoder #1048 : 状态压缩·二

链接:http://hihocoder.com/problemset/problem/1048题解:https://blog.csdn.net/my_sunshine26/article/details/74612684#include&lt;bits/stdc++.h&gt;using namespace std;const int mod=1000000007;int dp[1...
原创
148阅读
0评论
0点赞
发布博客于 2 年前

Codeforces Round #519 by Botan Investments

题目:http://codeforces.com/contest/1043A. Elections枚举k的值#include&lt;bits/stdc++.h&gt;using namespace std;int n,a[105];int work(){ int sum=0,ma=0; for(int i=1;i&lt;=n;i++) sum+...
原创
115阅读
0评论
0点赞
发布博客于 3 年前

BZOJ 1013: [JSOI2008]球形空间产生器sphere(高斯消元)

题目:https://www.lydsy.com/JudgeOnline/problem.php?id=1013思路:存在二次项,考虑两式相减可以把所有未知数的二次项消掉,n+1 个等式用第一个与后面的做差,形成n个不等式,然后高斯消元即可。代码:#include&lt;cstdio&gt;#include&lt;cmath&gt;#include&lt;algorithm...
原创
81阅读
0评论
0点赞
发布博客于 3 年前

BZOJ 2648: SJY摆棋子(kd tree)

题目:https://www.lydsy.com/JudgeOnline/problem.php?id=2648#include&lt;bits/stdc++.h&gt;using namespace std;const int inf = 0x3f3f3f3f;const int maxn=1e6+100;int idx,n,m,tol,ans;struct node{ ...
原创
113阅读
0评论
0点赞
发布博客于 3 年前

hdu 4347 The Closest M Points (kd tree 模板题)

题目:http://acm.hdu.edu.cn/showproblem.php?pid=4347#include&lt;bits/stdc++.h&gt;using namespace std;#define sq(x) (x)*(x)const int maxn=6e4+10;int idx,n,k,m,lson[maxn],rson[maxn],tol;struct node...
原创
109阅读
0评论
1点赞
发布博客于 3 年前

codeforces 1040E. Network Safety

题目:http://codeforces.com/contest/1040/problem/E思路:若x,y之间有一条边,权值分别为a[x],a[y], 设t=a[x]^a[y],则只有a[x]^t==a[y],a[y]^t==a[x],因此只有其中一个数异或上t才是不安全的,两个数都异或上t则相当于交换x,y。可以按0~(1&lt;&lt;k)-1逐个考虑每个x,若x==t时...
原创
311阅读
0评论
0点赞
发布博客于 3 年前

codeforces 1037F. Maximum Reduction(启发式合并)

题目:http://codeforces.com/contest/1037/problem/F思路:找出最大的一个点(值相同时取左边的点),计算以此点为最大值能够形成多少个合法的区间,然后处理该点左右两个区间,一直递归下去。假设以i为左端点,合法的右端点有i+(k-1),i+2*(k-1),i+3*(k-1),i+4*(k-1)i+t*(k-1)不能超过区间的范围。#includ...
原创
231阅读
0评论
1点赞
发布博客于 3 年前

2017 CCPP 秦皇岛

题目:链接A - Balloon Robot设机器人从0位置出发, 对于每一个a[i],b[i]算出b[i]时间机器人与s[a[i]]的距离,即所需等待时间,此时如果将机器人位置向前推进1,则它越过的t[i]时间都会加上m,因为要相遇就要多走一圈,然后所有的等待时间-1。代码:#include&lt;bits/stdc++.h&gt;using namespace st...
原创
81阅读
0评论
0点赞
发布博客于 3 年前

2018 icpc 南京网络赛

题目:链接A. An Olympian Math Problem输出n-1即可(女朋友猜的)。#include&lt;bits/stdc++.h&gt;using namespace std;#define ll long longll fac[103];int main(){ ll n,T;cin&gt;&gt;T; while(T--) { ...
原创
1891阅读
0评论
3点赞
发布博客于 3 年前

2017 icpc 沈阳现场赛

题目:链接F Heron and His Triangle:暴力跑了几发,把搞出来的数扔进oeis里发现对于条件成立的t数组有t[i]=4*t[i-1]-t[i-2]。因此找到第一个大于等于N的t[i]就好了。但是数值范围超过了long long,因此要用大数,这样一个个找过去会超时,可以先对询问排序,这样下次的询问就可以接着上次的位置寻找。代码:#include...
原创
723阅读
0评论
0点赞
发布博客于 3 年前

2017 icpc 沈阳网络赛

题目:链接B cable cable cable:观察得,答案为K*(M-K+1)#include&lt;bits/stdc++.h&gt;using namespace std;#define ll long longint main(){ ll M,K; while(~scanf("%lld%lld",&amp;M,&amp;K)) pri...
原创
312阅读
0评论
0点赞
发布博客于 3 年前

2017 CCPC 杭州赛区

题面:http://acm.hdu.edu.cn/downloads/CCPC2018-Hangzhou-ProblemSet.pdfProblem A. Super-palindrome:每个奇数长度的子串都是回文,有两种情况:1. aaaaaaa 都是相同字符2.ababababab 两个不同的字符一直交替。枚举每两个字符即可。代码:#include&lt;bit...
原创
748阅读
0评论
0点赞
发布博客于 3 年前

codeforce 1027 F. Session in BSU

F. Session in BSUtime limit per test4 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputPolycarp studies in Berland State University. Soon he will have...
原创
150阅读
0评论
0点赞
发布博客于 3 年前

BZOJ 4568: [Scoi2016]幸运数字(lca+线性基)

4568: [Scoi2016]幸运数字Time Limit: 60 Sec  Memory Limit: 256 MBSubmit: 2256  Solved: 921[Submit][Status][Discuss]DescriptionA 国共有 n 座城市,这些城市由 n-1 条道路相连,使得任意两座城市可以互达,且路径唯一。每座城市都有一个幸运数字,以纪念碑的形式矗立...
原创
83阅读
0评论
0点赞
发布博客于 3 年前

BZOJ 2460: [BeiJing2011]元素(线性基)

2460: [BeiJing2011]元素Time Limit: 20 Sec  Memory Limit: 128 MBSubmit: 2412  Solved: 1250[Submit][Status][Discuss]Description  相传,在远古时期,位于西方大陆的 Magic Land 上,人们已经掌握了用魔法矿石炼制法杖的技术。那时人们就认识到,一个法杖的法力...
原创
98阅读
0评论
0点赞
发布博客于 3 年前

hdu 3949 XOR(线性基)

XORTime Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 4619    Accepted Submission(s): 1612 Problem DescriptionXOR is a kind of bit operator...
原创
113阅读
0评论
0点赞
发布博客于 3 年前

BZOJ 3110: [Zjoi2013]K大数查询(整体二分)

3110: [Zjoi2013]K大数查询Time Limit: 20 Sec  Memory Limit: 512 MBSubmit: 11673  Solved: 3512[Submit][Status][Discuss]Description有N个位置,M个操作。操作有两种,每次操作如果是1 a b c的形式表示在第a个位置到第b个位置,每个位置加入一个数c如果是2 a b...
原创
113阅读
0评论
0点赞
发布博客于 3 年前

洛谷 P1306 斐波那契公约数

对于Fibonacci数列:1,1,2,3,5,8,13......大家应该很熟悉吧~~~但是现在有一个很“简单”问题:第n项和第m项的最大公约数是多少?Update:加入了一组数据。输入输出格式输入格式: 两个正整数n和m。(n,m&lt;=10^9)注意:数据很大 输出格式: Fn和Fm的最大公约数。由于看了大数字就头晕,所以只要输出最后的8位数字就...
原创
82阅读
0评论
0点赞
发布博客于 3 年前

codeforce 1017 F. The Neutral Zone

F. The Neutral Zonetime limit per test5 secondsmemory limit per test16 megabytesinputstandard inputoutputstandard outputNotice: unusual memory limit!After the war, destroyed cities...
原创
101阅读
0评论
0点赞
发布博客于 3 年前

POJ 2104 K-th Number(整体二分)

K-th NumberTime Limit: 20000MS   Memory Limit: 65536K Total Submissions: 67933   Accepted: 23979 Case Time Limit: 2000MS DescriptionYou are working for Macrohard company in data ...
原创
123阅读
0评论
0点赞
发布博客于 3 年前

BZOJ 4372: 烁烁的游戏(动态点分治)

4372: 烁烁的游戏Time Limit: 30 Sec  Memory Limit: 512 MBSubmit: 804  Solved: 288[Submit][Status][Discuss]Description背景:烁烁很喜欢爬树,这吓坏了树上的皮皮鼠。题意:给定一颗n个节点的树,边权均为1,初始树上没有皮皮鼠。烁烁他每次会跳到一个节点u,把周围与他距离不超过d的...
原创
175阅读
0评论
0点赞
发布博客于 3 年前

BZOJ 3730: 震波(动态点分治)

3730: 震波Time Limit: 15 Sec  Memory Limit: 256 MBSubmit: 3441  Solved: 611[Submit][Status][Discuss]Description在一片土地上有N个城市,通过N-1条无向边互相连接,形成一棵树的结构,相邻两个城市的距离为1,其中第i个城市的价值为value[i]。不幸的是,这片土地常常发生地震...
原创
107阅读
0评论
0点赞
发布博客于 3 年前

BZOJ 1095: [ZJOI2007]Hide 捉迷藏(动态点分治)

1095: [ZJOI2007]Hide 捉迷藏Time Limit: 40 Sec  Memory Limit: 256 MBSubmit: 5415  Solved: 2276[Submit][Status][Discuss]Description  捉迷藏 Jiajia和Wind是一对恩爱的夫妻,并且他们有很多孩子。某天,Jiajia、Wind和孩子们决定在家里玩捉迷藏游戏...
原创
194阅读
0评论
0点赞
发布博客于 3 年前

hdu 6356 Glad You Came(倍增)

Glad You CameTime Limit: 10000/5000 MS (Java/Others)    Memory Limit: 262144/262144 K (Java/Others)Total Submission(s): 777    Accepted Submission(s): 269 Problem DescriptionSteve has an integ...
原创
135阅读
0评论
0点赞
发布博客于 3 年前

hdu 5909 Tree Cutting(树形dp+树上点分治)

Tree CuttingTime Limit: 4000/2000 MS (Java/Others)    Memory Limit: 262144/131072 K (Java/Others)Total Submission(s): 1291    Accepted Submission(s): 498 Problem DescriptionByteasar has a tree...
原创
154阅读
0评论
0点赞
发布博客于 3 年前

hdu 6336 Problem E. Matrix from Arrays

Problem E. Matrix from ArraysTime Limit: 4000/2000 MS (Java/Others)    Memory Limit: 262144/262144 K (Java/Others)Total Submission(s): 1286    Accepted Submission(s): 583 Problem DescriptionKa...
原创
83阅读
0评论
0点赞
发布博客于 3 年前

hdu 6341 Problem J. Let Sudoku Rotate(数独)

题目:http://acm.hdu.edu.cn/showproblem.php?pid=6341思路:预处理每一个4*4 格子旋转的四种状态。然后dfs即可,时间上限4^(16) 但是实际上数独限制较多,大多数情况中途已经剪掉。代码: #include&lt;bits/stdc++.h&gt;using namespace std;char txt[20][20];in...
原创
174阅读
0评论
0点赞
发布博客于 3 年前

hdu 4812 D Tree(树上点分治)

D TreeTime Limit: 10000/5000 MS (Java/Others)    Memory Limit: 102400/102400 K (Java/Others)Total Submission(s): 6331    Accepted Submission(s): 1347 Problem DescriptionThere is a skyscraping ...
原创
136阅读
0评论
0点赞
发布博客于 3 年前

hdu 5977 Garden of Eden(树上点分治)

Garden of EdenTime Limit: 10000/5000 MS (Java/Others)    Memory Limit: 131072/131072 K (Java/Others)Total Submission(s): 1844    Accepted Submission(s): 602 Problem DescriptionWhen God made th...
原创
364阅读
0评论
0点赞
发布博客于 3 年前

SPOJ COT - Count on a tree(LCA+主席树)

COT - Count on a tree#tree You are given a tree with N nodes. The tree nodes are numbered from 1 to N. Each node has an integer weight.We will ask you to perform the following operation:u v ...
原创
78阅读
0评论
0点赞
发布博客于 3 年前

HDU 6333 Problem B. Harvest of Apples(莫对算法)

Problem B. Harvest of ApplesTime Limit: 4000/2000 MS (Java/Others)    Memory Limit: 262144/262144 K (Java/Others)Total Submission(s): 647    Accepted Submission(s): 235 Problem DescriptionTher...
原创
100阅读
0评论
0点赞
发布博客于 3 年前

BZOJ 2653: middle(二分+主席树)

Description一个长度为n的序列a,设其排过序之后为b,其中位数定义为b[n/2],其中a,b从0开始标号,除法取下整。给你一个长度为n的序列s。回答Q个这样的询问:s的左端点在[a,b]之间,右端点在[c,d]之间的子序列中,最大的中位数。其中a&lt;b&lt;c&lt;d。位置也从0开始标号。我会使用一些方式强制你在线。 Input第一行序列长度n。接下来n行...
原创
87阅读
0评论
0点赞
发布博客于 3 年前

牛客练习赛23 托米的游戏(概率,期望)

链接:https://www.nowcoder.com/acm/contest/156/F来源:牛客网 题目描述题目背景编不下去了托米有一棵有根树 T, 树根为1,每轮他会在剩下的子树中等概率一个点 u, 砍掉 u 的子树 (包含 u),如果树上的点都被砍光了,游戏结束。求出这个游戏进行的期望轮数,可以证明这个数一定是有理数,设他为 , 你需要告诉他一个整数 x 满足 输入描述...
原创
108阅读
0评论
0点赞
发布博客于 3 年前

ZOJ 2112 Dynamic Rankings(求动态区间第k大,树状数组套主席树)

Dynamic RankingsTime Limit: 10 Seconds      Memory Limit: 32768 KBThe Company Dynamic Rankings has developed a new kind of computer that is no longer satisfied with the query like to simply find t...
原创
120阅读
0评论
0点赞
发布博客于 3 年前

BZOJ 4260: Codechef REBXOR(字典树求区间异或和)

4260: Codechef REBXORTime Limit: 10 Sec  Memory Limit: 256 MBSubmit: 1738  Solved: 744[Submit][Status][Discuss]Description Input输入数据的第一行包含一个整数N,表示数组中的元素个数。第二行包含N个整数A1,A2,…,AN。 Outp...
原创
158阅读
0评论
0点赞
发布博客于 3 年前

BZOJ 2243: [SDOI2011]染色(树链剖分+线段树区间合并)

Description给定一棵有n个节点的无根树和m个操作,操作有2类:1、将节点a到节点b路径上所有点都染成颜色c;2、询问节点a到节点b路径上的颜色段数量(连续相同颜色被认为是同一段),如“112221”由3段组成:“11”、“222”和“1”。请你写一个程序依次完成这m个操作。Input第一行包含2个整数n和m,分别表示节点数和操作数;第二行包含n个正整数表示...
原创
63阅读
0评论
0点赞
发布博客于 3 年前

BZOJ 4034: [HAOI2015]树上操作(树链剖分)

4034: [HAOI2015]树上操作Time Limit: 10 Sec  Memory Limit: 256 MBSubmit: 7160  Solved: 2435[Submit][Status][Discuss]Description有一棵点数为 N 的树,以点 1 为根,且树点有边权。然后有 M 个操作,分为三种:操作 1 :把某个节点 x 的点权增加 a 。...
原创
72阅读
0评论
0点赞
发布博客于 3 年前

BZOJ 1036: [ZJOI2008]树的统计Count(树链剖分)

1036: [ZJOI2008]树的统计CountTime Limit: 10 Sec  Memory Limit: 162 MBSubmit: 22104  Solved: 8996[Submit][Status][Discuss]Description  一棵树上有n个节点,编号分别为1到n,每个节点都有一个权值w。我们将以下面的形式来要求你对这棵树完成一些操作: I. CH...
原创
70阅读
0评论
0点赞
发布博客于 3 年前

HDU 6305 RMQ Similar Sequence(笛卡尔树)

RMQ Similar SequenceTime Limit: 4000/2000 MS (Java/Others)    M`emory Limit: 255535/255535 K (Java/Others)Total Submission(s): 953    Accepted Submission(s): 310 Problem DescriptionChiaki has ...
原创
181阅读
0评论
0点赞
发布博客于 3 年前

HDU 6315 Naive Operations(线段树)

Naive OperationsTime Limit: 6000/3000 MS (Java/Others)    Memory Limit: 502768/502768 K (Java/Others)Total Submission(s): 1244    Accepted Submission(s): 519 Problem DescriptionIn a galaxy far...
原创
192阅读
0评论
0点赞
发布博客于 3 年前

POJ 3162 Walking Race(树形dp+双指针+线段树 or 树形dp+二分+单调队列)

Walking RaceTime Limit: 10000MS   Memory Limit: 131072K Total Submissions: 5030   Accepted: 1276 Case Time Limit: 3000MS Descriptionflymouse’s sister wc is very capable at sports...
原创
72阅读
0评论
0点赞
发布博客于 3 年前

POJ 3744 Scout YYF I(概率dp)

Scout YYF ITime Limit: 1000MS   Memory Limit: 65536K Total Submissions: 10404   Accepted: 3056 DescriptionYYF is a couragous scout. Now he is on a dangerous mission which is to pen...
原创
51阅读
0评论
0点赞
发布博客于 3 年前

牛客网暑期ACM多校训练营(第一场)J-Different Integers(树状数组)

链接:https://www.nowcoder.com/acm/contest/139/J来源:牛客网 题目描述Given a sequence of integers a1, a2, ..., an and q pairs of integers (l1, r1), (l2, r2), ..., (lq, rq), find count(l1, r1), count(l2, r2),...
原创
143阅读
0评论
0点赞
发布博客于 3 年前

hdu 1560 DNA sequence(IDA*)

DNA sequenceTime Limit: 15000/5000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 3872    Accepted Submission(s): 1870 Problem DescriptionThe twenty-first ce...
原创
97阅读
0评论
0点赞
发布博客于 3 年前

codeforce 1006 F. Xor-Paths(双向bfs)

F. Xor-Pathstime limit per test3 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputThere is a rectangular grid of size n×mn×m. Each cell has a number w...
原创
222阅读
0评论
0点赞
发布博客于 3 年前

hdu 1043 Eight(八数码问题,IDA*)

EightTime Limit: 10000/5000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 29904    Accepted Submission(s): 7850Special Judge Problem DescriptionThe 15-puzz...
原创
91阅读
0评论
0点赞
发布博客于 3 年前

HDU 1724 Ellipse(辛普森积分)

EllipseTime Limit: 1000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 2749    Accepted Submission(s): 1240 Problem DescriptionMath is important!! Many ...
原创
88阅读
0评论
0点赞
发布博客于 3 年前

洛谷 P1613

题目描述小A的工作不仅繁琐,更有苛刻的规定,要求小A每天早上在6:00之前到达公司,否则这个月工资清零。可是小A偏偏又有赖床的坏毛病。于是为了保住自己的工资,小A买了一个十分牛B的空间跑路器,每秒钟可以跑2^k千米(k是任意自然数)。当然,这个机器是用longint存的,所以总跑路长度不能超过maxlongint千米。小A的家到公司的路可以看做一个有向图,小A家为点1,公司为点n,每条边长度均为一...
原创
62阅读
0评论
0点赞
发布博客于 3 年前

POJ 2018 Best Cow Fences(构造下凸折线)

Best Cow FencesTime Limit: 1000MS Memory Limit: 30000KTotal Submissions: 12527 Accepted: 4063DescriptionFarmer John's farm consists of a long row of N (1 &lt;= N &lt;= 100,000)fields. Each field conta...
原创
90阅读
0评论
0点赞
发布博客于 3 年前

poj 3321 Apple Tree(dfs序+树状数组)

Apple TreeTime Limit: 2000MS Memory Limit: 65536KTotal Submissions: 33660 Accepted: 10089DescriptionThere is an apple tree outside of kaka's house. Every autumn, a lot of apples will grow in the tree....
原创
78阅读
0评论
0点赞
发布博客于 3 年前

codeforce 1004 E. Sonya and Ice Cream(树的直径)

E. Sonya and Ice Creamtime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputSonya likes ice cream very much. She eats it even during programming competi...
原创
193阅读
0评论
0点赞
发布博客于 3 年前

hdu 2829 Lawrence(斜率dp)

LawrenceTime Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 4930    Accepted Submission(s): 2274Problem DescriptionT. E. Lawrence was a controversia...
原创
67阅读
0评论
0点赞
发布博客于 3 年前

hdu 3507 Print Article(斜率优化dp)

Print ArticleTime Limit: 9000/3000 MS (Java/Others)    Memory Limit: 131072/65536 K (Java/Others)Total Submission(s): 16378    Accepted Submission(s): 5042Problem DescriptionZero has an old printer th...
原创
55阅读
0评论
0点赞
发布博客于 3 年前

POJ 3207 Ikki's Story IV - Panda's Trick(2-sat)

Ikki's Story IV - Panda's TrickTime Limit: 1000MS Memory Limit: 131072KTotal Submissions: 11303 Accepted: 4133Descriptionliympanda, one of Ikki’s friend, likes playing games with Ikki. Today after min...
原创
93阅读
0评论
0点赞
发布博客于 3 年前

hdu 3622 Bomb Game(二分+2-sat)

Bomb GameTime Limit: 10000/3000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 5985    Accepted Submission(s): 2167Problem DescriptionRobbie is playing an interestin...
原创
48阅读
0评论
0点赞
发布博客于 3 年前

hdu 1814 Peaceful Commission (2-sat)

Peaceful CommissionTime Limit: 10000/5000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 5202    Accepted Submission(s): 1660Problem DescriptionThe Public Peace Comm...
原创
74阅读
0评论
0点赞
发布博客于 3 年前

hdu 5478 Can you find it

Can you find itTime Limit: 8000/5000 MS (Java/Others)    Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 1967    Accepted Submission(s): 832Problem DescriptionGiven a prime number C(1≤C≤...
原创
57阅读
0评论
0点赞
发布博客于 3 年前

hdu 5475 An easy problem(线段树)

An easy problemTime Limit: 8000/5000 MS (Java/Others)    Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 2826    Accepted Submission(s): 1056Problem DescriptionOne day, a useless calcula...
原创
72阅读
0评论
0点赞
发布博客于 3 年前

hdu 5468 Puzzled Elena(dfs序+容斥原理)

Puzzled ElenaTime Limit: 5000/2500 MS (Java/Others)    Memory Limit: 131072/131072 K (Java/Others)Total Submission(s): 1724    Accepted Submission(s): 552Problem DescriptionSince both Stefan and Damon...
原创
79阅读
0评论
0点赞
发布博客于 3 年前

BZOJ 1093: [ZJOI2007]最大半连通子图

1093: [ZJOI2007]最大半连通子图Time Limit: 30 Sec  Memory Limit: 162 MBSubmit: 4070  Solved: 1639[Submit][Status][Discuss]Description  一个有向图G=(V,E)称为半连通的(Semi-Connected),如果满足:?u,v∈V,满足u→v或v→u,即对于图中任意两点u,v,存在一...
原创
57阅读
0评论
0点赞
发布博客于 3 年前

codeforce 1000 E. We Need More Bosses

E. We Need More Bossestime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputYour friend is developing a computer game. He has already decided how the ga...
原创
175阅读
0评论
0点赞
发布博客于 3 年前

洛谷 p1484

题目描述cyrcyr今天在种树,他在一条直线上挖了n个坑。这n个坑都可以种树,但为了保证每一棵树都有充足的养料,cyrcyr不会在相邻的两个坑中种树。而且由于cyrcyr的树种不够,他至多会种k棵树。假设cyrcyr有某种神能力,能预知自己在某个坑种树的获利会是多少(可能为负),请你帮助他计算出他的最大获利。输入输出格式输入格式:第一行,两个正整数n,k。第二行,n个正整数,第i个数表示在直线上从...
原创
108阅读
0评论
0点赞
发布博客于 3 年前

POJ 1113 Wall(凸包)

WallTime Limit: 1000MS Memory Limit: 10000KTotal Submissions: 40047 Accepted: 13648DescriptionOnce upon a time there was a greedy King who ordered his chief Architect to build a wall around the King's...
原创
35阅读
0评论
0点赞
发布博客于 3 年前

POJ 2187 Beauty Contest(凸包+旋转卡壳)

Beauty ContestTime Limit: 3000MS Memory Limit: 65536KTotal Submissions: 41266 Accepted: 12779DescriptionBessie, Farmer John's prize cow, has just won first place in a bovine beauty contest, earning th...
原创
114阅读
0评论
0点赞
发布博客于 3 年前

HDU 3739 Anti LIS(最小割)

Anti LISTime Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 607    Accepted Submission(s): 157Problem DescriptionHaven't you heard about Lost?Having...
原创
175阅读
0评论
0点赞
发布博客于 3 年前

CodeForce 985 E. Pencils and Boxes(dp+树状数组)

E. Pencils and Boxestime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputMishka received a gift of multicolored pencils for his birthday! Unfortunately...
原创
135阅读
0评论
0点赞
发布博客于 3 年前

CodeForce 985 D. Sand Fortress (二分)

D. Sand Fortresstime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputYou are going to the beach with the idea to build the greatest sand castle ever in...
原创
119阅读
0评论
0点赞
发布博客于 3 年前

CodeForce 986 C. AND Graph(dfs+位运算)

C. AND Graphtime limit per test4 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputYou are given a set of size mm with integer elements between 00 and 2n−12n−1 inclusive...
原创
209阅读
0评论
0点赞
发布博客于 3 年前

CodeForce 990 E. Post Lamps

E. Post Lampstime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputAdilbek's house is located on a street which can be represented as the OX axis. This ...
原创
223阅读
0评论
0点赞
发布博客于 3 年前

CodeForce 994 B. Knights of a Polygonal Table(线段树)

B. Knights of a Polygonal Tabletime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputUnlike Knights of a Round Table, Knights of a Polygonal Table depriv...
原创
170阅读
0评论
0点赞
发布博客于 3 年前

CodeForce 981 D. Bookshelves(贪心+dp)

D. Bookshelvestime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputMr Keks is a typical white-collar in Byteland.He has a bookshelf in his office with s...
原创
112阅读
0评论
0点赞
发布博客于 3 年前

CodeForce 981 E Addition on Segments(线段树+bitset优化01背包)

E. Addition on Segmentstime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputGrisha come to a contest and faced the following problem.You are given an a...
原创
129阅读
0评论
0点赞
发布博客于 3 年前

POJ 2104 K-th Number(主席树)

K-th NumberTime Limit: 20000MS Memory Limit: 65536KTotal Submissions:66103 Accepted: 23288Case Time Limit: 2000MSDescriptionYou are working for Macrohard company in data structures department. After f...
原创
97阅读
0评论
0点赞
发布博客于 3 年前

codeforce 149 D. Coloring Brackets(区间dp)

D. Coloring Bracketstime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputOnce Petya read a problem about a bracket sequence. He gave it much thought bu...
原创
75阅读
0评论
0点赞
发布博客于 3 年前

HDU 2476 String painter(区间dp)

String painterTime Limit: 5000/2000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 5659    Accepted Submission(s): 2695Problem DescriptionThere are two strings A and...
原创
79阅读
0评论
0点赞
发布博客于 3 年前

HDU 5151 Sit sit sit(区间dp)

Sit sit sitTime Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 531    Accepted Submission(s): 276Problem DescriptionThere are N chairs in a row and ...
原创
162阅读
0评论
0点赞
发布博客于 3 年前

HDU 5693 D Game(区间dp)

D GameTime Limit: 6000/3000 MS (Java/Others)    Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 1063    Accepted Submission(s): 380Problem Description众所周知,度度熊喜欢的字符只有两个:B 和D。今天,它发明了一个游戏:D...
原创
76阅读
0评论
0点赞
发布博客于 3 年前

HDU 4283 You Are the One(区间dp)

You Are the OneTime Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 5303    Accepted Submission(s): 2559Problem Description  The TV shows such as You...
原创
75阅读
0评论
0点赞
发布博客于 3 年前

HDU 5900 QSC and Master (区间dp)

QSC and MasterTime Limit: 2000/1000 MS (Java/Others)    Memory Limit: 131072/131072 K (Java/Others)Total Submission(s): 2850    Accepted Submission(s): 1005Problem DescriptionEvery school has some leg...
原创
69阅读
0评论
0点赞
发布博客于 3 年前

HDU 5115 Dire Wolf(区间dp)

Dire WolfTime Limit: 5000/5000 MS (Java/Others)    Memory Limit: 512000/512000 K (Java/Others)Total Submission(s): 3340    Accepted Submission(s): 2000Problem DescriptionDire wolves, also known as Dar...
原创
85阅读
0评论
0点赞
发布博客于 3 年前

HDU 4507 吉哥系列故事——恨7不成妻(数位dp)

吉哥系列故事——恨7不成妻Time Limit: 1000/500 MS (Java/Others)    Memory Limit: 65535/32768 K (Java/Others)Total Submission(s): 5696    Accepted Submission(s): 1848Problem Description  单身!  依然单身!  吉哥依然单身!  DS级码农吉...
原创
134阅读
0评论
0点赞
发布博客于 3 年前

SPOJ 10606 Balanced Numbers(数位dp)

BALNUM - Balanced Numbersno tags 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 o...
原创
208阅读
1评论
0点赞
发布博客于 3 年前

codeforce 55D D. Beautiful numbers(数位dp)

D. Beautiful numberstime limit per test4 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputVolodya is an odd boy and his taste is strange as well. It seems to him that a...
原创
89阅读
0评论
0点赞
发布博客于 3 年前

POJ 3252 Round Numbers(数位dp)

Round NumbersTime Limit: 2000MS Memory Limit: 65536KTotal Submissions: 15488 Accepted: 6312DescriptionThe cows, as you know, have no fingers or thumbs and thus are unable to play Scissors, Paper, Ston...
原创
66阅读
0评论
0点赞
发布博客于 3 年前

HDU 4352 XHXJ's LIS(数位dp)

XHXJ's LISTime Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 3838    Accepted Submission(s): 1604Problem Description#define xhxj (Xin Hang senior s...
原创
75阅读
0评论
0点赞
发布博客于 3 年前

HDU 3709 Balanced Number(数位dp)

Balanced NumberTime Limit: 10000/5000 MS (Java/Others)    Memory Limit: 65535/65535 K (Java/Others)Total Submission(s): 7215    Accepted Submission(s): 3464Problem DescriptionA balanced number is a no...
原创
77阅读
0评论
0点赞
发布博客于 3 年前

HDU 3652 B-number(数位dp)

B-numberTime Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 8160    Accepted Submission(s): 4822Problem DescriptionA wqb-number, or B-number for sho...
原创
58阅读
0评论
0点赞
发布博客于 3 年前

HDU 4734 F(x)(数位dp)

F(x)Time Limit: 1000/500 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 7761    Accepted Submission(s): 3046Problem DescriptionFor a decimal number x with n digits (...
原创
45阅读
0评论
0点赞
发布博客于 3 年前

2015 ACM Amman Collegiate Programming Contest L. Alternating Strings II(dp+线段树)

#include&lt;bits/stdc++.h&gt;using namespace std;char t[100003];int dp[100003];struct node{ int left,right,mid; int x;}tree[400004];void build(int l,int r,int rt){ tree[rt].left=l;...
原创
77阅读
0评论
0点赞
发布博客于 3 年前

2015 ACM Amman Collegiate Programming Contest I. Bahosain and Digits

题解:第一维枚举长度,第二维枚举0~9 代表最后所有数字的最终状态。当长度确定为i后,第一个数要想增加,操作的一定是区间1~i,当第一个数满足后,操作第二个数时,不能在影响第一个数,因此操作区间一定是2~i+1。代码:#include&lt;bits/stdc++.h&gt;using namespace std;char t[255];int a[255],s[255];i...
原创
75阅读
0评论
0点赞
发布博客于 3 年前

HDU 3586 Information Disturbing(树形dp+二分)

Information DisturbingTime Limit: 6000/3000 MS (Java/Others)    Memory Limit: 131072/65536 K (Java/Others)Total Submission(s): 4017    Accepted Submission(s): 1399Problem DescriptionIn the battlefield...
原创
66阅读
0评论
0点赞
发布博客于 3 年前

POJ 2486 Apple Tree

Apple TreeTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 11728 Accepted: 3966DescriptionWshxzt is a lovely girl. She likes apple very much. One day HX takes her to an apple tree. There are ...
原创
79阅读
0评论
0点赞
发布博客于 3 年前