JXOI2017-2018 解题报告】的更多相关文章

JXOI2017颜色 首先记录每个位置上颜色在序列中上次出现的位置 开两颗线段树,第一棵维护区间最大值,实际上是维护当前必须被删去的颜色的位置的最大值,第二棵则是维护区间和 首先倒着扫一遍,对于当前颜色的后面一个颜色,将其删去,那他的\(pre\)肯定也要删去,将其\(pre\)的位置加入第一棵线段树,对每个位置记一个\(able\),值为当前第一棵线段树中最大值,表示当前点到\(able+1\)这一段区间都是可以的. 初始化第二颗树,\(sum\)值初始设为1,对于每个位置,如果他有前驱,那他…
目录 标题统计 题目链接 思路 代码 龙虎斗 题目链接: 思路 代码 摆渡车 题目链接: 思路 对称二叉树 题目链接 思路: 先来解释一下为毛现在才来发解题报告: 其实博主是参加过NOIP 2018普及组的复赛的,不过当时成绩垃圾的一批.只混到一个三等奖...... 今天老师又给考了一遍noip2018普及的题,结果第三题还是不太会,卧槽.....这.....不过我竟然用暴力dfs+剪枝过了(只是在网上luogu过了,本地TLE下面会说到的,咕咕咕) 下面是正式的解题报告: 标题统计 题目链接…
心路历程 预计得分:\(100 + 100 + 70\) 实际得分:\(40 + 100 + 70\) 妈妈我又挂分了qwq..T1过了大样例就没管,直到临考试结束前\(10min\)才发现大样例是假的.然而一切都晚了. T2是最后\(1min\)才做出来的. 我好菜啊..... Sol T1:很显然的一个做法是用堆维护当前应该是哪只猫吃下一条鱼 然后就有各种特殊情况了..其实也比较好判.. T2:按照\((q - p)\)排序后01背包即可,问我为啥么?因为能过大样例啊.. T3:咕咕咕...…
题目2(下面的太抓 我重新写了个背景 其他都一样) 无聊的活动 JLZ老师不情愿的参加了古风社一年一度的活动,他实在不觉得一群学生跳舞有什么好看,更不明白坐在身后的学生为什么这么兴奋(看小姐姐),于是露出了相当无聊+严肃的表情.  这不公平!因为他旁边的XBS老师是机器人!真正的XBS,在办公室里睡觉!  不过,他有一个艰巨的任务!那就是!做游戏!  这里的歌词有好多都带数字,比如“二十四桥明月不若此时节”.“三五各掌花灯盈盈各眉眼”,X老师把歌词翻译成英文,再由机器人筛选并翻译成阿拉伯数字. …
[LeetCode]697. Degree of an Array 解题报告 标签(空格分隔): LeetCode 题目地址:https://leetcode.com/problems/degree-of-an-array/description/ 题目描述: Given a non-empty array of non-negative integers nums, the degree of this array is defined as the maximum frequency of…
[LeetCode]760. Find Anagram Mappings 解题报告 标签(空格分隔): LeetCode 题目地址:https://leetcode.com/problems/find-anagram-mappings/description/ 题目描述: Given two lists Aand B, and B is an anagram of A. B is an anagram of A means B is made by randomizing the order o…
[LeetCode]376. Wiggle Subsequence 解题报告(Python) 作者: 负雪明烛 id: fuxuemingzhu 个人博客: http://fuxuemingzhu.cn/ 题目地址: https://leetcode.com/problems/wiggle-subsequence/description/ 题目描述: A sequence of numbers is called a wiggle sequence if the differences betw…
[LeetCode]375. Guess Number Higher or Lower II 解题报告(Python) 作者: 负雪明烛 id: fuxuemingzhu 个人博客: http://fuxuemingzhu.cn/ 题目地址: https://leetcode.com/problems/guess-number-higher-or-lower-ii/description/ 题目描述: We are playing the Guess Game. The game is as f…
[LeetCode]120. Triangle 解题报告(Python) 作者: 负雪明烛 id: fuxuemingzhu 个人博客: http://fuxuemingzhu.cn/ 题目地址https://leetcode.com/problems/triangle/description/ 题目描述: Given a triangle, find the minimum path sum from top to bottom. Each step you may move to adjac…
[LeetCode]649. Dota2 Senate 解题报告(Python) 作者: 负雪明烛 id: fuxuemingzhu 个人博客: http://fuxuemingzhu.cn/ 题目地址:https://leetcode.com/problems/dota2-senate/description/ 题目描述: In the world of Dota2, there are two parties: the Radiant and the Dire. The Dota2 sena…
[LeetCode]299. Bulls and Cows 解题报告(Python) 作者: 负雪明烛 id: fuxuemingzhu 个人博客: http://fuxuemingzhu.cn/ 题目地址:https://leetcode.com/problems/bulls-and-cows/description/ 题目描述: You are playing the following Bulls and Cows game with your friend: You write down…
[LeetCode]743. Network Delay Time 解题报告(Python) 标签(空格分隔): LeetCode 作者: 负雪明烛 id: fuxuemingzhu 个人博客: http://fuxuemingzhu.cn/ 题目地址:https://leetcode.com/problems/network-delay-time/description/ 题目描述: There are N network nodes, labelled 1 to N. Given times…
[LeetCode]779. K-th Symbol in Grammar 解题报告(Python) 作者: 负雪明烛 id: fuxuemingzhu 个人博客: http://fuxuemingzhu.cn/ 题目地址:https://leetcode.com/problems/k-th-symbol-in-grammar/description/ 题目描述: On the first row, we write a 0. Now in every subsequent row, we lo…
[LeetCode]518. Coin Change 2 解题报告(Python) 作者: 负雪明烛 id: fuxuemingzhu 个人博客: http://fuxuemingzhu.cn/ 题目地址:https://leetcode.com/problems/coin-change-2/description/ 题目描述: You are given coins of different denominations and a total amount of money. Write a…
[LeetCode]792. Number of Matching Subsequences 解题报告(Python) 作者: 负雪明烛 id: fuxuemingzhu 个人博客: http://fuxuemingzhu.cn/ 题目地址:https://leetcode.com/problems/number-of-matching-subsequences/description/ 题目描述: Given string S and a dictionary of words words,…
[LeetCode]911. Online Election 解题报告(Python) 作者: 负雪明烛 id: fuxuemingzhu 个人博客: http://fuxuemingzhu.cn/ 题目地址:https://leetcode.com/problems/online-election/description/ 题目描述: In an election, the i-th vote was cast for persons[i] at time times[i]. Now, we…
[LeetCode]886. Possible Bipartition 解题报告(Python) 作者: 负雪明烛 id: fuxuemingzhu 个人博客: http://fuxuemingzhu.cn/ 题目地址:https://leetcode.com/problems/possible-bipartition/description/ 题目描述: Given a set of N people (numbered 1, 2, ..., N), we would like to spli…
[LeetCode]474. Ones and Zeroes 解题报告(Python) 作者: 负雪明烛 id: fuxuemingzhu 个人博客: http://fuxuemingzhu.cn/ 题目地址:https://leetcode.com/problems/ones-and-zeroes/description/ 题目描述: n the computer world, use restricted resource you have to generate maximum benef…
[LeetCode]731. My Calendar II 解题报告(Python) 作者: 负雪明烛 id: fuxuemingzhu 个人博客: http://fuxuemingzhu.cn/ 题目地址:https://leetcode.com/problems/my-calendar-ii/description/ 题目描述: Implement a MyCalendarTwo class to store your events. A new event can be added if…
[LeetCode]36. Valid Sudoku 解题报告(Python) 作者: 负雪明烛 id: fuxuemingzhu 个人博客: http://fuxuemingzhu.cn/ 题目地址:https://leetcode.com/problems/valid-sudoku/description/ 题目描述: Determine if a 9x9 Sudoku board is valid. Only the filled cells need to be validated ac…
[LeetCode]881. Boats to Save People 解题报告(Python) 作者: 负雪明烛 id: fuxuemingzhu 个人博客: http://fuxuemingzhu.cn/ 题目地址:https://leetcode.com/problems/boats-to-save-people/description/ 题目描述: The i-th person has weight people[i], and each boat can carry a maximu…
[LeetCode]870. Advantage Shuffle 解题报告(Python) 作者: 负雪明烛 id: fuxuemingzhu 个人博客: http://fuxuemingzhu.cn/ 题目地址:https://leetcode.com/problems/advantage-shuffle/description/ 题目描述: Given two arrays A and B of equal size, the advantage of A with respect to B…
[LeetCode]785. Is Graph Bipartite? 解题报告(Python) 作者: 负雪明烛 id: fuxuemingzhu 个人博客: http://fuxuemingzhu.cn/ 题目地址:https://leetcode.com/problems/is-graph-bipartite/description/ 题目描述: Given an undirected graph, return true if and only if it is bipartite. Re…
[LeetCode]593. Valid Square 解题报告(Python) 作者: 负雪明烛 id: fuxuemingzhu 个人博客: http://fuxuemingzhu.cn/ 题目地址:https://leetcode.com/problems/valid-square/description/ 题目描述: Given the coordinates of four points in 2D space, return whether the four points could…
[LeetCode]129. Sum Root to Leaf Numbers 解题报告(Python) 标签(空格分隔): LeetCode 题目地址:https://leetcode.com/problems/sum-root-to-leaf-numbers/description/ 题目描述: Given a binary tree containing digits from 0-9 only, each root-to-leaf path could represent a numbe…
[LeetCode]732. My Calendar III解题报告 标签(空格分隔): LeetCode 题目地址:https://leetcode.com/problems/my-calendar-iii/description/ 题目描述: Implement a MyCalendarThree class to store your events. A new event can always be added. Your class will have one method, book…
[LeetCode]729. My Calendar I 解题报告 标签(空格分隔): LeetCode 题目地址:https://leetcode.com/problems/my-calendar-i/description/ 题目描述: Implement a MyCalendar class to store your events. A new event can be added if adding the event will not cause a double booking.…
[LeetCode]895. Maximum Frequency Stack 解题报告(Python) 作者: 负雪明烛 id: fuxuemingzhu 个人博客: http://fuxuemingzhu.cn/ 题目地址:https://leetcode.com/problems/maximum-frequency-stack/description/ 题目描述: Implement FreqStack, a class which simulates the operation of a…
[LeetCode]802. Find Eventual Safe States 解题报告(Python) 作者: 负雪明烛 id: fuxuemingzhu 个人博客: http://fuxuemingzhu.cn/ 题目地址:https://leetcode.com/problems/find-eventual-safe-states/description/ 题目描述: In a directed graph, we start at some node and every turn, w…
[LeetCode]380. Insert Delete GetRandom O(1) 解题报告(Python) 作者: 负雪明烛 id: fuxuemingzhu 个人博客: http://fuxuemingzhu.cn/ 题目地址:https://leetcode.com/problems/insert-delete-getrandom-o1/description/ 题目描述: Design a data structure that supports all following oper…