自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+

I good vegetable a!

本人维护了一个数字图像各种论文复现工程,欢迎STAR: https://github.com/BBuf/

  • 博客(48)
  • 资源 (2)
  • 收藏
  • 关注

原创 2015多校第九场 HDU 5402 Travelling Salesman Problem 棋盘染色法,构造

题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=5402题意:现有一个n*m的迷宫(n行m列),每一个格子都有一个非负整数,Teacher Mai想要从迷宫的左上角(1,1)到迷宫的右下角(n,m),并且使得他走过的路径的整数之和最大,问最大和为多少以及他走的路径。解法:为什么要这么做?看论文:点击打开链接 这是棋盘染色的论文知道这

2017-07-31 16:53:50 392

原创 美团CODEM 复赛 城市网络 询问离线,树上LCA

有一个树状的城市网络(即 n 个城市由 n-1 条道路连接的连通图),首都为 1 号城市,每个城市售卖价值为 a_i 的珠宝。你是一个珠宝商,现在安排有 q 次行程,每次行程为从 u 号城市前往 v 号城市(走最短路径),保证 v 在 u 前往首都的最短路径上。在每次行程开始时,你手上有价值为 c 的珠宝(每次行程可能不同),并且每经过一个城市时(包括 u 和 v ),假如那个城市中售卖的珠宝

2017-07-31 15:16:33 361

原创 美团CODEM复赛 配对游戏 概率DP

时间限制:1秒空间限制:262144K美团点评是综合性生活服务平台,覆盖吃喝玩乐。在休闲娱乐版块,有很多轰趴、桌游、密室逃脱类的项目,适合多人一起玩。下面就是出自团队游戏场景中的一个问题。有 n 个人排成一排,一开始全部面向前方,然后大家一起转身,随机朝左或是朝右转。转身后,不断检查队列,如果存在两个面对面的相邻的人,则将这两个人从队列中消除;直到不存在两个面对面的相邻的人。

2017-07-31 14:24:21 388

原创 2015多校第九场 HDU 5399 Too Simple

题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=5399题意:求满足f1(f2(...(fm(i))...))=i的未知的函数有多少种可能。解法:已经膜得如此明显了。。答案是(n!)^(m-1),m为-1的个数,因为m个不确定的函数,其中的m-1个固定了,那么还有一个也就固定了。每个不确定的都有n!种方案。如果m为0,则有0种或者1种方案。

2017-07-30 19:51:01 332

原创 2015多校第九场 HDU 5396 Expression 区间DP,组合数

题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=5396题意:给你n个数和n-1个操作符(2解法:题解来自:点击打开链接设dp[i][j]为第i个数到第j个数的所有方案的和,那么假设我们已经枚举到区间i,j(i dp[i][j] += (dp[i][k] * A[j - (k + 1)] % mod + dp[k + 1][j] * A[k

2017-07-30 15:36:23 392

原创 2015多校第九场 HDU 5400 Arithmetic Sequence 数学

题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=5400题意:定义(d1,d2)算术序列为:对于给定的序列b1,b2,...,bn,存在i使得bj+1=bj+d1( j∈[1,i) );bj+1=bj+d2(j∈[i,n)).现在给出d1,d2和一个序列a1,a2,...,an,找出有多少个区间[l,r]满足(d1,d2)算术序列。解法:我们可

2017-07-30 14:28:15 278

原创 HDU 5413 拓扑排序+BITSET

题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=5413题意:给定一张有向图,对于边eu,v>,如果去掉它的话,u仍然可以到达v的话,那么这条边就是多余边。解法:显然的一个思路是倒着做。先topo一遍,然后倒着来,这里需要用到bitset维护每个点可以和哪些点直接相连,利用bitset是为了不超内存,然后用bitset处理出关系之后就可以遍历寻

2017-07-30 11:01:56 340

原创 2017多校第二场 HDU 6040 Hints of sd0061 快速排序

题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=6040题意:通过题目所给函数求出a数组,然后根据b数组排a数组。ai必须是a数组中第(bi+1)大的数。解法:先通过下标对b数组排序。然后扫一遍b数组,如果相邻两个位置b相同,那么就还选上一个a(因为n可以小于m),所以可以多选。然后就可以利用快拍的思想来优化。因为是bi+1个数,所以可以把比a[bi+1

2017-07-30 09:17:50 358

原创 2017多校第二场 HDU 6048 Puzzle 逆序数,脑洞题,结论题

题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=6048题意: 给你一个N*M的矩阵,从上到下从左到右,依次填1, 2, 3,…右下角为空,每次可以把一个和空格有公共边的块和空格交换。按照特定方式打乱,问是否有解。解法:完全不会。然后最终结论就是按照第一行,第二行,第三行,。。。合并成一个一维数组,数组的逆序对数为偶数则有解,否则无解。直接应用官方

2017-07-29 19:57:31 1241

原创 2017多校第二场 HDU 6049 Sdjpx Is Happy 区间DP,复杂度优化

题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=6049 题意:一个序列,你可以把一些元素拿出来组成一个小序列,但是要保证小序列是连续的,你确定了小序列之后可以交换一次两个小序列,问你能不能让这个序列变成1-n的序列,并且要你找到最多分成多少个小序列,求最大值。解法:我的代码,几乎抄了标程的。我再按照我的理解复述一次题解。代码里面的。 //mn[i]

2017-07-29 17:25:47 349

原创 2017多校第二场 HDU 6050 Funny Function 推公式

题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=6050解法:对于构造矩阵感觉自己不怎么会,我选择了找规律,我首先推出了每个f1,i和和f1,1的关系,发现它们的系数是1,1,3,5,11, 21,发现这个用2^n近似之后模3等于?多推了几次发现要用(-1)^n来修正一下。那么通项公式就可以推出来 f(n) = (2^n-(-1)^n/3)*f(1)。

2017-07-29 11:51:02 317

原创 2017多校第二场 HDU 6053 TrickGCD 莫比乌斯反演

Problem Description You are given an array A , and Zhu wants to know there are how many different array B satisfy the following conditions?1≤Bi≤AiFor each pair( l , r ) (1≤l≤r≤n) , gcd(bl,bl+1…br)≥2

2017-07-29 09:53:46 438

原创 2017多校第二场 HDU 6047 Maximum Sequence 线段树或者multiset维护区间最值

Problem Description Steph is extremely obsessed with “sequence problems” that are usually seen on magazines: Given the sequence 11, 23, 30, 35, what is the next number? Steph always finds them too eas

2017-07-27 20:59:43 370

原创 2017多校第二场 HDU 6053 TrickGCD 容斥,素数,思维

Problem Description You are given an array A , and Zhu wants to know there are how many different array B satisfy the following conditions?1≤Bi≤AiFor each pair( l , r ) (1≤l≤r≤n) , gcd(bl,bl+1…br)≥2

2017-07-27 20:53:52 387

原创 2017多校第一场 HDU 6041 I Curse Myself Tarjan找环+K路归并

Problem Description There is a connected undirected graph with weights on its edges. It is guaranteed that each edge appears in at most one simple cycle.Assuming that the weight of a weighted spanning

2017-07-27 10:53:55 584

原创 2017多校第一场 HDU 6044 Limited Permutation 思维,计数,DFS

Problem Description As to a permutation p1,p2,⋯,pn from 1 to n, it is uncomplicated for each 1≤i≤n to calculate (li,ri) meeting the condition that min(pL,pL+1,⋯,pR)=pi if and only if li≤L≤i≤R≤ri for e

2017-07-26 21:10:34 462

原创 2017多校第一场 HDU 6038 Function 循环节,脑洞,大思维题

Problem Description You are given a permutation a from 0 to n−1 and a permutation b from 0 to m−1.Define that the domain of function f is the set of integers from 0 to n−1, and the range of it is the

2017-07-26 19:04:38 539

原创 2017 多校第一场 HDU 6035 Colorful Tree 虚点,DFS,计算贡献

Problem Description There is a tree with n nodes, each of which has a type of color represented by an integer, where the color of node i is ci.The path between each two different nodes is unique, of w

2017-07-26 15:11:06 491

原创 2017多校第二场 HDU 6052 To my boyfriend 思维,计数题

题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=6040题意:给了一个生成的数列,给了m个查询,每次查第x大的数。解法:数据结构?听说可以分块。给队友说了这题,他掏出快排秒了。首先这道题的弱化版就是如何利用快拍查询序列第K大,那就是快拍的时候二分往左右走就可以了。这里查询m个数怎么办呢?我们m个数离线下来,并且排序,类似于一个数那样去做。然后这里就是二分

2017-07-25 20:14:24 450

原创 2017多校第一场 HDU 6034 Balala Power! 贪心,细节题

题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=6034题意:给了N个字符串,字符都是小写的,每一个字符可以对应一个0-25的数字,所有的字符串需要满足,如果字符不相同那么数字也不相同,就是要一一映射。问转换之后,在26进制意义下的和的最大值。解法:我队很快就想到了利用每个字符相对于位权的贡献去贪心,然后交了几次WA。之后另外一个队友提醒前导0的情况没有

2017-07-25 19:22:50 418

原创 HDU 5411 CRB and Puzzle 等比矩阵的和如何求解?

Problem Description CRB is now playing Jigsaw Puzzle. There are N kinds of pieces with infinite supply. He can assemble one piece to the right side of the previously assembled one. For each kind of

2017-07-24 19:27:12 355

原创 HDU 5409 CRB and Graph Tarjan求桥,点双联通+思维好题

Problem Description A connected, undirected graph of N vertices and M edges is given to CRB. A pair of vertices (u, v) (u < v) is called critical for edge e if and only if u and v become disconnected

2017-07-24 15:39:14 431

原创 HDU 5416 CRB and Tree 异或前缀和

Problem Description CRB has a tree, whose vertices are labeled by 1, 2, …, N. They are connected by N – 1 edges. Each edge has a weight. For any two vertices u and v(possibly equal), f(u,v) is xor(ex

2017-07-24 10:11:09 432

原创 HDU 5414 CRB and String 思维好题

Problem Description CRB has two strings s and t. In each step, CRB can select arbitrary character c of s and insert any character d (d ≠ c) just after it. CRB wants to convert s to t. But is it poss

2017-07-23 21:27:11 304

原创 HDU 5412 CRB and Queries 树套树 BIT+PBDS

Problem Description There are N boys in CodeLand. Boy i has his coding skill Ai. CRB wants to know who has the suitable coding skill. So you should treat the following two types of queries. Query

2017-07-23 20:04:22 430

原创 HDU 5410 CRB and His Birthday 01背包和完全背包混合

Problem Description Today is CRB’s birthday. His mom decided to buy many presents for her lovely son. She went to the nearest shop with M Won(currency unit). At the shop, there are N kinds of presen

2017-07-23 15:22:59 232

原创 HDU 5407 CRB and Candies 数论

Problem Description CRB has N different candies. He is going to eat K candies. He wonders how many combinations he can select. Can you answer his question for all K(0 ≤ K ≤ N)? CRB is too hungry to

2017-07-23 14:47:26 348

原创 HDU 5406 CRB and Apple

Problem Description In Codeland there are many apple trees. One day CRB and his girlfriend decided to eat all apples of one tree. Each apple on the tree has height and deliciousness. They decided t

2017-07-22 20:33:51 444

原创 Educational Codeforces Round 21 题解

比赛链接:http://codeforces.com/contest/808A. Lucky Year 水题#include <bits/stdc++.h>using namespace std;typedef long long LL;int main(){ LL n; scanf("%lld", &n); if(n<10){ printf("1\

2017-07-20 15:19:42 410

原创 LOJ#117 有源汇有上下界最小流

题目链接:https://loj.ac/problem/117解法:(1)增加超级源点st和超级汇点sd,对于有上下界的边(i,j)流量(L,R)变为R-L,然后i与sd连接容量是L,st与j连接容量是L;网络中规定不能有流量流入st,也不能有流量流入sd;(2)做一次最大流Dinic;(3)在汇点sd到st连一条容量是inf的边;(4)在做一次最大流Dinic(5)当且仅当附加弧都满流是有可行流,

2017-07-19 21:27:27 828 2

原创 LOJ #116. 有源汇有上下界最大流

题目链接:https://loj.ac/problem/116解法:建图模型:源点s,终点d。超级源点ss,超级终点dd。首先判断是否存在满足所有边上下界的可行流,方法可以转化成无源汇有上下界的可行流问题。怎么转换呢?增设一条从d到s没有下界容量为无穷的边,那么原图就变成了一个无源汇的循环流图。接下来的事情一样,超级源点ss连i(du[i]>0),i连超级汇点(du[i]<0),对(ss,dd)进行

2017-07-19 20:13:11 1021

原创 LOJ #115. 无源汇有上下界可行流

题目链接:https://loj.ac/problem/115解法:#include <bits/stdc++.h>using namespace std;const int mn=22222;const int mm=1000000;const int oo=0x3fffffff;int node, st, sd, edge, Edge;int reach[mm], flow[mm],

2017-07-19 19:11:50 455

原创 Educational Codeforces Round 25 题解

A. Binary Protocol水题,模拟统计出连续的0隔开的每段1的个数即可。#include <bits/stdc++.h>using namespace std;char s[110];int n;int main(){ while(~scanf("%d", &n)){ scanf("%s", s); int len = strlen(s)

2017-07-19 10:36:35 365 1

原创 BZOJ 3196 二逼平衡树 树套树

Description您需要写一种数据结构(可参考题目标题),来维护一个有序数列,其中需要提供以下操作: 1.查询k在区间内的排名 2.查询区间内排名为k的值 3.修改某一位值上的数值 4.查询k在区间内的前驱(前驱定义为小于x,且最大的数) 5.查询k在区间内的后继(后继定义为大于x,且最小的数) Input第一行两个数 n,m 表示长度为n的有序序列和m个操作 第二行有n个数,表示

2017-07-18 12:34:14 273

原创 #516. 「LibreOJ β Round #2」DP 一般看规律 set启发式合并

题目链接:https://loj.ac/problem/516题意:给出操作,将序列中所有一个数字替换为另一个,询问每次操作后距离最近的两个相同数字的距离。解法:每个数字只与他的前驱和后继产生贡献。构建n个set,每次将较小的暴力合并到大的上面,通过lower_bound来找到他的前驱和后继。懒得离散化可以用map来存set。#include <bits/stdc++.h>using namesp

2017-07-17 19:56:40 801

原创 #515. 「LibreOJ β Round #2」贪心只能过样例

题目链接:https://loj.ac/problem/515解法:记录 LibreOJ的第一个题,直接bitset暴力即可。#include <bits/stdc++.h>using namespace std;const int maxn = 1e6+10;int n, l, r;bitset <maxn> b[110];int main(){ while(~scanf("%d

2017-07-17 19:01:02 697

原创 Educational Codeforces Round 22 题解

比赛链接:http://codeforces.com/contest/813A. The Contest题目比较长,读懂后,模拟即可。#include <bits/stdc++.h>using namespace std;const int maxn = 1010;int n, m, x, l, r, sum;int main(){ while(~scanf("%d",&n)){

2017-07-17 16:02:50 444

原创 美团CODEM 初赛B 景区路线规划 概率DP

美团旅行团队最近打算推出一项新服务,为景区的各个景点规划游览路线,提升游客满意度。其中一个重要的问题是对于一个景区道路网,求出游客的满意度的期望值。基于用户的喜好差异,我们需要对男性游客和女性游客的满意度分别计算。 景区被描述成一张n个点、m条边的无向图(无重边,无自环)。每个点代表一个景点,第i个景点游览需要耗费ci分钟,会让男性游客和女性游客的满意度分别增加h1i和h2i(满意度初始值都为0)

2017-07-16 17:52:51 683

原创 CodeM美团点评编程大赛初赛B轮 B.送外卖2 三进制状压DP

[编程题] 送外卖2时间限制:1秒空间限制:32768K 美团外卖日订单数已经超过1200万,实时调度系统是背后的重要技术支撑,其中涉及很多复杂的算法。下面的题目是某类场景的抽象。一张 n 个点 m 条有向边的图上,有 q 个配送需求,需求的描述形式为( s_i , t_i , l_i , r_i ),即需要从点 s_i 送到 t_i, 在时刻 l_i 之后(包括 l_i)可以在 s_i 领取货物

2017-07-16 17:16:37 1181

原创 Codeforces Round #417 (Div. 2) 题解

比赛地址:http://codeforces.com/contest/812A. Sagheer and Crossroads题目的意思是给出4个路口的车辆和人的红路灯状态,判断是否可能车撞人。关键是题意,然后模拟,注意细节。#include <bits/stdc++.h>using namespace std;int l[5], s[5], r[5], p[5];int main(){

2017-07-15 20:56:35 293

ncsdk-windows.rar

vs2015 movidius 神经计算棒一代 ncsdk windows c++调用SequeezeNet的代码。

2019-09-10

cs231-斯坦福大学-李菲菲-2016 课件

深度学习,李菲菲教授,课件。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。

2018-01-30

空空如也

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

TA关注的人

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