排序:
默认
按更新时间
按访问量

Halloween Costumes LightOJ - 1422 (区间Dp)

Gappu has a very busy weekend ahead of him. Because, next weekend is Halloween, and he is planning to attend as many parties as he can. Since it's Ha...

2018-11-09 17:03:11

阅读数:10

评论数:0

Pangu and Stones HihoCoder - 1636 (区间dp)

In Chinese mythology, Pangu is the first living being and the creator of the sky and the earth. He woke up from an egg and split the egg into two par...

2018-11-07 11:35:20

阅读数:12

评论数:0

Divisors CodeForces - 448E

Bizon the Champion isn't just friendly, he also is a rigorous coder. Let's define function f(a), where a is a sequence of integers. Function f(a) re...

2018-11-06 11:01:52

阅读数:16

评论数:0

齿轮 HYSBZ - 4602

现有一个传动系统,包含了N个组合齿轮和M个链条。每一个链条连接了两个组合齿轮u和v,并提供了一个传动比x  : y。即如果只考虑这两个组合齿轮,编号为u的齿轮转动x圈,编号为v的齿轮会转动y圈。传动比为正表示若编号 为u的齿轮顺时针转动,则编号为v的齿轮也顺时针转动。传动比为负表示若编号为u的...

2018-11-06 11:01:09

阅读数:18

评论数:0

最小生成树 (prim)

void prim(int n) { int i,j,pos,min,sum=0; for(i = 1;i <= n;i++) { dist[i] = map[1][i]; } book[1] = 1; for...

2018-11-05 15:28:57

阅读数:8

评论数:0

Colonial Mansions Gym - 101962I (线段树+二分)

After a year of hard work, Mano finally had a month off. He decided to take his grandmother to Soteropolis during this time. As soon as they arrived ...

2018-11-02 15:24:45

阅读数:29

评论数:0

Press the Button ZOJ - 4056

BaoBao and DreamGrid are playing a game using a strange button. This button is attached to an LED light (the light is initially off), a counter and a...

2018-11-01 10:17:01

阅读数:17

评论数:0

Manacher

找最大回文串  ​ char s[1100]; char s_new[1100]; int p[1100]; int Init() { int len = strlen(s); s_new[0] = '$'; s_new[1] = '#'; int j = 2;...

2018-10-25 11:09:11

阅读数:30

评论数:0

最大流模板

EK 邻接矩阵 int f[maxn][maxn]; //流量 int p[maxn]; //上一个 int a[maxn]; //是否访问 int c[maxn][maxn]; //容量 int n,m; int maxflow(int s,int t) { queue&...

2018-10-25 09:54:17

阅读数:14

评论数:0

结构体重载运算符

struct node{ int a,b; node& operator + (node &xx) { a += xx.a; b += xx.b; } }; struct node...

2018-10-22 15:18:43

阅读数:19

评论数:0

dfs序

 dfs序 tree数组为线段树,len为线段树长度,lazy为懒惰数组 #include <bits/stdc++.h> using namespace std; const int maxn = 5e4+7; int n,m; vector&a...

2018-10-19 20:40:16

阅读数:10

评论数:0

Assign the task HDU - 3974 (dfs序+线段树)

There is a company that has N employees(numbered from 1 to N),every employee in the company has a immediate boss (except for the leader of whole comp...

2018-10-19 20:37:37

阅读数:10

评论数:0

Tunnel Warfare HDU - 1540

During the War of Resistance Against Japan, tunnel warfare was carried out extensively in the vast areas of north China Plain. Generally speaking, vi...

2018-10-19 19:22:08

阅读数:6

评论数:0

KMP模板

#include<iostream> #include<cstring> #include<cstdio> using namespace std; int nex...

2018-10-15 20:05:16

阅读数:10

评论数:0

从头到尾彻底理解KMP

1. 引言     本KMP原文最初写于2年多前的2011年12月,因当时初次接触KMP,思路混乱导致写也写得混乱。所以一直想找机会重新写下KMP,但苦于一直以来对KMP的理解始终不够,故才迟迟没有修改本文。     然近期因开了个算法班,班上专门讲解数据结构、面试、算法,才再次仔细回顾了这个...

2018-10-12 21:29:57

阅读数:14

评论数:0

逆序对

#include<iostream> using namespace std; int a[100]; int t[100]; int cnt=0; void merge_sort(int *a,int x,int y,int *T) { i...

2018-10-12 20:23:36

阅读数:5

评论数:0

种类并查集

判断是否存在两个属于一集合却又关系 #include <stdio.h> #include <algorithm> #include <iostream> #in...

2018-09-27 20:23:06

阅读数:23

评论数:0

第三届大中学生社团ACM程序设计大赛题解

A Alice 和 Bob 题意:两人取一堆石子 石子有n个  先手第一次不能全部取完但是至少取一个 之后每人取的个数不能超过另一个人上一次取的数的K倍 拿到最后一颗石子的赢 先手是否有必胜策略 若有 先手第一步最少取几个  思路: (1)首先k=1的时候 必败态是2^i 因为把数二进制分解后 ...

2018-09-26 11:25:34

阅读数:36

评论数:0

除法分块求区间约数和

LL get_sum(LL n){ LL ans = 0; for(LL l = 1,r;l <= n;l = r + 1){ r = n / (n / l); ans += (n / l) * (l + r) * (r - ...

2018-09-20 20:05:51

阅读数:41

评论数:0

Classy Numbers Codeforces Round 50 (数位DP)

output standard output Let's call some positive integer classy if its decimal representation contains no more than 33 non-zero digits. For example,...

2018-09-13 21:03:23

阅读数:37

评论数:0

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