自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+

残阳止水

ACM算法

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

原创 Packmen ( 二分答案 )

E. Packmentime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputA game field is a strip of 1 × n square cells. In some cells there are Packmen, i...

2018-03-31 15:38:16 401

原创 Riverside Curio(CF Round #472 D div2 思维水题)

D. Riverside Curiotime limit per test1 secondArkady decides to observe a river for n consecutive days. The river's water level on each day is equal to some real value.Arkady goes to the rivers...

2018-03-27 16:33:34 281

原创 STL中二分查找函数

1. binary_search(b.begin(),b.end(),n)//返回得是bool值,也适用于数组,用于判断有没有找到。#include <iostream>#include <cstdio>#include <vector>#include <algorithm>using namespace std;int main()...

2018-03-25 21:28:25 362

原创 Three-level Laser(cf Round#472 C)

C. Three-level Lasertime limit per test1 secondmemory limit per test256 megabytesAn atom of element X can exist in n distinct states with energies E1 < E2 < ... < En. Arkady wants to build a ...

2018-03-25 16:06:10 801 2

转载 线段树区间更新求和模板

线段树区间更新求和模板

2018-03-20 17:00:26 145

原创 Primal Sport ( 质数+思维 )

A. Primal Sporttime limit per test1.5 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputAlice and Bob begin their day with a quick game. They first choose a starting num...

2018-03-20 12:00:50 335

转载 素数O(n)打表

#include<iostream> #include<string.h> #include<stdio.h> #include<stdlib.h> #define maxn 10000000 bool visit[maxn+1000000]; int prime[maxn],n; ///pri...

2018-03-19 16:30:05 353

转载 牛顿迭代法实现开根号

理解:如何通俗易懂地讲解牛顿迭代法求开方?实现:牛顿法实现开根号根据牛顿迭代的原理,可以得到以下的迭代公式:X(n+1)=[X(n)+p/Xn]/2一般性的编程方法如下:double sqr(double n) { double k=1.0; while(abs(k*k-n)>1e-9) { //精度自己控制 k=(k+n/k)/2; } ...

2018-03-11 20:46:18 9307

原创 求根号(高效)

def sqrt(n):    l=0    r=n    while l<=r :        mi=(l+r)>> 1        F=mi*mi        if(F<n):            l=mi+1        elif(F>n): r=mi-1        else:            return mi    ...

2018-03-11 16:07:37 733

转载 AC自动机板子

ac自动机最详细的讲解定义全局变量int cnt;node *root;char pattern[70]; //模式串node *q[MAX];int head,tail;node *newnode;char key[maxn]; //主串定义每个字典树上节点的结构体变量struct node{ node *next[26]; node *fail; int s...

2018-03-10 10:42:46 177

原创 组合数板子

1. 预处理:#include<cstdio>const int N = 2000 + 5;const int MOD = (int)1e9 + 7;int comb[N][N];//comb[n][m]就是C(n,m)void init(){    for(int i = 0; i < N; i ++){        comb[i][0] = comb[i][i]...

2018-03-09 20:20:57 706

原创 Marjar Cola(zoj 3948)

Marjar Cola Time Limit: 1 Second      Memory Limit: 65536 KB Marjar Cola is on sale now! In order to a...

2018-03-08 15:10:19 215

原创 Query on a tree(hdu 3804 树链剖分+线段树 vector)

Query on a treeTime Limit: 15000/5000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 1298    Accepted Submission(s): 332Problem Description   There are some queries ...

2018-03-02 12:05:18 239

转载 线段树详解+模板

线段树详解+模板

2018-03-01 19:48:02 249 1

原创 Dylans loves tree(hdu 5274 树链剖分+线段树模板)

Dylans loves treeTime Limit: 2000/1000 MS (Java/Others)    Memory Limit: 131072/131072 K (Java/Others)Total Submission(s): 1884    Accepted Submission(s): 480Problem Description Dylans is given a tree...

2018-03-01 19:33:07 239

空空如也

空空如也

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

TA关注的人

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