自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(31)
  • 收藏
  • 关注

原创 主席树

空间稍微超了一点,不过只要不存 l,r 即可#include<bits/stdc++.h>using namespace std;const int maxn=2e5+2;const int mems=3600000;map<int,int>bts,stb;int ls;int n,m;int a[maxn];struct tree{ str...

2019-08-24 10:54:01 124

原创 AtCoder Beginner Contest 138 F - Coincidence

首先对 x,y 进行分类讨论(二进制形式) 1) y 1?????? x 0?????? ------------------------------ y xor x 1??????? y modx 0??????不符合条件,对各种条件分类得知 只有以下...

2019-08-19 17:18:46 471

原创 MemSQL Start[c]UP 2.0 - Round 2 - Online Round D. Bingo!

D. Bingo!题解见此:https://blog.csdn.net/v5zsq/article/details/79010405另:由于幂次太高,因此取对数后做处理c++中 log(x) 表示的是 ln(x)最后再取e指数 exp(x)#include<bits/stdc++.h>using namespace std;typedef long d...

2019-08-18 18:14:44 210

原创 Codeforces Round #239 (Div. 1)

C. Curious Array高阶差分 自己如果举个例子会更好理解https://www.cnblogs.com/ChopsticksAN/p/4908377.html推式子:https://www.luogu.org/blog/MILLOPE/solution-cf407cps:预处理范围不要弄错#include<bits/stdc++.h>using n...

2019-08-15 19:42:31 125

原创 Codeforces Round #228 (Div. 1)

B. Fox and Minimal path原题链接http://codeforces.com/contest/388/problem/B一道构造题,要想到二进制构造。由原题题解建图方式如下:就是让各层点最短路数目成为二进制 : 【1 1】 【...

2019-08-11 23:18:36 180

原创 树上启发式合并 (dsu on tree)

https://blog.csdn.net/QAQ__QAQ/article/details/53455462https://blog.csdn.net/QAQ__QAQ/article/details/53455462#include<bits/stdc++.h>using namespace std;const int maxn=1e5+5;int n,col...

2019-08-11 16:10:17 120

原创 Educational Codeforces Round 69 (Rated for Div. 2)

直接贴原网站题解了 代码是自己的1197C - Array SplittingIdea:RomsTutorial1197C - Array Splittingcode:#include<bits/stdc++.h>using namespace std;const int maxn=3e5+5;int n,k;int a[maxn];p...

2019-07-26 23:14:03 81

原创 NOIP2018

day1 爆炸了希望day2能翻upd:day2貌似苟住了看day1了估计afo了afo了 其实day1还好 day2炸了233好好学文化课了希望大学还能打acm到时候再用这个博客了...

2018-11-13 19:58:43 247

原创 fread模板

char buf[1<<24];char *P;void qread(){fread(buf,1,1<<24,stdin);P=&buf[0];}char get_char(){return *P++;}int readint(){ char ch;int x=0,f=1; for(;;){ch=get_char();if(ch=='-'){...

2018-11-07 10:59:45 237

原创 状压枚举子集

https://blog.csdn.net/yanzhenhuai/article/details/81572028https://blog.csdn.net/jackypigpig/article/details/79660522?tdsourcetag=s_pcqq_aiomsg

2018-11-07 09:26:12 198

原创 扫描线

https://www.cnblogs.com/yangsongyi/p/8378629.htmlhttps://www.cnblogs.com/whywhy/p/4214353.html

2018-11-06 10:52:35 107

原创 prufer序列

https://blog.csdn.net/zchlww/article/details/39737211https://blog.csdn.net/silence401/article/details/60779496-----http://www.matrix67.com/blog/archives/682

2018-11-05 16:01:40 303

转载 高精度模板

c++没有高精度类,很气,于是弄了一个高精度模板#include <algorithm>#include <cassert>#include <cstdio>#include <cstring>#include <iostream>#include <string>#include <vector&gt...

2018-10-31 15:30:53 80

原创 【noip2014】 解方程

一开始想的是快速幂 然而复杂度不对后来发现秦九韶算法 可以O(n)计算n次多项式https://baike.baidu.com/item/%E7%A7%A6%E4%B9%9D%E9%9F%B6%E7%AE%97%E6%B3%95/449196?fr=aladdin然后就卡着时间过了#include&lt;bits/stdc++.h&gt;using namespace std;...

2018-10-23 14:57:15 139

原创 【noip2014】飞扬的小鸟

首先写出 nm^2 的dp,然后化简式子,发现可以降为 nm 的dp (就是背包)#include&lt;bits/stdc++.h&gt;using namespace std;const int maxn=1e4+5,maxm=1005,inf=2e9;int n,m,k;int X[maxn],Y[maxn];struct Plum{ int p,l,h; ...

2018-10-22 20:31:43 251

转载 Vim 高亮显示、默认tab缩进数等设置

在linux上存在一个vim的配置文件:.vimrc,通过vim ~/.vimrc 进入配置文件,通过设置syntax on重新开启代码的高亮显示。当然,我们还可以进行其他的设置,具体设置如下所示:set nu      #行号set tabstop=4   #一个tab为4个空格长度set ai            #设置自动缩进--------------------- 作者:躬...

2018-10-18 23:06:36 213

原创 c++ 开栈命令

-Wl,--stack=123456789 (Dev-c++中)#pragma comment(linker, "/STACK:102400000,102400000") (Linux中)devc++如何设置-Wall

2018-10-15 14:11:01 3495

原创 【noip】2016 运输计划

可以使用树剖 nlog^2n 卡常后能过 就是码量有点大详解在这里:https://www.luogu.org/blog/29354/solution-p2680#include&lt;bits/stdc++.h&gt;#define R registerusing namespace std;const int maxn=3e5+5;char *P;void QREAD()...

2018-10-13 21:36:38 578

转载 【noip】子串

https://www.luogu.org/blog/frankchenfu/solution-p2679https://blog.sengxian.com/solutions/noip-2015-day2主要考察动态规划的思想。设f[i][j][k]f[i][j][k]为串AA匹配到第i - 1i−1个位置(位置从00开始),串BB匹配到j - 1...

2018-10-06 21:12:24 207 1

原创 洛谷 P1642 规划

题目链接:规划01分数规划证明:https://www.cnblogs.com/BLADEVIL/p/3511013.html我觉得只要感性理解就好了教程:https://www.cnblogs.com/Hallmeow/p/7750483.html题解: 设产值为ci,污染值为pi, 设,转化为:如果,说明k可以进一步增大,所以考虑二分k。于是将物品权值转化为, 并...

2018-10-03 18:18:15 288

原创 【NOIP2016】天天爱跑步

天天爱跑步参考了https://www.cnblogs.com/ljh2000-jump/p/6189053.html的博客详细做法都在注释里  //https://www.cnblogs.com/ljh2000-jump/p/6189053.html#include&lt;bits/stdc++.h&gt;using namespace std;const int...

2018-09-26 23:04:41 143

原创 UsacoTraining Chapter4.4 Pollutant Control

Pollutant ControlHal BurchIt's your first day in Quality Control at Merry Milk Makers, and already there's been a catastrophe: a shipment of bad milk has been sent out. Unfortunately, you didn't disco...

2018-06-30 10:36:16 244

原创 UsacoTraining Chapter1.4 Barn Repair

Barn RepairIt was a dark and stormy night that ripped the roof and gates offthe stalls that hold Farmer John's cows. Happily, many of the cows wereon vacation, so the barn was not completely full.

2018-02-01 20:45:03 161

原创 UsacoTraining Chapter1.4 Mixing Milk

Mixing MilkThe Merry Milk Makers company buys milk from farmers, packagesit into attractive 1- and 2-Unit bottles, and then sells that milkto grocery stores so we can each start our day with del

2018-02-01 20:38:52 134

原创 UsacoTraining Chapter1.3 Dual Palindromes

Dual PalindromesMario Cruz (Colombia) & Hugo Rickeboer (Argentina)A number that reads the same from right to left as when read fromleft to right is called a palindrome. The number 12321 is a pal

2018-01-30 22:54:42 162

原创 UsacoTraining Chapter1.3 Palindromic Squares

Palindromic SquaresRob KolstadPalindromes are numbers that read the same forwards as backwards.The number 12321 is a typical palindrome.Given a number base B (2 <= B <= 20 base 10), print all

2018-01-25 20:22:07 157

原创 UsacoTraining Chapter1.3 Transformations

UsacoTraining Chapter1.3 Transformations

2018-01-03 18:38:28 140

原创 UsacoTraining Chapter1.3 Milking Cows

UsacoTraining Chapter1.3 Milking Cows

2017-12-20 19:03:25 131

原创 UsacoTraining Chapter1.2 Broken Necklace

UsacoTraining Chapter1.2 Broken Necklace

2017-12-19 19:07:27 110

原创 UsacoTraining Chapter1.2 Friday the Thirteenth

UsacoTraining Chapter1.2 Friday the Thirteenth

2017-12-18 23:48:10 126

原创 UsacoTraining Chapter1.2 Greedy Gift Givers

UsacoTraining Chapter1.2 Greedy Gift Givers

2017-12-17 12:07:59 140

空空如也

空空如也

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

TA关注的人

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