ICode9

精准搜索请尝试: 精确搜索
  • abc 247 题解2022-05-24 17:00:20

    A - Move Right 给一个四位的二进制,输出右移一位的结果 #include <bits/stdc++.h> using namespace std; int n; string s ; int main() { cin >> s; cout << '0'; for( int i = 0 ; i <= 2 ; i ++ ) cout << s[i]; } B - Unique

  • find the Canny edge detection whose threshold values can be varied using two trackbars2022-02-22 21:35:23

    文章目录 前言Source CodeResult总结 前言 题目地址:https://docs.opencv.org/4.x/da/d22/tutorial_py_canny.html 题目内容: Write a small application to find the Canny edge detection whose threshold values can be varied using two trackbars. This way, you can

  • 信息学奥赛一本通评测系统P1338 最小函数值(minval)2022-02-10 23:58:10

    恭喜你看到了这篇题解,他会让你避开很多坑(新手推荐,大佬提些建议嘛) 当然,我不想让大佬像下面这道题中大佬一样。[AHOI2017/HNOI2017]大佬 - 洛谷https://www.luogu.com.cn/problem/P3724                                           

  • systemverilog中rand机制的 $urandom_range()函数2021-10-17 11:01:18

    使用SystemVerilog中的rand机制, 经常会用到$urandom_range()这个函数, 得到一个无符号的整型数. 语法:$urandom_range(int unsigned maxval,int unsigned minval = 0);​ 有两个参数,一个上限参数和一个可选的下限参数。 功能:返回一个在maxval和minval之间的无符号整数 exam

  • 选择排序2021-10-02 15:35:44

    选择排序 简单选择   #include <iostream> #include <vector> using namespace std; void swap(int &p, int &q); void selectSort(vector<int> &array, int n); int main() { int n; cin >> n; vector<int> array; a

  • 22.31 最小函数值(minval)2021-08-04 10:01:39

    题目描述 有n个函数,分别为F1,F2,...,Fn。定义Fi(x)=Ai*x^2+Bi*x+Ci(x∈N)。给定这些Ai、Bi和Ci,请求出所有函数的所有函数值中最小的m个(如有重复的要输出多个)。 输入格式 第一行输入两个正整数n和m。 以下n行每行三个正整数,其中第i行的三个数分别位Ai、Bi和Ci。输入数据保证Ai<=

  • LeetCode-155-最小栈2021-07-25 07:31:06

    最小栈 题目描述:设计一个支持 push ,pop ,top 操作,并能在常数时间内检索到最小元素的栈。 push(x) —— 将元素 x 推入栈中。 pop() —— 删除栈顶的元素。 top() —— 获取栈顶元素。 getMin() —— 检索栈中的最小元素。 示例说明请见LeetCode官网。 来源:力扣(LeetCode) 链接:http

  • LeetCode刷题之路--二分法2020-12-27 13:00:57

    来源:力扣(LeetCode) 链接:https://leetcode-cn.com/problems/divide-chocolate 分享巧克力 你有一大块巧克力,它由一些甜度不完全相同的小块组成。我们用数组 sweetness 来表示每一小块的甜度。 你打算和 K 名朋友一起分享这块巧克力,所以你需要将切割 K 次才能得到 K+1 块,每一块

  • 【python-opencv】canny边缘检测2020-06-16 10:04:32

    Canny Edge Detection是一种流行的边缘检测算法。它由John F. Canny发明,这是一个多阶段算法,我们将经历每个阶段。 1、降噪 由于边缘检测容易受到图像中噪声的影响,因此第一步是使用5x5高斯滤波器消除图像中的噪声。我们已经在前面的章节中看到了这一点。 2、查找图像的强度梯度 然

  • 暴力+DP:买卖股票的最佳时机2020-03-26 19:03:25

    给定一个数组,它的第 i 个元素是一支给定股票第 i 天的价格。 如果你最多只允许完成一笔交易(即买入和卖出一支股票一次),设计一个算法来计算你所能获取的最大利润。 注意:你不能在买入股票前卖出股票。   示例 1: 输入: [7,1,5,3,6,4]输出: 5解释: 在第 2 天(股票价格 = 1)的时候买入,在

  • P6033 Ryoku 的探索 (基环树)2020-01-31 19:52:17

    题目链接    题解: 图为一个基环树。 dfs找到环,对于环上的每一个点u, 确定与它连接的具有最小美观度的边的长度w, 把这个w值更新到与它连接的其他非环上点(minval[]数组),则u和与它连接的其他非环上点的答案即为所有边长度只和减去minval[i]。   Code: 1 #include <bits/stdc++

  • Android OpenCV(三):图像像素值统计2020-01-24 09:04:46

    图像像素值统计 图像像素最大值、最小值以及位置 图像均值、标准差 查找最大值、最小值 API public static MinMaxLocResult minMaxLoc(Mat src, Mat mask) 参数src:输入的图像矩阵 参数mask:可选的掩码矩阵 返回值 MinMaxLocResult:记录最小值、最大值及其位置 publi

  • 剑指offer-面试题63-股票的最大利润-数组2020-01-01 23:53:03

    /* 题目: 给定一个股价序列,求一次交易的最大利润。 */ #include<iostream> #include<vector> using namespace std; int MaxProfit(vector<int> numbers){ int length = numbers.size(); if(length < 2) return 0; int minVal = numbers[0]; int maxPr

  • AutoCad .Net二次开发求两曲线最小距离2019-12-28 20:53:36

    测试结果:   主要思路:假设有两条曲线分别是c1和c2,把c1按照1的距离划分我这里用变量jd表示,得到一个曲线集合coll,然后遍历coll,得到coll中每一个曲线的两个端点,再用这两个端点分别求离曲线c2的最短距离,直接使用开发库的GetClosestPointTo方法就可以了,直到遍历完整个coll集合就能得到

  • QT自定义控件之进度条2019-08-24 18:35:34

    #ifndef QPROG_H #define QPROG_H #include <QWidget> #include <QPainter> #include <math.h> #include <QString> #include <QMouseEvent> class QProg : public QWidget { Q_OBJECT Q_PROPERTY(double value READ value WRITE set

  • LeetCode 64 最小路径和2019-02-26 21:56:10

    题目: https://leetcode-cn.com/problems/minimum-path-sum/ 题意: 给定一个包含非负整数的 m x n 网格,请找出一条从左上角到右下角的路径,使得路径上的数字总和为最小。 说明:每次只能向下或者向右移动一步。 思路: 简单动态规划,状态转移方程: dp[i][j]=val[i][j]+min(dp[i−1][j],

  • LeetCode-152-Maximum Product Subarray2019-02-07 10:42:30

    算法描述: Given an integer array nums, find the contiguous subarray within an array (containing at least one number) which has the largest product. Example 1: Input: [2,3,-2,4] Output: 6 Explanation: [2,3] has the largest product 6. Example 2: Input: [-2,0,-

  • 创建指定个数,指定最小值,最大值的随机数2019-02-03 20:55:07

    /** * 创建指定个数,指定最小值,最大值的随机数 * @author ztd * @param count 随机数个数 * @param minVal 随机数最小值 * @param maxVal 随机数最大值 * @return */ public static List<Integer> createRandomList(int count, Integer mi

专注分享技术,共同学习,共同进步。侵权联系[81616952@qq.com]

Copyright (C)ICode9.com, All Rights Reserved.

ICode9版权所有