增加了标记,分水岭变换与着色,着色中的轮廓填充判定条件可以仔细看一下,下面是分水岭分割完整代码 #include"pch.h" #include<iostream> #include<opencv2/opencv.hpp> #include<math.h> using namespace std; ...
分类:
其他好文 时间:
2020-08-07 00:29:40
阅读次数:
104
#include<iostream> #include<vector> using namespace std; #define MAX 10005 #define REP(i,b,e) for(int i=b;i<e;i++) vector<int>b[MAX]; int a[MAX], p[MA ...
分类:
移动开发 时间:
2020-08-06 22:04:18
阅读次数:
115
#include<bits/stdc++.h> using namespace std; const int maxn=200; typedef long long ll; const ll mod=998244353; ll pow_m (ll a,ll b,ll mod) { ll res=1; ...
分类:
其他好文 时间:
2020-08-06 20:40:43
阅读次数:
59
A.LCM Problem 题意:最小公倍数LCM(x,y),处于[l,r]之间,并且x,y也处于[l,r]之间,给出l,r找出x,y; 思路:里面最小的最小公倍数就是基于l左端点的,而那个最小公倍数就是2*l,直接判断2*l是否小于r 注意:当时看到最小公倍数,题目中提到了一个LCM(9,6)=1 ...
分类:
其他好文 时间:
2020-08-06 13:09:24
阅读次数:
97
一:解题思路 二:完整代码示例 (C++版和Java版) C++代码: #include <iostream> using namespace std; int main() { int k = 0; int N = 0; int num = 0; while (cin >> k) { num = ...
分类:
其他好文 时间:
2020-08-05 22:14:18
阅读次数:
96
一:解题思路 这道题目的本质就是求斐波那契数列的第n项。 二:完整代码示例 (C++版和Java版) C++代码: #include <iostream> using namespace std; int main() { int months = 0; while (cin >> months) ...
分类:
其他好文 时间:
2020-08-05 19:41:00
阅读次数:
68
##题目 请编写程序,找出一段给定文字中出现最频繁的那个英文字母。 输入格式 输入在一行中给出一个长度不超过 1000 的字符串。字符串由 ASCII 码表中任意可见字符及空格组成,至少包含 1 个英文字母,以回车结束(回车不算在内)。 输出格式 在一行中输出出现频率最高的那个英文字母及其出现次数, ...
分类:
其他好文 时间:
2020-08-05 16:52:57
阅读次数:
79
一:解题思路 这道题目和leetcode72题,基本上是一样的,可以放在一起进行学习。 二:完整代码示例 (C++版和Java版) C++: #include <iostream> #include <string> #include <vector> #include <algorithm> us ...
分类:
其他好文 时间:
2020-08-04 14:04:02
阅读次数:
74
Kabaleo Lite 用带负数的大整数用__int128 #include <bits/stdc++.h> #define ll long long using namespace std; const int MAXN=200050,INF=0x3fffffff; ll n,a[MAXN],b ...
分类:
其他好文 时间:
2020-08-04 11:25:20
阅读次数:
327