自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+

老街#

或许只有你懂的我所以你没逃脱

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

转载 MapReduce: Simplified Data Processing on Large Clusters MapReduce:面向大型集群的简化数据处理

摘要MapReduce既是一种编程模型,也是一种与之关联的、用于处理和产生大数据集的实现。用户要特化一个map程序去处理key/value对,并产生中间key/value对的集合,以及一个reduce程序去合并有着相同key的所有中间key/value对。本文指出,许多实际的任务都可以用这种模型来表示。用这种函数式风格写出的程序自动就拥有了在一个大的PC机集群上并行执行的能力。运行时系统会负责细节:切分输入数据,在一组机器上调度执行程序,处理机器错误,以及管理所需的机器间通信。这允许不具备任何并行和

2020-10-29 14:52:03 1281

原创 2019牛客暑期多校训练营(第七场)H Pair

题意:给定A、B、C,问1<=x<=A,1<=y<=B,有多少对(x,y)满足x&y>c或x^y<c。思路:考虑约束条件的反面,计算满足x&y<=c并且x^y>=c的对数,数位dp。#include<bits/stdc++.h>using namespace std;typedef long long ll;...

2019-08-09 14:34:28 152

原创 hdu6579区间线性基

题意:0操作,询问[l,r]区间内选取一些数的最大区间异或和。1操作在原数组后加一个数。注意强制在线#include<iostream>using namespace std;struct node{ int idd,num;}sub[1000000+10][32];int a[1000000+10];int main(){ int t; s...

2019-07-26 21:31:12 513

原创 Codeforces Round #538 (Div. 2)D.Flood Fill

https://codeforces.com/contest/1114/problem/Do(n^2)求最长回文子序列#include&lt;iostream&gt;#include&lt;algorithm&gt;#include&lt;cstring&gt;#include&lt;cmath&gt;using namespace std;typedef long long ...

2019-02-11 14:55:37 205

原创 div2之旅001

https://codeforces.com/contest/1082/problem/E题意:n个正数,每个数大小不超过500000。给定c,有一个操作可将任意区间[l,r]之间的所有数同时加减x,只能操作一次,问[1,n]中最多有几个c,输出c的个数。思路:设cnt(l,r,d)表示为[l,r]之间d的个数,即题求max(cnt(1,l-1,c)+cnt(l,r,d)+cnt(r+1,...

2018-12-05 20:45:13 111

原创 HihoCoder1312八数码问题(启发式搜索

https://hihocoder.com/problemset/problem/1312题意:是中文思路:启发式搜索意求从一个状态到另一个状态hash每个状态存在一个数组里,排序,用二分找当前状态的下标。bfs每种状态,如果和最终状态相同则更新答案。话不多说看代码吧#include&lt;cstdio&gt;#include&lt;vector&gt;#includ...

2018-09-26 21:27:26 425

原创 Gym 101879C(dfs+图论

http://codeforces.com/gym/101879/problem/C题意:有n个小岛,已经有m条无向边相连,有k条无向边待选,问能否选择一些边使得能从一个点出发不重复走遍每一条边并回到起点,输出待选的边数量和选的边的起点和终点,不行的话输出NO思路:欧拉回路满足题意,而满足欧拉回路的充要条件是每个点的度都为偶数(无向图)。所以先记下每个点的度数,用待选的边建图,然后开始深搜...

2018-09-25 20:58:48 363

原创 poj3373(DFS+剪枝

大佬博客更详尽 https://blog.csdn.net/lyy289065406/article/details/6698787/题意:思路:搜索当区间[0,pos](反转过)剩余可改变restnum个数字时,当前数字是多少,能否余k为0要点:1、预处理mod[i][i] = 10^i * j % k  2、在看博客的时候发现了两种搜索风格①这样是先确定把当...

2018-09-22 20:19:20 187

原创 hdu6341(DFS暴搜+剪枝

题意:给一个16*16的矩阵,由16个4*4的小矩阵构成。问最少将给出矩阵中的小矩阵顺时针旋转几次可以满足数独条件(每一行、每一列、每一个小矩阵都由1~F组成思路:暴力枚举每个矩阵旋转0~3次后的样子,在每次旋转填完后判断当前矩阵是否合法(剪枝#include&lt;bits/stdc++.h&gt;#include&lt;map&gt;using namespace std;ch...

2018-09-13 10:09:51 222

原创 Rikka with Line Graph(弗洛伊德最短路拓展

题目链接:https://www.nowcoder.com/acm/contest/148/F越来越懒的写题意和思路了。。。(just截图放上截图也是为了以后不用搜。。那再写一些自己的思路:先跑出每两个点之间的最短路o(n^3),枚举两个点,再把其他点到该两点的最短路取min放到vector里,排序,对于每个点作为经过路径做出的贡献是比他大的点的个数(好吧我也不知道在写...

2018-08-19 21:05:49 418

原创 HDU6370(思维+搜索

题意:现在有N个人,每个人要么是第一类:说的全是真话;要么是第二类:说的可能是假话。每一个人x都指认另一个人y是第一类或第二类人。请问在所有合法的情况下,有多少人必定是第一类人、有多少人必定是第二类人?思路:(首先题解送上当然其实没怎么懂。。我也不是这么写的主要点:然后再xjb补充一下吧,以防以后看不懂(反正都是别的博客上截来的 反正我的写法就是找出...

2018-08-16 22:03:21 338

原创 HDU6386(最短路变形

一句话题解: 不会用题解写的做。。。 题意:给你一个图,每条边有一个价值。从1走到n,每次路径的价值发生变化花费就会+1,问最少花费。如果走不到n点输出-1。思路:bfs搜索,每走到一个点入队。每次取队首元素出队,dfs该结点能走到的所有不需要花费的结点(路径价值与之前的相同),如果该结点未被访问过则更新花费,并入队。到n的最短路一定会先被搜索到,因为bfs每次的花费都在增...

2018-08-15 21:24:50 363

原创 多维线段树 Jumping Haybales

Farmer John's cows have grown lazy and he would like to get them back in shape! Hehas decided that the best way to do this is by setting up haybales in the field and havingthe cows jump from the n

2017-12-05 19:36:55 386

原创 hdu1556涂气球

Color the ball N个气球排成一排,从左到右依次编号为1,2,3....N.每次给定2个整数a b(a Input每个测试实例第一行为一个整数N,(N 当N = 0,输入结束。Output每个测试实例输出一行,包括N个整数,第I个数代表第I个气球总共被涂色的次数。Sample Input31 12 23 331 11 21

2017-09-27 01:06:41 456

原创 求树的直径

zjnu1361树的最远距离--中高级Time Limit: 1000MS Memory Limit: 1000KTotal Submissions: 33 Accepted: 8Description给定一棵树,求这棵树中距离最远的两个节点的距离。【限制】50%的数据满足:1100%的数据满足:1Input第一行是一个正整数n,表示这棵树的节点

2017-09-24 19:54:17 314

原创 矩形面积并

hdu1542 AtlantisTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 14285 Accepted Submission(s): 5896Problem DescriptionThere are seve

2017-09-24 18:12:39 470

原创 线段树2.0+dfs序

poj3321Apple TreeThere is an apple tree outside of kaka's house. Every autumn, a lot of apples will grow in the tree. Kaka likes apple very much, so he has been carefully nurturing the big apple

2017-09-23 18:44:34 164

原创 强力kmp

hdu6208The Dominator of StringsTime Limit: 3000/3000 MS (Java/Others) Memory Limit: 65535/32768 K (Java/Others)Total Submission(s): 2680 Accepted Submission(s): 970Problem DescriptionH

2017-09-20 19:48:54 133

原创 三分

HDU - 3714Josephina is a clever girl and addicted to Machine Learning recently. Shepays much attention to a method called Linear Discriminant Analysis, which has many interesting propertie

2017-08-16 18:22:37 150

原创 DFS+奇偶剪枝

hdu1010 Tempter of the BoneProblem DescriptionThe doggie found a bone in an ancient maze, which fascinated him a lot. However, when he picked it up, the maze began to shake, and the doggie could

2017-08-16 14:02:30 168

原创 主席数

HDU 2665 Kth numberGive you a sequence and ask you the kth big number of a inteval.InputThe first line is the number of the test cases. For each test case, the first line contain two integ

2017-08-14 15:58:45 278 1

原创 树形dp(校园聚会)

HDU - 1520 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 re

2017-08-09 09:38:10 268

原创 概率dp(抓老鼠)

CodeForces - 148D The dragon and the princess are arguing about what to do on the New Year's Eve. The dragon suggests flying to the mountains to watch fairies dancing in the moonlight, while the

2017-08-09 09:31:06 527

原创 数位dp(平衡数)

hdu3709 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

2017-08-07 16:50:50 452

原创 素数筛法

Prime Distance POJ - 2689 The branch of mathematics called number theory is about properties of numbers. One of the areas that has captured the interest of number theoreticians for thousands of year

2017-08-04 19:21:50 191

原创 中国剩余定理(孙子定理)

One day I was shopping in the supermarket. There was a cashier counting coins seriously when a little kid running and singing "门前大桥下游过一群鸭,快来快来 数一数,二四六七八". And then the cashier put the counted coins ba

2017-08-04 16:27:47 273

原创 扩展gcd

Ms. Iyo Kiffa-Australis has a balance and only two kinds of weights to measure a dose of medicine. For example, to measure 200mg of aspirin using 300mg weights and 700mg weights, she can put one 700mg

2017-08-03 20:48:49 203

原创 计算几何专题(计算两圆相交面积)

There are two circles in the plane (shown in the below picture), there is a common area between the two circles. The problem is easy that you just tell me the common area. InputThere are many cases.

2017-07-31 16:53:40 4025

原创 错排模板

大家常常感慨,要做好一件事情真的不容易,确实,失败比成功容易多了! 做好“一件”事情尚且不易,若想永远成功而总从不失败,那更是难上加难了,就像花钱总是比挣钱容易的道理一样。 话虽这样说,我还是要告诉大家,要想失败到一定程度也是不容易的。比如,我高中的时候,就有一个神奇的女生,在英语考试的时候,竟然把40个单项选择题全部做错了!大家都学过概率论,应该知道出现这种情况的概率,所以至今我都觉得这

2017-07-28 17:03:50 190

原创 容斥原理模板

容斥原理模板:例如:给你n,m,表示有n个数,让你求1-m之间是这n个数的倍数的一共有几个,m通常很小思路:例如2 3的倍数有多少个,我们会把6的倍数算两次,所以答案就应该是2的倍数+3的倍数-lcm(2,3)的倍数,同样多个数的时候也按照这种想法做下去就好了,把n个数存在a数组里,容斥原理求答案即为m/a[0]+m/a[1]+.....+m/a[n-1]-m/lcm(a[

2017-07-28 16:54:36 238

原创 整数拆分种类(五边形数定理)

How many ways can the numbers 1 to 15 be added together to make 15? The technical term for what you are asking is the "number of partition" which is often called P(n). A partition of n is a collection

2017-07-28 16:48:36 1174

原创 线段树1.0 求区间sum

哇第一次手写线段树好激动好激动好激动!#include#include#include#include#includeusing namespace std;int a[20000+5];struct node{ int l, r, sum;}tree[20000*4];int ans;int built(int root, int l, int r

2017-07-28 13:59:53 205

原创 二分2.0(double)

The main road in Bytecity is a straight line from south to north. Conveniently, there are coordinates measured in meters from the southernmost building in north direction.At some points on the road

2017-07-27 21:14:43 400

原创 二分1.0

#include#include#includeusing namespace std;int main(){ int t; scanf("%d", &t); while(t--) { int n, m;//二分m scanf("%d%d", &n, &m); int i, j, x, znum = 0; int flag[m+5]; memset(flag

2017-07-27 20:20:27 137

转载 匈牙利算法,二分图的最大匹配

#include#include#includeusing namespace std;#includeint match[1005], vis[1005];int n, m;int map[1005][1005];bool dfs(int u){ for(int v=1;v<=n;v++) if(map[u][v]&&!vis[v]) { vis[v]=

2017-07-21 17:00:12 207

空空如也

空空如也

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

TA关注的人

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