自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+

博客

ummmmm

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

原创 [期望] A - A Dangerous Maze LightOJ - 1027

You are in a maze; seeing n doors in front of you in beginning. You can choose any door you like. The probability for choosing a door is equal for all doors.If you choose the ith door, it can either...

2018-11-26 12:27:30 179

原创 [区间DP] G - You Are the One HDU - 4283

You Are the OneTime Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 5707    Accepted Submission(s): 2771 Problem Description  The TV shows su...

2018-11-25 21:46:51 223

原创 [区间DP] 受两边数影响删除数 POJ1651

Multiplication PuzzleTime Limit: 1000MS   Memory Limit: 65536K Total Submissions: 13686   Accepted: 8395 DescriptionThe multiplication puzzle is played with a row of cards, each co...

2018-11-23 21:02:13 206

原创 [区间DP] B - Halloween Costumes LightOJ - 1422

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 Halloween, these parties are all costume parties, Gap...

2018-11-23 19:12:13 246

原创 [区间DP] 括号匹配 POJ2955

BracketsTime Limit: 1000MS   Memory Limit: 65536K Total Submissions: 12798   Accepted: 6792 DescriptionWe give the following inductive definition of a “regular brackets” sequence:...

2018-11-23 17:11:57 157

原创 [差分序列] 判断给出的牌能否只出顺子出完 101775L SOS

J. Straight Mastertime limit per test2.0 smemory limit per test256 MBinputstandard inputoutputstandard outputA straight is a poker hand containing five cards of sequential rank, not ...

2018-11-22 19:58:55 288

原创 [位运算] F. AND Graph CF987F

F. AND Graphtime limit per test4 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputYou are given a set of size mm with integer elements between 00 and ...

2018-11-21 21:41:44 245

原创 [求逆序对] Petr and Permutations CF987E

E. Petr and Permutationstime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputPetr likes to come up with problems about randomly gener...

2018-11-21 16:39:45 390

原创 [多源BFS] D. Fair 枚举颜色BFS CF987D

D. Fairtime limit per test2 secondsmemory limit per test512 megabytesinputstandard inputoutputstandard outputSome company is going to hold a fair in Byteland. There are nn towns in B...

2018-11-20 19:00:47 198

原创 [素数筛] 求n的不同因数之和能组成的连续1~x的x ZOJ4040

Number TheoryTime Limit: 1 Second      Memory Limit: 65536 KBGiven an integer , calculate the smallest positive integer that is not a sum of distinct divisors of .InputThere are multiple test ...

2018-11-19 19:18:16 270

原创 输出n以内互质数对 CodeForce1009D

D. Relatively Prime Graphtime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputLet's call an undirected graph G=(V,E)G=(V,E) relativel...

2018-11-19 12:32:37 476

原创 C. Annoying Present CodeForces1009C

C. Annoying Presenttime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputAlice got an array of length nn as a birthday present once ag...

2018-11-16 21:33:47 175

原创 [拆分质因数] 求1e6区间内的数的因数之和 GYM 101652C

https://vj.e949.cn/f8d37a96d021442108f4492dfd021271?v=1541730304  #include <bits/stdc++.h>#define ll long long#define ull unsigned long longusing namespace std;const int mn = 1e6...

2018-11-16 13:05:03 596

原创 [逆元] 1-n中改小一个 使 % p == q gym101620

  #include <bits/stdc++.h>#define ll long longusing namespace std;const int mn = 20000000 + 10;ll n, p, q;ll qpow(ll x, ll y){ ll ans = 1; while (y) { if (y & 1) ans =...

2018-11-08 20:49:00 153

原创 【树形DP+逆元】求树上不为祖孙的集合数 洛谷P5007

题目描述给定一棵以 1 为根的有根树,定义树的一个毒瘤集为一个集合,并且集合中任意两个元素之间不存在祖先与后代关系。定义一个毒瘤集的毒瘤指数为集合内所有元素的价值之和要求给定树的所有毒瘤集的毒瘤指数之和,答案对 100000007 取模。但这个问题太难了,所以我们考虑化简。因为点的编号跟它毒瘤指数密切相关,所以我们将会再给出一个整数 T,T = 1 表示 i 号点的毒瘤指数为 ...

2018-11-05 23:33:07 305

原创 [后缀数组] 两串求最长公共子串 POJ - 2774

Long Long MessageTime Limit: 4000MS   Memory Limit: 131072K Total Submissions: 35426   Accepted: 14203 Case Time Limit: 1000MS DescriptionThe little cat is majoring in physics in...

2018-11-02 19:32:06 388

原创 [构造] Colored Rooks CodeForces - 1068C

C. Colored Rookstime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputIvan is a novice painter. He has nn dyes of different colors. He ...

2018-11-02 13:45:12 245

原创 [DP] A Question of Ingestion gym101673G

  #include <bits/stdc++.h>using namespace std;const int mn = 105;int l[mn], p[mn];int dp[mn][mn];int main(){ int n, m; scanf("%d %d", &n, &m); for (int i = 1; i <= n;...

2018-11-01 21:33:48 278

原创 [DFS] 树上删点使两连通块构成的点对最少 CFgym/101673F

  #include <bits/stdc++.h>using namespace std;const int mn = 10010;int cnt;int to[2 * mn], nx[2 * mn], fr[mn];void add_edge(int u, int v){ to[cnt] = v; nx[cnt] = fr[u]; fr[u] =...

2018-11-01 20:08:01 347

原创 环上有序尽多购买 D. Berland Fair CodeForces - 1073D

D. Berland Fairtime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputXXI Berland Annual Fair is coming really soon! Traditionally fair...

2018-10-30 21:23:04 325

原创 [后缀数组 + 二分] 求最长不重叠重复子串 POJ - 1743

Musical ThemeTime Limit: 1000MS   Memory Limit: 30000K Total Submissions: 35051   Accepted: 11632 DescriptionA musical melody is represented as a sequence of N (1<=N<=20000)n...

2018-10-30 11:02:43 276

原创 [容斥 组合数学] 求序列不相邻恰好k种颜色着色 Gym - 100548F

   逆元 适用 mod 为素数 C(n, m) 函数适用 n, m 在 1kw 以下时 n 过大时可暴力 均过大用 lucas定理 小于等于 k 种颜色 k * (k - 1) ^ (n - 1) 减去 (k - 1) * (k - 2) ^ (n - 1) * (不选的 k 种可能颜色) 有重复减去的部分 选 i 种颜色的情况数为 C(k, i)#incl...

2018-10-25 20:58:42 621

原创 [dijkstra] 带权边 查找权值最小的环 HDU6005

PandalandTime Limit: 6000/3000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 1387    Accepted Submission(s): 353 Problem DescriptionMr. Panda lives in Panda...

2018-10-16 22:01:40 767

原创 [贪心 优先队列] 两步骤完成多项工作总用时最短 HDU6000

WashTime Limit: 20000/10000 MS (Java/Others)    Memory Limit: 64000/64000 K (Java/Others)Total Submission(s): 2492    Accepted Submission(s): 672 Problem DescriptionMr.Panda is about to engage...

2018-10-16 19:40:56 193

原创 【二进制枚举】限定颜色种类数求不接触区间总长 Wannafly26C

链接:https://www.nowcoder.com/acm/contest/212/C来源:牛客网 七彩线段时间限制:C/C++ 2秒,其他语言4秒空间限制:C/C++ 262144K,其他语言524288K64bit IO Format: %lld题目描述听说彩虹有七种颜色?一维坐标轴上n条线段,每条线段左端点l,右端点r,颜色为c,从中选m种颜色的互不接触的线段,...

2018-10-15 22:51:10 274

原创 [贪心] 冥土追魂 Wannafly挑战赛26

链接:https://www.nowcoder.com/acm/contest/212/B来源:牛客网 冥土追魂时间限制:C/C++ 1秒,其他语言2秒空间限制:C/C++ 524288K,其他语言1048576K64bit IO Format: %lld题目描述有一天 Misaka 和 Kuroko 在玩一个关于冥土追魂的游戏....Misaka和Kuroko在一个 n...

2018-10-15 18:52:17 155

原创 [DFS] 小矩阵限定颜色数量不相邻填色 HDU5113

Black And WhiteTime Limit: 2000/2000 MS (Java/Others)    Memory Limit: 512000/512000 K (Java/Others)Total Submission(s): 6000    Accepted Submission(s): 1644Special Judge Problem DescriptionIn...

2018-10-15 16:29:54 548

原创 【BFS预处理】单个数字变化或同种数字变化使两串相同 UVALive 7263

Today is a rainy day. The temperature is apparently lower than yesterday. Winter is coming. It always leaves people feeling fatigued and tired.Lee hasn’t prepared for winter yet. As he wakes up this...

2018-10-15 00:02:31 311

原创 [二分] 左右差值最小时答案尽可能大 UVALive 7261

二分面积差最小答案暴力往右枚举判断面积差是否变化#include<bits/stdc++.h>#define ll long longusing namespace std;const int mn = 10010;struct node{ int l, r, w, h;} s[mn];int N;ll check(int mid){ ll sl...

2018-10-14 20:01:38 253

原创 [区间DP] 受左右相邻影响求最小和 HDU 5115

Dire WolfTime Limit: 5000/5000 MS (Java/Others)    Memory Limit: 512000/512000 K (Java/Others)Total Submission(s): 3973    Accepted Submission(s): 2355 Problem DescriptionDire wolves, also kno...

2018-10-13 18:16:45 179

原创 [DP] 取若干数异或>=m的方案数 HDU5119

Happy Matt FriendsTime Limit: 6000/6000 MS (Java/Others)    Memory Limit: 510000/510000 K (Java/Others)Total Submission(s): 5399    Accepted Submission(s): 2065 Problem DescriptionMatt has N f...

2018-10-13 17:41:04 370

原创 [Dijkstra] 集合内点可达求最短路 HDU5521

MeetingTime Limit: 12000/6000 MS (Java/Others)    Memory Limit: 262144/262144 K (Java/Others)Total Submission(s): 5524    Accepted Submission(s): 1751 Problem DescriptionBessie and her friend ...

2018-10-12 21:10:17 297

原创 [后缀数组] 求不同子串总数 SPOJ - DISUBSTR

DISUBSTR - Distinct Substrings#suffix-array-8 Given a string, we need to find the total number of its distinct substrings.InputT- number of test cases. T<=20;Each test case consists of o...

2018-10-11 21:08:02 316

原创 [AC自动机+DP] 求有上限不带特定子串的数字数量 BZOJ3530

3530: [Sdoi2014]数数Time Limit: 10 Sec  Memory Limit: 512 MBSubmit: 1411  Solved: 723[Submit][Status][Discuss]Description我们称一个正整数N是幸运数,当且仅当它的十进制表示中不包含数字串集合S中任意一个元素作为其子串。例如当S=(22,333,0233)时,233是幸...

2018-10-11 21:04:07 270

原创 [AC自动机+DP] 限定长度不包含给定子串的可能字符串数量 BZOJ1030

1030: [JSOI2007]文本生成器Time Limit: 1 Sec  Memory Limit: 162 MBSubmit: 6242  Solved: 2656[Submit][Status][Discuss]Description  JSOI交给队员ZYX一个任务,编制一个称之为“文本生成器”的电脑软件:该软件的使用者是一些低幼人群,他们现在使用的是GW文本生成器v...

2018-10-11 21:01:19 466

原创 [AC自动机+高斯消元] 求多个序列各自出现概率 HDU5955

Guessing the Dice RollTime Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 1566    Accepted Submission(s): 457 Problem DescriptionThere are N...

2018-10-11 20:56:22 249

原创 [优化dfs] 小数据求固定大小的团数量 HDUCounting Cliques

A clique is a complete graph, in which there is an edge between every pair of the vertices. Given a graph with N vertices and M edges, your task is to count the number of cliques with a specific size ...

2018-10-11 18:19:39 179

原创 [AC自动机+矩阵快速幂] 求长度为m的不包含某些给定子串的字符串数量 POJ2778

DNA SequenceTime Limit: 1000MS   Memory Limit: 65536K Total Submissions: 19748   Accepted: 7525 DescriptionIt's well known that DNA Sequence is a sequence only contains A, C, T and...

2018-09-28 21:26:23 451

原创 【AC自动机】多模式串单次匹配 HDU - 2222

Keywords SearchTime Limit: 2000/1000 MS (Java/Others)    Memory Limit: 131072/131072 K (Java/Others)Total Submission(s): 78393    Accepted Submission(s): 27259 Problem DescriptionIn the modern...

2018-09-26 23:51:22 191

原创 [匈牙利算法] 数量变化二分图匹配 GCPC 2017 Problem F Plug It In!

Adam just moved into his new apartment and simply placed everything into it at random. This means in particular that he did not put any effort into placing his electronics in a way that each one can h...

2018-09-26 13:15:12 494

空空如也

空空如也

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

TA关注的人

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