这种线性最值问题一般不是贪心就是动归 应该是道贪心题,因为每一列的值与其他列没有什么关系(这是判断贪心问题的根本大法),对于每一列找出使其Hamming距离最小的值即可,由于此题只要值相同就是0,值不同就是1,没有远近之分,所以每一个值都是原来出现次数最多的值。 一定注意出现多解的时候如何选择!!! ...
分类:
其他好文 时间:
2020-10-22 23:11:08
阅读次数:
33
在讲述任意一个指定一个指定区间内素数打印之前,为了让像我一样的小白有一个循序渐进的过程,我们先随意指定一个固定区间,比如100~200,来打印一下这个区间中的素数。#include<stdio.h>//素数是除了1和它本身之外,无法被其他自然数整除的数``intmain(){for(inti=100;i<=200;i++){intj=2;//j若写到for循环内,j的生命周期便仅
分类:
编程语言 时间:
2020-10-22 22:39:49
阅读次数:
39
#include<iostream> #include<cstdio> #include<algorithm> #include<cmath> #define N 500005 using namespace std; int n,m,s,x,y; int tot,fr[N],nxt[N << 1] ...
分类:
其他好文 时间:
2020-10-18 17:08:25
阅读次数:
33
题目链接 Haywire 分析 模拟退火裸题,交了 $4$ 次 \(Code\) #include<cstdio> #include<algorithm> #include<cmath> using namespace std; int n , a[15][5] , pos[15] , tmp[15 ...
分类:
其他好文 时间:
2020-10-14 20:36:25
阅读次数:
23
os: centos 7.4db: postgresql 12.2 postgresql 12 的分区表已经比较完善。 版本 # cat /etc/centos-release CentOS Linux release 7.4.1708 (Core) # # su - postgres Last l ...
分类:
数据库 时间:
2020-10-10 18:04:17
阅读次数:
54
vulnhub靶机writeup之WestWild:1.1 靶机目标: 目标1:FLAG1.txt 目标2:提权(拿到root权限) 使用工具: arp-scan、nmap、enum4linux、ssh 操作过程: 一、FLAG1.txt 打开靶机后先扫描网段内存活主机,发现存活主机192.168. ...
分类:
其他好文 时间:
2020-10-08 19:42:51
阅读次数:
33
模板 \(Problem:\) 求 \(n\) 个模式串在文本串中出现的次数 \(templete:\) \(Luogu5357\) \(Code\) #include<cstdio> #include<cstring> using namespace std; const int N = 2e5 ...
分类:
其他好文 时间:
2020-10-08 18:13:37
阅读次数:
17
浙江大学数据结构:01-复杂度2 Maximum Subsequence Sum (25分) Given a sequence of K integers { N?1??, N?2??, ..., N?K?? }. A continuous subsequence is defined to be ...
分类:
其他好文 时间:
2020-10-07 20:34:58
阅读次数:
26
1 #include<stdio.h> 2 #include<time.h> 3 #include<stdlib.h> 4 5 int main() 6 { 7 time_t t; 8 int man,computer,sum; 9 t= time(NULL); 10 11 srand(t); 12 ...
分类:
编程语言 时间:
2020-10-06 21:12:15
阅读次数:
27
戴着假发的程序员出品 [查看视频教程] context:component-scan是用来通知spring自动扫描指定的包中的类文件的。 use-default-filters属性是用来通知spring是否启用默认的Filter。这个配置默认是true,spring的默认Filter就会处理@Com ...
分类:
其他好文 时间:
2020-10-06 20:40:57
阅读次数:
29