CSP
Capsfly
这个作者很懒,什么都没留下…
展开
-
山东大学《程序设计思维》板子
如果读者想打印/复习,欢迎访问下方的链接进行下载,上传了md和pdf版本,更方便阅读/使用地址:原创 2022-06-15 22:00:48 · 358 阅读 · 0 评论 -
以一道CSP T4说明dijkstra算法的证明及其变形应用
证明:这个版本的证明比较简洁易懂 问题: 状态表示:d[i]:从1−i的路径上的最大边权的最小值状态表示:d[i]:从1-i的路径上的最大边权的最小值状态表示:d[i]:从1−i的路径上的最大边权的最小值 状态转移:d[v]=min(d[v],max(d[v],w))假设当前弹出的顶点是u,且u与v的临接边是w状态转移:d[v]=min(d[v],max(d[v],w))\\假设当前弹出的顶点是u,且u与v的临接边是w状态转移:d[v]=min(d[v],max(d[v],w))假设当前弹出的顶点是u,且u原创 2022-06-12 15:52:15 · 120 阅读 · 0 评论 -
2019CSPT2&&循环queue的使用
#include <bits/stdc++.h> using namespace std; const int N=1000+10; const int M=1000+10; int a[N][M]; int n; int num; int tol; int drop[N]; int cnt; int gro; int main(){ cin.tie(0); cin>>n; for(int i=1;i<=n;i++){ cin>&原创 2021-04-25 21:30:25 · 120 阅读 · 0 评论 -
2019CSPT2和map用法
#include <bits/stdc++.h> using namespace std; const int N=1000+50; int x[N],y[N]; int cnt[10]; int loc[10]; int n; int nx,ny; unordered_map<int,unordered_map<int,int>>m; int jud(int x,int y){ if(m[x][y+1]&&m[x][y-1]&&原创 2021-04-25 19:06:30 · 146 阅读 · 0 评论 -
2020CSPT2
#include <bits/stdc++.h> using namespace std; int cnt1;//经过 int cnt2;//逗留 int n,k,t,xl,xr,yd,yu; int nx,ny; int main(){ cin.tie(0); cin>>n>>k>>t>>xl>>yd>>xr>>yu; for(int i=0;i<n;i++){原创 2021-04-23 20:42:52 · 122 阅读 · 0 评论 -
2020CSPT2
#include <bits/stdc++.h> using namespace std; const int M=1E5+50; struct stu{ int id; int flag=0;//用flag来帮忙排序 int cnt1=0; int cnt0=0; }; stu st[M]; int n; bool cmp(stu&i,stu&j){ return i.flag>j.flag; } int cnt; int zer原创 2021-04-23 11:49:54 · 72 阅读 · 0 评论 -
2021CSPT2
试题编号: 202104-2 试题名称: 邻域均值 时间限制: 1.0s 内存限制: 512.0MB 问题描述: 试题背景 顿顿在学习了数字图像处理后,想要对手上的一副灰度图像进行降噪处理。不过该图像仅在较暗区域有很多噪点,如果贸然对全图进行降噪,会在抹去噪点的同时也模糊了原有图像。因此顿顿打算先使用邻域均值来判断一个像素是否处于较暗区域,然后仅对处于较暗区域的像素进行降噪处理。 问题描述 待处理的灰度图像长宽皆为 个像素,可以表示为一个 大小的矩阵 ,其中每个元素是一个 范围内的整数,表示对应位置原创 2021-04-20 18:22:52 · 428 阅读 · 1 评论