摘要:
使用oj地址 https://www.acwing.com/ https://loj.ac/d/588 ios::sync_with_stdio(false); cin.tie(0); cout.tie(0); #ifdef local_debug freopen("words.in", "r", 阅读全文
摘要:
ios::sync_with_stdio(false); cin.tie(0); cout.tie(0); #ifdef local_debug freopen("words.in", "r", stdin); freopen("out.txt", "w", stdout);#endif 《算法竞赛 阅读全文
摘要:
英文题面的题解 ios::sync_with_stdio(false); cin.tie(0); cout.tie(0); #ifdef local_debug freopen("words.in", "r", stdin); freopen("out.txt", "w", stdout);#end 阅读全文
摘要:
Leetcode视频题解地址 https://space.bilibili.com/18508846 目前逐步添加视频题解中 欢迎大家点赞收藏 留言 投币 一键三连 hh 力扣难度分级评分 https://zerotrac.github.io/leetcode_problem_rating/#/ h 阅读全文
摘要:
// 数据分析与处理之二(Leveldb 实现原理) 【LevelDB源码剖析系列】SkipList与Memtable LevelDB Cache实现机制分析 从朴素解释出发解释leveldb的设计 LevelDB原理探究与代码分析 LevelDB原理探究与代码分析(上) LevelDB原理探究和代 阅读全文
摘要:
https://leetcode.cn/problems/remove-duplicates-from-sorted-array/description/ /* * @lc app=leetcode.cn id=26 lang=cpp * @lcpr version=30204 * * [26] 删 阅读全文
摘要:
https://leetcode.cn/problems/remove-element/description/ /* * @lc app=leetcode.cn id=27 lang=cpp * @lcpr version=30204 * * [27] 移除元素 */ // @lcpr-templ 阅读全文
摘要:
给你两个整数,被除数 dividend 和除数 divisor。将两数相除,要求 不使用 乘法、除法和取余运算。 整数除法应该向零截断,也就是截去(truncate)其小数部分。例如,8.345 将被截断为 8 ,-2.7335 将被截断至 -2 。 返回被除数 dividend 除以除数 divi 阅读全文
摘要:
// 路径数量统计.cpp : 此文件包含 "main" 函数。程序执行将在此处开始并结束。 // /* http://oj.daimayuan.top/course/22/problem/1044 题目描述 给你一张有向图,图中可能存在重边和自环,请求出从点 u 出发经过恰好 k 条边后到达点 v 阅读全文
摘要:
// 骨牌覆盖.cpp : 此文件包含 "main" 函数。程序执行将在此处开始并结束。 // /* http://oj.daimayuan.top/course/22/problem/1047 题目描述 给定一个 n×m 的棋盘,你需要用 1×2的多米诺骨牌去覆盖整个棋盘, 请求出有多少种不同的覆 阅读全文
摘要:
将一个给定字符串 s 根据给定的行数 numRows ,以从上往下、从左到右进行 Z 字形排列。 比如输入字符串为 "PAYPALISHIRING" 行数为 3 时,排列如下: P A H N A P L S I I G Y I R 之后,你的输出需要从左往右逐行读取,产生出一个新的字符串,比如:" 阅读全文
摘要:
// Magic Gems.cpp : 此文件包含 "main" 函数。程序执行将在此处开始并结束。 // /* http://oj.daimayuan.top/course/22/problem/1046 题目描述 Reziba 拥有无限多个魔法宝石,每个魔法宝石的大小为 1 单元。每个魔法宝石可 阅读全文
摘要:
// Fibonacci 第 n 项.cpp : 此文件包含 "main" 函数。程序执行将在此处开始并结束。 // /* https://loj.ac/p/10220 题目描述 大家都知道 Fibonacci 数列吧,f_1=1,f_2=1,f_3=2,f_4=3,~~~,f_n=f_{n-1}+ 阅读全文
摘要:
作者:灵茶山艾府 链接:https://leetcode.cn/circle/discuss/K0n2gO/ 一、链表 注:由于周赛中的链表题可以转成数组处理,难度比直接处理链表低,故不标明难度分。 带着问题去做下面的题目: 在什么情况下,要用到哨兵节点(dummy node)? 在什么情况下,循环 阅读全文
摘要:
作者:灵茶山艾府 链接:https://leetcode.cn/circle/discuss/g6KTKL/ 一、贪心策略 有两种基本贪心策略: 从最小/最大开始贪心,优先考虑最小/最大的数,从小到大/从大到小贪心。在此基础上,衍生出了反悔贪心。 从最左/最右开始贪心,思考第一个数/最后一个数的贪心 阅读全文