leetcode negative numbers matrix
[LeetCode] 1003. Check If Word Is Valid After Substitutions
Given a string s, determine if it is valid. A string s is valid if, starting with an empty string t = "", you can transform t into s after performing ......
Leetcode1~10题整理
1. 两数之和 哈希表:O(n) class Solution { public: vector<int> twoSum(vector<int>& nums, int target) { unordered_map<int, int> hs; int n = nums.size(); for(int ......
[ABC276Ex] Construct a Matrix
没有题解,所以来写一篇。 Description 构造一个 $N\times N$ 的矩阵 $A$,其中 $A_{i,j}\in {0,1,2}$,要求同时满足 $Q$ 条限制。 每条限制形如:给定 $a,b,c,d,e$,要求 $A$ 满足 $\prod\limits_{i=a}^b\prod\l ......
LeetCode 链表操作
21. 合并两个有序链表 /** * Definition for singly-linked list. * public class ListNode { * int val; * ListNode next; * ListNode() {} * ListNode(int val) { this ......
题解 CF1325E【Ehab's REAL Number Theory Problem】
problem 给一些数,每个的因数个数不超过 7,求最少选出多少个,使得乘积为完全平方。无解输出 −1。$n=10^5,V=10^6$。 solution 如果一个数有三个不同的质因子,那么它至少有 8 个约数;如果一个数有平方因子,我们可以除掉。 所以任何数都可以写成下面三种形式:($p,q$ ......
7-009-(LeetCode- 309) 最佳买卖股票时机含冷冻期
1. 题目 读题 考查点 2. 解法 思路 代码逻辑 具体实现 1 1 3. 总结 ......
LeetCode/移动石子直到连续
###1. 移动石子直到连续(三个石子) class Solution { public: vector<int> numMovesStones(int a, int b, int c) { int x = min({a, b, c}); int z = max({a, b, c}); int y ......
ABC256E Kth Number题解
题目传送门 题意:给定 $p\le n$ 个值域为 $1\sim m$ 的数,你需要将其补充到 $n$ 个,每个数都在 $[1,m]$ 内独立随机。求最终第 $K$ 小数的期望值。$n,m\le 2000$ 看到这个问题,就容易想到枚举第 $K$ 位的值,计算概率(或者方案数)。首先将其给定的 $p ......
Vulnhub靶机笔记2——matrix-breakout-2-morpheus
一、介绍 一个以《黑客帝国》为背景的靶场 涉及内容 主机发现 端口服务扫描 1.2不用工具实现 ffuf目录爆破 一句话木马 反弹shell msf,蚁剑使用 图片隐写 CVE-2022-0847漏洞利用 二、环境 攻击机:kali 靶机:matrix-breakout-2-morpheus 三、过 ......
杜教筛 & Powerful Number 筛
迪利克雷卷积 对于数论函数 $F$,$G$,我们定义迪利克雷卷积的结果 $H=FG$ 为 $$ H_n=\sum_{d\mid n}F_d G_\frac{n}{d} $$ 有些好的性质,比如:对于积性函数 $F$ 与 $G$,其迪利克雷卷积 $FG$ 也是积性函数;而在迪利克雷卷积的意义下,积性函 ......
[LeetCode] 1033. Moving Stones Until Consecutive
There are three stones in different positions on the X-axis. You are given three integers a, b, and c, the positions of the stones. In one move, you p ......
leetcode_D10_136只出现一次的数字
1.题目 2.解一 leetcode官方解法,主要用到了两个知识:第一个是reduce函数,需要注意的是在python3中,需要 通过“ from functools import reduce ”从模块中调用该函数;第二个知识是位运算中的异或运算,主要有以下计算法则。 有了这两个补充知识,该题目就 ......
张量(Tensor)、标量(scalar)、向量(vector)、矩阵(matrix)
张量(Tensor):Tensor = multi-dimensional array of numbers 张量是一个多维数组,它是标量,向量,矩阵的高维扩展 ,是一个数据容器,张量是矩阵向任意维度的推广 注意,张量的维度(dimension)通常叫作轴(axis), 张量轴的个数也叫作阶(ran ......
2023-04-28 LeetCode精选题目20道附我的Java实现
LeetCode精选题目20道 1.56.合并区间 贪心 给出一个区间的集合,请合并所有重叠的区间。 示例 1: 输入: intervals = [[1,3],[2,6],[8,10],[15,18]] 输出: [[1,6],[8,10],[15,18]] 解释: 区间 [1,3] 和 [2,6] ......
2、题目:The Informed Design Teaching and Learning Matrix
期刊信息 (1)作者:Crismond, David P. (2)期刊:Journal of Engineering Education, 2012, 101(4): 738–797 (3)DOI:10.1002/j.2168-9830.2012.tb01127.x (4)ISSN:10694730 ......
Oracle较长number型数值的科学计数显示
表中有id列,类型为number,在sqlplus中查询的时候,查询结果的显示方式为科学计数法: ID 4.5572E+184.5574E+184.5585E+18 这样看起来很不直观,而之所以这样显示的原因是在SQL*Plus下,小于等于10位的精度显示的是很直观的形式,大于10位精度的则显示为科 ......
C语言刷leetcode——并查集
概述 https://leetcode.cn/problems/number-of-provinces/solution/python-duo-tu-xiang-jie-bing-cha-ji-by-m-vjdr/ 基本概念 并查集是一种数据结构 并查集这三个字,一个字代表一个意思。 并(Union ......