自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(337)
  • 问答 (1)
  • 收藏
  • 关注

原创 其余OJ

陆续更新中。。。。

2019-04-08 23:21:46 308

原创 Codeforce题集

A. Thanos Sort

2019-04-04 23:34:49 571

原创 天梯赛题集

L1-001 Hello WorldL1-002 打印沙漏L1-003 个位数统计L1-004 计算摄氏温度L1-005 考试座位号L1-006 连续因子L1-007 念数字L1-008 求整数段和L1-009 N个数求和L1-010 比较大小L1-011 A-BL1-012 计算指数L1-013 计算阶乘和L1-014 简单题L1-015 跟奥巴马一起画方块L1-0...

2019-04-01 23:07:17 1020

原创 【数位Dp】数字游戏

一本通

2022-12-07 18:56:52 347 1

原创 【数位Dp】LeetCode 2376. 统计特殊整数

数位Dp

2022-12-06 20:21:13 349

原创 面试题 02.04. 分割链表(视频解析!!保证听懂!!!)

B站视频解析

2020-06-14 14:18:23 269

原创 面试题 02.08. 环路检测(快慢指针、双指针)视频解析

B站视频讲解

2020-06-13 15:15:02 194

原创 Js逆向实战之网易云音乐(手把手视频讲解)

Js逆向实战之网易云音乐(一)Js逆向实战之网易云音乐(二)

2020-05-25 12:13:10 866

原创 python爬虫之爬取手机微博评论(图文并排,炒鸡详细!!!)

第一步:登录手机微博官网,截图如下所示:第二步:分析提交的参数,找到任意一条微博内容,本文选取的内容是微博推送的,找到开发者模式,点开network选项卡,刷新页面,一直向下翻,找出规律,截图如下所示:注意事项:就此条微博来说,前17页数据中提交的参数max_id_type = 0,但是17页以后就变了,改成了1,这点大家注意即可第三步:分析数据藏匿的地方,截图如下所示:第四步...

2020-03-16 20:58:17 4920 13

原创 python爬虫之爬取百度图片(图文并排,炒鸡详细!!!)

第一步:登录百度图片官网,截图如下所示:注意点一:开头必须是https(如上图所示,出现锁的标志),不能是http,否则后期下载图片文件会出错第二步:输入关键字,页面加载出来之后,按F12进入开发者模式,由于百度图片ajax动态加载,点击network选项卡,重新刷新页面,查看XHR数据,截图如下所示:第三步:分析多个XHR,得出规律,每一个页面所请求的url所携带的参数只有pn,rn,...

2020-03-13 16:28:24 2182

原创 问题 J: 小C的数学问题(单调栈)

题目描述小C是个云南中医学院的大一新生,在某个星期二,他的高数老师扔给了他一个问题。让他在1天的时间内给出答案。但是小C不会这问题,现在他来请教你。请你帮他解决这个问题。有n个数,每个数有权值。数学老师定义了区间价值为区间和乘上区间内的最小值。现在要你找出有最大区间价值的区间是什么,并输出区间价值。输入每个输入文件只包含单组数据。第一行一个整数n。(1 <= n <...

2019-05-19 23:15:47 249

原创 Black & White (尺取法)

题目链接题目描述你有一个长度为 n 的 01 串S,你可以执行最多 m 次操作。对于每次操作,你可以选择一个位置 i 满足1 ≤ i ≤ n,翻转这一位的值,0变成1,1变成0。定义一个 01 串的价值为其中最长连续0的个数和最长连续1的个数的较大值,求S在经过最多m次操作后的最大价值。输入描述:第一行一个整数 T ,表示接下来有 T 个样例。首先输入n,m,表示S串的长度n和操作...

2019-05-14 12:29:20 282

原创 A Simple Problem with Integers(线段树区间更新&区间求和模板题)

题目链接DescriptionYou have N integers, A1, A2, … , AN. You need to deal with two kinds of operations. One type of operation is to add some given number to each number in a given interval. The other is ...

2019-05-14 12:25:30 245

原创 #1174 : 拓扑排序·一(模板题)

题目链接描述由于今天上课的老师讲的特别无聊,小Hi和小Ho偷偷地聊了起来。小Ho:小Hi,你这学期有选什么课么?小Hi:挺多的,比如XXX1,XXX2还有XXX3。本来想选YYY2的,但是好像没有先选过YYY1,不能选YYY2。小Ho:先修课程真是个麻烦的东西呢。小Hi:没错呢。好多课程都有先修课程,每次选课之前都得先查查有没有先修。教务公布的先修课程记录都是好多年前的,不但有重复的信...

2019-05-14 12:22:34 234

原创 84. Largest Rectangle in Histogram(单调栈)

题目链接Given n non-negative integers representing the histogram’s bar height where the width of each bar is 1, find the area of largest rectangle in the histogram.Above is a histogram where width of e...

2019-05-14 12:20:21 203

原创 B. Hate "A"

题目链接Bob has a string s consisting of lowercase English letters. He defines s′ to be the string after removing all “a” characters from s (keeping all other characters in the same order). He then gener...

2019-05-14 12:17:19 446

原创 A. Love "A"

题目链接Alice has a string s. She really likes the letter “a”. She calls a string good if strictly more than half of the characters in that string are "a"s. For example “aaabb”, “axaa” are good strings, ...

2019-05-14 12:16:00 921

原创 B. Expansion coefficient of the array

题目链接Let’s call an array of non-negative integers a1,a2,…,an a k-extension for some non-negative integer k if for all possible pairs of indices 1≤i,j≤n the inequality k⋅|i−j|≤min(ai,aj) is satisfied. ...

2019-05-14 12:14:31 656

原创 A. A pile of stones

题目链接Vasya has a pile, that consists of some number of stones. n times he either took one stone from the pile or added one stone to the pile. The pile was non-empty before each operation of taking one...

2019-05-14 12:12:48 555

原创 155. Min Stack(最小栈)

题目链接Design a stack that supports push, pop, top, and retrieving the minimum element in constant time.push(x) – Push element x onto stack.pop() – Removes the element on top of the stack.top() – Get...

2019-05-07 14:29:12 236

原创 496. Next Greater Element I(单调栈)

题目链接You are given two arrays (without duplicates) nums1 and nums2 where nums1’s elements are subset of nums2. Find all the next greater numbers for nums1’s elements in the corresponding places of num...

2019-05-07 14:28:15 142

原创 问题 K: Little Sub and Triangles

题目链接题目描述Little Sub loves triangles. Now he has a problem for you.Given n points on the two-dimensional plane, you have to answer many queries. Each query require you to calculate the number of tria...

2019-05-06 09:16:41 680

原创 问题 D: Bits Reverse

题目链接题目描述Now given two integers x and y, you can reverse every consecutive three bits in arbitrary number’s binary form (any leading zero can be taken into account) using one coin. Reversing (1,2,3) ...

2019-05-06 09:13:24 504 1

原创 162. Find Peak Element

题目链接A peak element is an element that is greater than its neighbors.Given an input array nums, where nums[i] ≠ nums[i+1], find a peak element and return its index.The array may contain multiple pea...

2019-05-06 09:11:56 114

原创 153. Find Minimum in Rotated Sorted Array

题目链接Suppose an array sorted in ascending order is rotated at some pivot unknown to you beforehand.(i.e., [0,1,2,4,5,6,7] might become [4,5,6,7,0,1,2]).Find the minimum element.You may assume no ...

2019-05-06 09:11:09 112

原创 240. Search a 2D Matrix II (二维矩阵二分)

题目链接Write an efficient algorithm that searches for a value in an m x n matrix. This matrix has the following properties:Integers in each row are sorted in ascending from left to right.Integers in e...

2019-05-06 09:08:43 175

原创 74. Search a 2D Matrix(二维二分)

题目链接Write an efficient algorithm that searches for a value in an m x n matrix. This matrix has the following properties:Integers in each row are sorted from left to right.The first integer of each ...

2019-05-06 09:07:42 282

原创 34. Find First and Last Position of Element in Sorted Array

题目链接Given an array of integers nums sorted in ascending order, find the starting and ending position of a given target value.Your algorithm’s runtime complexity must be in the order of O(log n).If ...

2019-05-06 09:05:53 137

原创 69. Sqrt(x)

题目链接Implement int sqrt(int x).Compute and return the square root of x, where x is guaranteed to be a non-negative integer.Since the return type is an integer, the decimal digits are truncated and o...

2019-05-06 09:03:13 115

原创 272. 最长公共上升子序列

题目链接熊大妈的奶牛在小沐沐的熏陶下开始研究信息题目。小沐沐先让奶牛研究了最长上升子序列,再让他们研究了最长公共子序列,现在又让他们研究最长公共上升子序列了。小沐沐说,对于两个数列A和B,如果它们都包含一段位置不一定连续的数,且数值是严格递增的,那么称这一段数是两个数列的公共上升子序列,而所有的公共上升子序列中最长的就是最长公共上升子序列了。奶牛半懂不懂,小沐沐要你来告诉奶牛什么是最长公共...

2019-05-06 09:01:40 172

原创 1006 最长公共子序列Lcs + 打印路径

题目链接给出两个字符串A B,求A与B的最长公共子序列(子序列不要求是连续的)。比如两个串为:abcicbaabdkscabab是两个串的子序列,abc也是,abca也是,其中abca是这两个字符串最长的子序列。输入第1行:字符串A第2行:字符串B(A,B的长度 <= 1000)输出输出最长的子序列,如果有多个,随意输出1个。输入样例abcicbaabdkscab...

2019-05-06 08:57:57 129

原创 90. 64位整数乘法(快速幂思想求 a * b mod p)

题目链接求 a 乘 b 对 p 取模的值。输入格式第一行输入整数a,第二行输入整数b,第三行输入整数p。输出格式输出一个整数,表示a*b mod p的值。数据范围1≤a,b,p≤1018输入样例:345输出样例:2题解: (采用二进制思想)直接计算a乘b会超 long long 的最大范围,所以采用类似于快速幂的思想,把 b写成二进制形式,如果某位上为1就加上a *(...

2019-05-06 08:54:54 539

原创 89. a^b(快速幂模板)

题目链接求 a 的 b 次方对 p 取模的值。输入格式三个整数 a,b,p在同一行用空格隔开。输出格式输出一个整数,表示a^b mod p的值。数据范围1≤a,b,p≤109输入样例:3 2 7输出样例:2#include<bits/stdc++.h>using namespace std;int fast_pow(int a,int b,int p){ ...

2019-05-06 08:52:52 157

原创 B. Substrings Sort(字符串)

题目链接

2019-04-25 09:03:49 201

原创 P3383 【模板】线性筛素数

题目链接题目描述如题,给定一个范围N,你需要处理M个某数字是否为质数的询问(每个数字均在范围1-N内)输入格式:第一行包含两个正整数N、M,分别表示查询的范围和查询的个数。接下来M行每行包含一个不小于1且不大于N的整数,即询问该数是否为质数。输出格式:输出包含M行,每行为Yes或No,即依次为每一个询问的结果。输入样例#1:100 52349197输出样例#1:Ye...

2019-04-25 08:53:42 145

原创 Subsequence

题目链接Give a string S and N string Ti, determine whether Ti is a subsequence of S.If ti is subsequence of S, print YES,else print NO.If there is an array {K1, K2, K3,..., Km} so that 1 <= K1 < ...

2019-04-25 08:52:32 221

原创 Coloring Game (找规律+快速幂)

题目链接David has a white board with 2×N grids.He decides to paint some grids black with his brush.He always starts at the top left corner and ends at the bottom right corner, where grids should be black...

2019-04-25 08:50:26 454

原创 Problem Preparation

题目链接It’s time to prepare the problems for the 14th Zhejiang Provincial Collegiate Programming Contest! Almost all members of Zhejiang University programming contest problem setter team brainstorm and...

2019-04-25 08:47:43 236

原创 C. Maximum Subrectangle(前缀和 + 思维)

题目链接You are given two arrays a and b of positive integers, with length n and m respectively.Let c be an n×m matrix, where ci,j=ai⋅bj.You need to find a subrectangle of the matrix c such that the su...

2019-04-25 08:46:37 707

原创 A. Diverse Team

题目链接There are n students in a school class, the rating of the i-th student on Codehorses is ai. You have to form a team consisting of k students (1≤k≤n) such that the ratings of all team members are ...

2019-04-25 08:45:18 474

空空如也

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

TA关注的人

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