
杂
文章平均质量分 73
杂
ShadyPi
写写博客当笔记
展开
-
[LeetCode] 75. Sort Colors
Quick Sort原创 2024-11-14 06:44:48 · 778 阅读 · 1 评论 -
[NeetCode 150] Three Integer Sum
【代码】[NeetCode 150] Three Integer Sum。原创 2024-10-29 11:09:27 · 555 阅读 · 0 评论 -
[NeetCode 150] Longest Substring Without Duplicates
【代码】[NeetCode 150] Longest Substring Without Duplicates。原创 2024-10-29 09:50:10 · 306 阅读 · 0 评论 -
[NeetCode 150] Meeting Schedule II
【代码】[NeetCode 150] Meeting Schedule II。原创 2024-10-29 09:26:21 · 177 阅读 · 0 评论 -
[NeetCode 150] Maximum Subarray
【代码】[NeetCode 150] Maximum Subarray。原创 2024-10-28 09:05:51 · 447 阅读 · 0 评论 -
[NeetCode 150] Max Water Container
Two pointers原创 2024-10-28 08:45:37 · 381 阅读 · 0 评论 -
[NeetCode 150] Serialize and Deserialize Binary Tree
Tree traversal原创 2024-10-28 03:35:30 · 1099 阅读 · 0 评论 -
[NeetCode 150] Remove Node From End of Linked List
2 Pointers原创 2024-10-27 13:22:45 · 240 阅读 · 0 评论 -
[NeetCode 150] Pacific Atlantic Water Flow
2D DFS原创 2024-10-27 13:17:57 · 462 阅读 · 0 评论 -
[NeetCode 150] Minimum Window With Characters
Hard sliding window原创 2024-10-27 02:18:36 · 383 阅读 · 0 评论 -
[NeetCode 150] Find Minimum in Rotated Sorted Array
【代码】[NeetCode 150] Find Minimum in Rotated Sorted Array。原创 2024-10-22 15:09:33 · 334 阅读 · 0 评论 -
[NeetCode 150] Non-overlapping Intervals
【代码】[NeetCode 150] Non-overlapping Intervals。原创 2024-10-22 11:18:47 · 781 阅读 · 0 评论 -
[NeetCode 150] Insert New Interval
Insert new interval原创 2024-10-22 06:34:15 · 341 阅读 · 0 评论 -
[NeetCode 150] Reverse Bits
Reverse bits原创 2024-10-22 01:31:15 · 362 阅读 · 0 评论 -
[NeetCode 150] Number of One Bits
Number of One Bits。原创 2024-10-21 14:38:31 · 584 阅读 · 0 评论 -
[NeetCode 150] Eating Bananas
Binary search the answer原创 2024-10-21 13:59:03 · 864 阅读 · 0 评论 -
[NeetCode 150] Set Zeroes in Matrix
Set zeros in matrix with O(1) additional space原创 2024-10-21 12:49:49 · 369 阅读 · 0 评论 -
[NeetCode 150] Sum of Two Integers
Plus via binary operations原创 2024-10-21 12:32:45 · 195 阅读 · 0 评论 -
[NeetCode 150] Find Target in Rotated Sorted Array
Single side binary search原创 2024-10-21 11:09:32 · 476 阅读 · 0 评论 -
Binary Search Comprehension
Comprehension of Binary Search原创 2024-10-21 10:08:43 · 1711 阅读 · 0 评论 -
[NeetCode 150] Search 2D Matrix
2D version binary search原创 2024-10-19 07:26:34 · 187 阅读 · 0 评论 -
[NeetCode 150] Search for Word
DFS and BFS原创 2024-10-19 06:47:29 · 434 阅读 · 0 评论 -
[NeetCode 150] Permutations
Realize permutation via DFS原创 2024-10-19 06:13:01 · 322 阅读 · 0 评论 -
[NeetCode 150] Single Number
Properties of XOR operation原创 2024-10-19 03:24:25 · 828 阅读 · 0 评论 -
[NeetCode 150] Rotate Matrix
【代码】[NeetCode 150] Rotate Matrix。原创 2024-07-17 00:32:53 · 873 阅读 · 0 评论 -
[NeetCode 150] Word Ladder
【代码】[NeetCode 150] Word Ladder。原创 2024-07-14 14:21:16 · 1125 阅读 · 0 评论 -
[NeetCode 150] Valid Tree
【代码】[NeetCode 150] Valid Tree。原创 2024-07-14 12:07:09 · 270 阅读 · 0 评论 -
[NeetCode 150] Is Palindrome
【代码】[NeetCode 150] Is Palindrome。原创 2024-07-12 23:50:06 · 444 阅读 · 0 评论 -
[NeetCode 150] Valid Sudoku
【代码】[NeetCode 150] Valid Sudoku。原创 2024-07-12 22:28:13 · 420 阅读 · 0 评论 -
[NeetCode 150] Products of Array Discluding Self
Products of Array Discluding Self原创 2024-07-12 22:04:21 · 387 阅读 · 0 评论 -
CDOJ1886 中间数
CDOJ1886 中间数原创 2022-03-12 22:31:35 · 754 阅读 · 0 评论 -
Luogu5788 【模板】单调栈
原题链接:https://www.luogu.com.cn/problem/P5788单调栈题目背景模板题,无背景。2019.12.12 更新数据,放宽时限,现在不再卡常了。题目描述给出项数为 nnn 的整数数列 a1…na_{1 \dots n}a1…n 。定义函数 f(i)f(i)f(i) 代表数列中第 iii 个元素之后第一个大于 aia_iai 的元素的下标,即 f(i)=mini<j≤n,aj>ai{j}f(i)=\min_{i<j\leq n, a_j &g原创 2021-02-13 21:43:31 · 288 阅读 · 1 评论 -
Luogu2564 [SCOI2009]生日礼物
原题链接:https://www.luogu.com.cn/problem/P2564生日礼物题目背景四川2009NOI省选题目描述小西有一条很长的彩带,彩带上挂着各式各样的彩珠。已知彩珠有N个,分为K种。简单的说,可以将彩带考虑为x轴,每一个彩珠有一个对应的坐标(即位置)。某些坐标上可以没有彩珠,但多个彩珠也可以出现在同一个位置上。小布生日快到了,于是小西打算剪一段彩带送给小布。为了让礼物彩带足够漂亮,小西希望这一段彩带中能包含所有种类的彩珠。同时,为了方便,小西希望这段彩带尽可能短,你能帮助原创 2021-02-13 13:14:05 · 247 阅读 · 0 评论 -
Luogu1638 逛画展
原题链接:https://www.luogu.com.cn/problem/P1638逛画展题目描述博览馆正在展出由世上最佳的 M 位画家所画的图画。wangjy想到博览馆去看这几位大师的作品。可是,那里的博览馆有一个很奇怪的规定,就是在购买门票时必须说明两个数字,a和b,代表他要看展览中的第 a 幅至第 b 幅画(包含 a 和 b)之间的所有图画,而门票的价钱就是一张图画一元。为了看到更多名师的画,wangjy希望入场后可以看到所有名师的图画(至少各一张)。可是他又想节省金钱。。。作为原创 2021-02-13 10:55:53 · 189 阅读 · 0 评论 -
书店管理系统(C++初学者友好版)
文章目录写在前面题目要求主体思路代码实现定义结构体book读入带空格字符串的函数通过书名查找书的编号进货函数出货函数查询某书的详细信息、销售情况、库存函数查询详细信息函数查询销售情况函数查询库存函数查询进/出货记录函数排序函数其他函数输出带空格字符串函数输出一本书的详细信息函数输出操作列表函数完整代码结语写在前面正如标题所示,本文是写给C++的初学者的一个书店管理系统实例。为了贴近目标读者的需求,本篇博客中的代码仅采用了初级的内容。比如:对于书的名字,采取了最简单粗暴的多维字符串存储而不是Trie树甚或原创 2020-12-22 16:03:48 · 2850 阅读 · 0 评论 -
我的第一个Python程序:Luogu1001 A+B Problem
原题连接:https://www.luogu.com.cn/problem/P1001A+B Problem题目描述输入两个整数 a,ba,ba,b,输出它们的和(∣a∣,∣b∣≤109|a|,|b|\leq 10^9∣a∣,∣b∣≤109 )。注意Pascal 使用 integer 会爆掉哦!有负数哦!C/C++ 的 main 函数必须是 int 类型,而且最后要 return 0。这不仅对洛谷其他题目有效,而且也是 NOIP/NOI/CSP 比赛的要求!好吧,同志们,我们就从这一题开始原创 2020-10-15 17:19:21 · 632 阅读 · 0 评论 -
CF1399E2 Weights Division (hard version)
原题链接:http://codeforces.com/problemset/problem/1399/E2Weights Division (hard version)Easy and hard versions are actually different problems, so we advise you to read both statements carefully.You are given a weighted rooted tree, vertex 1 is the root of原创 2020-08-31 23:01:27 · 401 阅读 · 0 评论 -
CF1399E1 Weights Division (easy version)
原文链接:http://codeforces.com/problemset/problem/1399/E1Weights Division (easy version)Easy and hard versions are actually different problems, so we advise you to read both statements carefully.You are given a weighted rooted tree, vertex 1 is the root of原创 2020-08-28 23:35:41 · 308 阅读 · 0 评论 -
CF1399D Binary String To Subsequences
原题链接:http://codeforces.com/problemset/problem/1399/DBinary String To SubsequencesYou are given a binary string s consisting of n zeros and ones.Your task is to divide the given string into the minimum number of subsequences in such a way that each char原创 2020-08-25 22:23:36 · 279 阅读 · 0 评论 -
CF1399C Boats Competition
原文链接:http://codeforces.com/problemset/problem/1399/CBoats CompetitionThere are n people who want to participate in a boat competition. The weight of the i-th participant is wi. Only teams consisting of two people can participate in this competition. As原创 2020-08-22 16:29:09 · 335 阅读 · 0 评论