自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(245)
  • 资源 (9)
  • 收藏
  • 关注

原创 2017 ICPC 南宁 M题 The Maximum Unreachable Node Set (二分图匹配)

The Maximum Unreachable Node Set时间限制: 20 Sec  内存限制: 128 MB提交: 51  解决: 8[提交][状态][讨论版][命题人:admin]题目描述In this problem, we would like to talk about unreachable sets of a directed acyclic graph G = (V, E)....

2018-04-07 11:30:11 800

原创 Shorten Diameter (dfs遍历)

Shorten Diameter时间限制: 2 Sec 内存限制: 256 MB提交: 34 解决: 10[提交][状态][讨论版][命题人:admin]题目描述Given an undirected tree, let the distance between vertices u and v be the number of edges on the simple path from u to v. The diameter of a tree is the maximum among t

2018-04-04 20:49:25 410

原创 April Fools Contest 2018

哇,第二天补题,发现除了第一个什么都不会,这么可怕的题意吗?A. Quirky Quantifierstime limit per test2 secondsmemory limit per test64 megabytesinputstandard inputoutputstandard output

2018-04-02 17:35:37 340

原创 Snow Boots I

Snow Boots I时间限制: 1 Sec  内存限制: 128 MB提交: 6  解决: 3[提交][状态][讨论版][命题人:admin]题目描述It's winter on the farm, and that means snow! There are N tiles on the path from the farmhouse to the barn, conveniently nu...

2018-03-30 16:59:02 490

原创 石子游戏(贪心+思维)

石子游戏时间限制: 1 Sec  内存限制: 128 MB提交: 69  解决: 16[提交][状态][讨论版][命题人:admin]题目描述在Bob学会怎样玩Nim Game之后,他打算尝试另一款看起来更为简单的石子游戏这个游戏是这样子玩的:一共有一个玩家,且一开始有N堆石头,第i堆石头有ai个石子。玩家每次只能移动一个石子从一堆到另一堆。在每次移动结束后,如果存在一个整数x(x>1)满足...

2018-03-22 08:23:49 3163

原创 中石油 1380 森林扩张

森林扩张时间限制: 1 Sec  内存限制: 256 MB提交: 124  解决: 22[提交][状态][讨论版]题目描述小L走进了一片森林。这片森林由n个点和m条边组成,每个点都有一个大小ai。小L不小心在森林里迷路了,于是TA决定给森林添上几条边,把整片森林连成一棵树,就能走出去了,在点i与点j间连一条边需要花费ai+aj的代价。此外,小L还发现每个点上最多只能添一条边

2018-03-02 14:45:12 431

原创 中石油 5797 道路重建

道路重建时间限制:1 Sec内存限制:128 MB提交:53解决:17[提交][状态][讨论版]题目描述小L的家乡最近遭遇了一场洪水,城市变得面目全非,道路也都被冲毁了。生活还要继续,于是市政府决定重建城市中的道路。在洪水到来前,城市中共有n个区域和m条连接这些区域的双向道路, 道路连通了所有的区域,为了方便人们的出行,只能重建这些原有的道路, 不能

2018-03-02 14:28:14 203

原创 中石油 5794 划分

划分时间限制: 1 Sec  内存限制: 128 MB提交: 17  解决: 5[提交][状态][讨论版]题目描述给出n个不超过m的非负整数,将数划分成两个集合,记为1号集合和2号集合。x1为1号集合中所有数的异或和,x2为2号集合中所有数的异或和。在最大化x1+x2的前提下,最小化x1。输入第一行n第二行n个非负整数输出一行两个

2018-02-28 19:54:04 553

原创 2018 山东冬令营 中石油 5793 飞扬的小鸟II

飞扬的小鸟II时间限制: 1 Sec  内存限制: 128 MB提交: 59  解决: 8[提交][状态][讨论版]题目描述有n棵大树从左到右排成一排,编号为1到n,每棵有高度hi与疲劳值wi。 有一只鸟儿现在站在最左侧的1号大树上,它想飞到第n棵树上去,但它不 能连续飞行太远,当它在第i棵树上时,只能飞到第i + 1, i + 2,..., i + k棵 树上,并获得

2018-02-27 20:45:58 475

原创 Codeforces Round #464 (Div. 2) A-D题解

A. Love Triangletime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputAs you could know there are no male planes

2018-02-27 10:32:16 362

原创 实现简单的对拍

自带WA自动机属性的ACMer,经常会遇到无限提交然后就是wa的情况,但是就是不知道自己到底哪里出错了。除了cf之类的网站能得到部分数据以外,很难有网站会告诉你数据。所以可以暴力写一发或者找一个正确的cpp文件,产生几组随机数,简单跑几次,,如果出现两者不一样的情况,再做分析。对拍就完成了这么一个功能。首先,对拍的前提是你的暴力代码是完全正确的,你的随机数产生的数据是完全符合题意的。

2018-02-02 15:28:51 429 1

原创 线段树模板

这个月要写4篇博客,工作量太大了,今天最后一天了,贴一下这几天整理过的线段树的模板吧。int sum[maxn*4],minn[maxn*4],maxx[maxn*4],vis[maxn*4],Map[maxn],n;//sum储存和,minn最小值,maxx最大值,vis作为求最值的标记数组,Map是原数组 建树void built(int l,int r,int root)

2018-01-31 15:40:23 466

原创 Codeforces Round #361 (Div. 2) D (树状数组+二分)

D. Friends and Subsequencestime limit per test2 secondsmemory limit per test512 megabytesinputstandard inputoutputstandard outputMike and !Mike are old childhoo

2018-01-29 10:59:57 272

原创 Codeforces Round #365 (Div. 2) D (树状数组)

D. Mishka and Interesting sumtime limit per test3.5 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputLittle Mishka enjoys progra

2018-01-27 10:19:12 299

原创 树状数组模板(max,min,区间和,区间修改,单点查询)

好久不写博客,为了保证持之以恒,就写写最近搞的模板吧,感觉有时候模板比思想实用的多。树状数组是个神奇的东西,能在log2(n)的时间内完成相应操作,所以我觉得有必要整理一下,但又觉得书面性的东西太多,所以就直接放模板了,有机会写点总结。首先,创建树状数组。数组C是储存树状数组的空间,下标从1开始。void add(int x,int y) //C[x]的值增加y

2018-01-24 19:54:35 1676

原创 两个循环单链表实现插入操作

随机产生两组两位整数,建立两个带有头结点的循环单链表,并设尾指针为RL1和RL2,将第二个链表插入到第一个链表的第i个结点前。  函数为:    ① void createList(LinkList&rear)                  ② void insertList(LinkList &CR1, LinkList &CR2, int i)分析:首先建立循环链表,将

2017-12-20 21:50:18 936

原创 Codeforces Round #452 (Div. 2) A-C题解

哎............A. Splitting in Teamstime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputThere wer

2017-12-17 20:06:27 841 1

原创 Codeforces Round #451 (Div. 2) A-C题解

伤心总是难免的,明明是送分场,愣是掉了61分。A. Roundingtime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputVasya has

2017-12-17 13:24:36 865

原创 Codeforces Round #450 (Div. 2) A-C题解

A. Find Extra Onetime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputYou have n distinct points on a plane, none of them lie on OY axis. Check that there is a point after removal of which the remaining

2017-12-14 21:37:01 728

原创 Codeforces Round #449 (Div. 2) A-C题解

A. Scarborough Fairtime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputAre you going to Scarborough Fair?Parsley, sage, rosemary and thyme.Remember me to one who lives there.He once was the true l

2017-12-06 14:36:32 596

原创 Codeforces Round #422 (Div. 2) C Hacker, pack your bags! (二分orDP)

Hacker, pack your bags!time limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputIt's well known that the best way to distract from something is to do one's favourite thing. Job is such a thing for Leha.So

2017-12-03 22:02:04 1149

原创 Codeforce 839C Journey (dfs+概率)

C. Journeytime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputThere are n cities and n - 1 roads in the Seven Kingdoms, each road connects two cities and we can reach any city from any other by the roa

2017-11-25 17:25:30 854

原创 Educational Codeforces Round 33 (Rated for Div. 2) A-C题解

A. Chess For Threetime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputAlex, Bob and Carl will soon participate in a team chess tournament. Since they are all in the same team, they have decided to pract

2017-11-25 10:02:50 721

原创 Codeforces Round #447 (Div. 2) A-C题解

A. QAQtime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard output"QAQ" is a word to denote an expression of crying. Imagine "Q" as eyes with tears and "A" as a mouth.Now Diamond has given Bort a string consi

2017-11-20 16:52:27 1077

原创 FZU_2216 The Longest Straight (二分)

Problem 2216 The Longest Straight Accept: 441    Submit: 1380Time Limit: 1000 mSec    Memory Limit : 32768 KB Problem DescriptionZB is playing a card game where the goal is to make str

2017-11-19 17:22:57 593

原创 Codeforces Round #446 (Div. 2) A-C 题解

A. Greedtime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputJafar has n cans of cola. Each can is described by two integers: remaining volume of cola ai and can's capacity bi (ai  ≤  bi).Jafar has de

2017-11-18 13:53:50 774 2

原创 Codeforces Round #444 (Div. 2) A-C 题解

A. Div. 64time limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputTop-model Izabella participates in the competition. She wants to impress judges and show her mathematical skills.Her problem is following:

2017-11-17 15:19:33 956

原创 Codeforces Round #443 (Div. 2) A-C 题解

A. Borya's Diagnosistime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputIt seems that Borya is seriously sick. He is going visit n doctors to find out the exact diagnosis. Each of the doctors needs the

2017-11-16 21:37:54 666

原创 洛谷P3031 中石油2557 Above the Median (数组模拟or树状数组求逆序数)

Farmer John has lined up his N (1 <= N <= 100,000) cows in a row to measure their heights; cow i has height H_i (1 <= H_i <= 1,000,000,000) nanometers--FJ believes in precise measurements! He wants to take a picture of some contiguous subsequence of the co

2017-11-02 15:22:02 747

原创 HDU 5927 Auxiliary Set (DFS+模拟)

Auxiliary SetTime Limit: 9000/4500 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 1934 Accepted Submission(s): 564Problem DescriptionGiven a rooted tree with n vertices, some of the vertices are important.An a

2017-10-28 17:14:38 691

原创 HDU 3923 Invoker (polya定理)

Invoker                                                                   Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 122768/62768 K (Java/Others)                                   

2017-10-27 20:48:51 908

原创 动态规划小结

准备青岛的征途,拿着部分DP题搞了一波,收获还是很多,部分常见的DP并没有刷题,偏重于记忆化搜索,状态压缩,区间DP,博弈+DP,树形DP。还是做题少,做什么都力不从心,好多题不看题解根本就不会做,看了题解也要研究半天,没办法嘛,人丑就要多读书呗。是时候来总结一下,数数最近是否还有收获。自己开了一套题,水题有,难题也有,六天终于搞完,还有很多没涉及的方面,来日方长。扔一下题

2017-10-26 20:56:35 627

原创 HDU 1054 Strategic Game (树形DP)

Strategic GameTime Limit: 20000/10000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 8641 Accepted Submission(s): 4161Problem DescriptionBob enjoys playing computer games, especially strategic games, but sometim

2017-10-26 16:13:16 640

原创 HDU 4778 Gems Fight! (博弈+状压DP)

Problem Description  Alice and Bob are playing "Gems Fight!":  There are Gems of G different colors , packed in B bags. Each bag has several Gems. G different colors are numbered from color 1 to

2017-10-25 12:24:04 647

原创 UVA 10891 - Game of Sum (博弈+区间DP+记忆化搜索)

Root  10891 - Game of SumTime limit: 3.000 secondsThis is a two player game. Initially there are n integer numbers in an array and players A and B get chance to take them alt

2017-10-24 13:02:33 594

原创 UVA 10651 - Pebble Solitair (状压+记忆化搜索)

Pebble solitaire is an interesting game. This is a game where you are given a board with an arrangement of small caviti

2017-10-22 20:27:50 700

原创 BZOJ 1009: [HNOI2008]GT考试(DP+KMP失配+矩阵快速幂)

1009: [HNOI2008]GT考试Time Limit: 1 Sec Memory Limit: 162 MBSubmit: 4181 Solved: 2552[Submit][Status][Discuss]Description  阿申准备报名参加GT考试,准考证号为N位数X1X2....Xn(0<=Xi<=9),他不希望准考证号上出现不吉利的数字。他的不吉利数学A1A2...Am(0<=Ai<=9)有M位,不出现是指X1X2...Xn中没有恰好一段等于A1A2...Am. A

2017-10-20 16:52:01 793

原创 Codeforces Round #440 (Div. 2, based on Technocup 2018 Elimination Round 2) A-C题解

A. Search for Pretty Integerstime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputYou are given two lists of non-zero digits.Let's call an integer pretty if its (base 10) representation has at least on

2017-10-17 12:56:21 553

原创 Codeforces Round #441 (Div. 2, by Moscow Team Olympiad) A-D题解

A. Trip For Mealtime limit per test1 secondmemory limit per test512 megabytesinputstandard inputoutputstandard outputWinnie-the-Pooh likes honey very much! That is why he decided to visit his friends. Winnie has got three best friends: Rabbit, Owl and

2017-10-17 12:27:11 716

原创 最小生成树 Prim、Kruscal算法 (以HDU 1863为例)

畅通工程Time Limit: 1000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 32680 Accepted Submission(s): 14407Problem Description省政府“畅通工程”的目标是使全省任何两个村庄间都可以实现公路交通(但不一定有直接的公路相连,只要能间接通过公路可达即可)。经过调查评估,得到的统计表中列出了有可能建设公

2017-10-15 14:33:26 948

Camelot.pptx

Camelot.pptx

2021-08-18

卷积神经网络.pptx

卷积神经网络.pptx

2021-04-25

数据结构之树状数组讲解

树状数组算法分析树状数组可以解决数量级较大的区间求和问题,区间求最值问题,区间修改、查询问题以及求逆序对等应用。树状数组的时间复杂度O(log2n),正常情况下远远快于线性时间O(n)。

2018-07-27

空空如也

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

TA关注的人

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