摘要: 原题链接 思路 本题目数据量较弱,所以可以考虑直接用dfs 代码 #include<iostream> using namespace std; int ans; void dfs(int n, int d, int k){ if(k == 0){ if(n == 0) ans++; return; 阅读全文
posted @ 2023-04-07 15:59 天黑星更亮 阅读(22) 评论(0) 推荐(0)
摘要: 介绍 本文附录了通过LBPH实现简单人脸识别的源代码,分类效果并不是很好,供个人学习使用。 人脸录入.py import cv2 cap = cv2.VideoCapture(0) flag = 1 num = 0 while (cap.isOpened()): ret_flag, Vshow = 阅读全文
posted @ 2023-04-02 16:18 天黑星更亮 阅读(165) 评论(0) 推荐(0)
摘要: 用OpenCv-Python自带的LBPH识别器实现简单人脸识别(上) 引言: 本文开发环境为: Windows10 + phchram + Anaconda5.2 (Python3.6)+ Opencv4.5.5,用opencv-contrib原生的API完成了人脸识别的功能,其可以任意添加人脸I 阅读全文
posted @ 2023-04-02 16:12 天黑星更亮 阅读(511) 评论(0) 推荐(0)
摘要: 相邻石子合并问题 代码 #include<bits/stdc++.h> using namespace std; #define rep(i,a,n) for(int i = a; i <= n; i++) const int N = 330; int sum[N]; int a[N]; int f 阅读全文
posted @ 2023-04-02 10:25 天黑星更亮 阅读(35) 评论(0) 推荐(0)
摘要: 原题链接 代码 #include<iostream> #include<algorithm> using namespace std; const int N = 100010; const int mod = 1000000007; int a[N],b[N]; //总结: 记得开 long lo 阅读全文
posted @ 2023-04-02 10:15 天黑星更亮 阅读(22) 评论(0) 推荐(0)
摘要: 原题链接 解题思路 通过i和j来控制子矩阵的左右边界,通过s和t来控制子矩阵的上下边界, 在子矩阵的和小于k时候,统计子矩阵的个数。 代码 #include<iostream> using namespace std; const int N = 550; int a[N][N]; // i 与 j 阅读全文
posted @ 2023-04-02 09:29 天黑星更亮 阅读(22) 评论(0) 推荐(0)
摘要: 原题链接 代码 #include<iostream> using namespace std; const int N = 100010; int a[N],f[N]; int main(){ int n; cin >> n; int ans = 0, j = 1; for(int i = 1; i 阅读全文
posted @ 2023-04-02 09:22 天黑星更亮 阅读(13) 评论(0) 推荐(0)