- 博客(45)
- 收藏
- 关注
原创 新增端口用于ssh
内部服务器新增端口修改sshd_config配置文件vi /etc/ssh/sshd_config找到Port和ListenAddress的配置区域,进行如下修改Port 22Port 24922Port 18622说明:打开22注释以防配置发生意外,无法连接服务器重启sshd服务systemctl restart sshd查看端口开放状态netstat -nap | grep sshd...
2020-07-03 17:16:43
1300
原创 tensorflow 多GPU编程
1、如何在tensorflow中实现多GPU编程,目前看到介绍最详细的是tensorflow 多GPU编程(膜拜大佬)2、如何在keras中实现多GPU编程,详见官方文档Multi-GPU and distributed training3、实验:修改tensorflow官方教程中的 基于注意力的神经机器翻译”在合适的地方添加x下列句子。 strategy = tf.distribute.MirroredStrategy() with strategy.scope():str
2020-06-28 11:19:26
245
原创 Docker镜像拉取失败
具体报错:Error response from daemon: Get https://registry-1.docker.io/v2/解决方法:换源第一步:停止docker命令:systemctl stop docker第二步骤:配源(阿里的比较好,配这一个就够了)vim /etc/docker/daemon.json{“registry-mirrors”:[“https://6kx4zyno.mirror.aliyuncs.com”]}按esc退出编辑状态输入 :wq! 保存
2020-06-05 15:09:44
1751
原创 Postaman 报错:Could not get the lock, quitting
原因:已经有Postaman在运行或者因为某种原因意外中止解决方案:尝试杀死Postman的所有实例pkill -fi Postman
2020-05-31 15:51:07
1167
原创 poj3414 Pots (bfs加回溯)
题意:给出两个水壶的容量A,B, 和一个目标水壶容量C,对水壶可以有三种操作:1、FILL(i) fill the pot i (1 ≤ i ≤ 2) from the tap;把水壶(1或2)装满2、DROP(i) empty the pot i to the drain;把水壶(1或2)全部倒了3、POUR(i,j) pour from...
2018-11-01 18:21:30
196
原创 阿里云ECS,ssh连接超时,ping不通
Ubuntu(服务器)中 使用sudo ufw status命令查看当前防火墙的状态 inactive状态是防火墙关闭状态 active是开启状态。 ufw allow 22:允许 访问22端口 (ssh连接使用22端口)PS:这只是连接超时的一种情况,可能不适合所有的情况。...
2018-08-22 16:40:45
2861
原创 Windows下安装tensorflow-gpu的小坑
错误提示:No matching distribution found for setuptools<=39.1.0 (from tensorflow-gpu)解决方案:pip install --ignore-installed setuptools##现在安装的setuptools版本是40.0.0 高于tensorflow-gpu需要的,但不急pip install...
2018-08-05 23:44:20
2166
原创 毕业论文-基于C#的局域网通信
局域网即时通讯工具的设计与实现PS:等有空了,放源码讲解吧。。。。目录局域网即时通讯工具的设计与实现1.引言1.1课题背景及意义1.2发展现状1.2.1产品同质化的现象严重1.2.2产品定位不够精准1.3系统目标1.3.1显示主机名称及IP地址1.3.2收发文件、发送实时图像及发送录音...
2018-08-05 17:49:55
3796
2
原创 Tensorflow机器学习项目实战--1.5.2读取图像数据
修改书上的代码,添加少量注释。环境:python 3#导入tensorflowimport tensorflow as tf#新建一个Sessionsess = tf.Session()#tf.train.string_input_producer产生一个文件名队列#shuffle属性在读取多个文件事需要注意filename_queue = tf.train.string_...
2018-07-29 17:19:12
352
原创 Windows下fopen,fclose
Fopen(),fclose()在头文件#include <stdio.h>fopen()用来以指定的方式打开文件,其原型为: FILE * fopen(const char * path, const char * mode);//【参数】path为包含了路径的文件名,mode为文件打开方式。例如:FILE *fp;if((fp=fopen("D:\\a.txt","r"))=...
2018-02-10 16:31:33
2849
原创 课程设计-多种排序方式
各种排序方式的使用一、排序的简单介绍排序算法的稳定性:稳定性是指能保证排序前2个相等的数其在序列的前后位置顺序和排序后它们两个的前后位置顺序相同。例如,a1、a2的值相等,排序前 a1在a2位置前,排序后a1还是在a2位置前,则算法稳定。下面举例时,都按从小到大排序。(1)直接插入排序 (Straight Insertion Sort)时间复杂度 O(n^2) 空间复杂度 O(1) 稳定将要...
2018-02-10 10:56:10
2598
原创 poj 2991 线段树 成段更新 + 向量旋转
题目链接:http://poj.org/problem?id=2991输入数据:n条线段,c条指令n条线段的长度li(最初的线段都是在y轴上的)c条的指令是s,a,表示第s条线段和第s+1条线段的夹角调整为a度每执行完一条命令输出最后一条线段末尾的坐标注意:输出的时候,c++中用%lf,g++中用%f。keep[maxn]保存第i条边与i-1边的夹角(初始化为180
2016-12-04 22:21:20
344
原创 poj 1113 Wall
题意:国王要建一座墙围住国王所有的城堡,要求墙上任意一点到城堡的距离大于L,同时墙的长度最短。输出墙的长度(四舍五入)。 墙的长度 = 城堡的点构成的凸包的长度 + 以L为半径的圆的周长 黑色的是城堡连接成的凸包,外围黄色的部分是墙,顶点上 是圆弧#include <iostream>#include <algorithm>#include <cmath>using namespace s
2016-08-27 19:28:07
366
原创 poj 1228 Grandpa's Estate
题意:判断给出的点组成的凸包是不是稳定凸包稳定土包:凸包的每条边上至少有三个点题意略难理解..............#include #include #include #include using namespace std;const int MAXN = 10005;struct node{ double x,y;}p[MAXN];in
2016-08-27 17:05:08
439
原创 light 1011 - Marriage Ceremonies
dp[][]#include #include #include #include #include using namespace std;int map[20][20];int n;int dp[20][66000];int main(){ int t;
2016-08-26 20:49:02
298
原创 poj 3348 Cows
题意:给出若干点的位置,计算由这些点组成凸包的面积S(农场面积),每头牛至少要50平方米,所以输出S/50的整数部分即可计算凸包面积n边形可以划成n-2个三角形已知三角形顶点坐标,求三角形面积最直接的公式设A(x1,y1),B(x2,y2),C(x3,y3)在坐标系中中顺序为三点按逆时针排列S=1/2[(x1y2-x2y1)+(x2y3-x3y2)+
2016-08-26 20:23:29
381
原创 light 1005 - Rooks
题意: n行n列,放置k颗棋子的方案数,棋子不能放在同行同列n行先拿出k行(无顺序)(n!)(n−k)!∗k!\frac{(n!)}{(n-k)!*k!} 每行有n列 ,每列放一个(有顺序)(n!)(n−k)!\frac{(n!)}{(n-k)!} 两个分式相乘整理可得((n!)(n−k)!)2∗1k!\left(\frac{(n!)}{(n-k)!}\right)^2*\frac{1}{k!
2016-08-24 21:28:13
333
原创 poj 1873 The Fortified Forest
题意:n棵树 xi, yi, vi, li 给出每棵树的位置( xi, yi ),价值vi, 砍了这棵树能造多长 的围墙 li n最大只有15,所以直接采用枚举满足条件 砍了的树足够将剩下的数围起来(凸包),输出 剩下的树的价值和最大的方案。存在多种方案时,输出,剩下的树最少的方案Forest 1Cut these trees: 砍了哪些树E
2016-08-24 16:20:54
297
原创 poj 2007 凸包 极角排序
//double atan2( double y, double x );//y/x的反正切值,结合计算所在的象限。 //是一个弧度值,要换算成角度,也必须乘以180/PI。//奇怪的是把数据类型由doule改为int就过了//#include #include #include #include #include #include using name
2016-08-24 15:52:55
254
原创 light oj 1004 - Monkey Banana Problem
数塔n行之前 dp[i][j] = max(dp[i-1][j-1], dp[i-1][j]) + 数塔上的数; i行第j个n行至后,dp[n+i][j] = max(dp[n+i-1][j], dp[n+i-1][j+1]) + 数塔上的数;#include #include #include using namespace std
2016-06-02 10:42:07
292
原创 zoj 3430 AC自动机
题目链接:http://acm.hust.edu.cn/vjudge/problem/visitOriginUrl.action?id=16400把输入的字符根据下表,转化成value数字,在转化成6位的二进制,载8个二进制一组划分,转化成0~255的数字(ASCII字符的十进制),然后就是AC自动机模版的事了。一个=表示转化得到的二进制末尾要去掉2个0Value
2016-04-24 22:56:32
258
原创 hdu 4352
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=4352看最后一段就够了一个数的力量是这个
2016-04-17 20:52:34
297
原创 poj 3252
题目链接:http://poj.org/problem?id=3252题意:给定范围l,r;求有多少个数的二进制0的个数大于等于1的个数#include #include #include using namespace std;typedef __int64 ll;int num[40];ll dp[40][40][40];//dp[len][zero][o
2016-02-27 20:41:53
272
原创 hdu 4507
题目链接:需要维护三个数 个数count,满足条件数的和sum,数的平方和square;一个数 = (a*10的pre次方+b);b一个数的平方 = (a*10的pre次方*a*10的pre次方 + 2*a*10的pre次方*b + b*b);len时(len-1的数在nxt中)count : 直接加nxt.cnt;sum :加nxt.sum(对应b)
2016-02-24 21:08:10
362
原创 codeforces 55D
题目链接:http://codeforces.com/problemset/problem/55/D需要维护三个数 个数count,满足条件数的和sum,数的平方和square;一个数 = (a*10的pre次方+b);b一个数的平方 = (a*10的pre次方*a*10的pre次方 + 2*a*10的pre次方*b + b*b);len时(len-1的数在nxt中)
2016-02-24 19:34:26
326
原创 hdu 4509
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=4509#include #include using namespace std;int num[1450];int main(){ int a,b,c,d; int n,r,ans,i; while(~scanf("%d",&n)) {
2016-02-06 20:37:57
512
原创 poj 3311 floyd + 状态
题目链接:http://poj.org/problem?id=3311先Floyd处理了,变成tsp问题if(k == 0)tem = 0;else tem = (1dp[i+tem][k] = min(dp[i+tem][k],dp[i][j]+map[j][k]);//由这次状态写出下次的#include #include #define inf 0x7
2015-12-01 23:09:19
271
原创 poj 1185 状态压缩dp
题目链接:http://poj.org/problem?id=1185第i行的状态由第I-1行和第i-2行决定dp[i][j][k] = max(dp[i][j][k],dp[i-1][k][p]+cou[j]); 初始化第i=0行就够了,因为不会访问i-2#include //改成c++就过原来用c的,wal#include int n,m;int sta[6
2015-11-29 22:52:55
289
原创 hdu 1502 大数dp
题目链接:转移方程#include #include char dp[65][65][65][80];int i,j,k;int max(int a,int b){ if(a > b) return a; return b;}void add(char a[],char b[],char c[]){ int len1,
2015-11-19 21:07:07
828
原创 hdu 3008
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=3008InputThere are several test cases,intergers n ,t and q (00) in the first line which mean you own n kinds of skills ,and the "ResumingCircle
2015-11-16 23:19:38
790
原创 hdu 1501
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1501题意:判断能不能由前前两段字符组成第三段字符转移方程: dp[i][j] = (dp[i][j-1]&&str2[j-1]==str3[i+j-1]) || (dp[i-1][j] && str1[i-1]==str3[i+j-1]))str1[]的前I个字符和str2[]的前j个
2015-11-16 23:12:16
320
原创 hdu 1224
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1224题意:求最长上升子序列,有路径限制#include #include int dp[120];int map[120][120];int pre[120];int num[120];void p(int x){ if(pre[x] == 1) {
2015-11-13 20:29:32
280
原创 hdu 1081(最大子矩阵和)
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1081先求每列第一个元素到每个元素的和 s[i][j] = s[i-1][j] + num[i][j];在求第i行到 j 行的每列的和(1每求出一组t[n],求一次最大字段和#include #include int s[110][110];int num[11
2015-11-04 21:36:01
326
原创 hdu 1114 多重背包
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1114#include #define max 0x3f3f3f3f//大一点,不然有wa的可能int dp[10010];int num[510][2];int min(int a,int b){ return a<b?a:b;}int main(){ int te
2015-10-30 16:34:12
222
原创 hdu 1058
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1058题意:由有限个2,3,5,7相乘得到的数,从小到大排序。听说这个不过的要去找英语老师#include #include #include using namespace std;int num[6000];int main(){ int a,b,c,d; in
2015-10-29 19:09:25
333
原创 hdu 2571
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=2571题意:从点(1,1)走到(n,m),走的每个格子都有数据,格子相加的数据最大。#include #include #include int num[25][1010];int dp[25][1010];int main(){ int t,n,m;
2015-10-11 20:49:19
319
原创 hdu 2602
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=2602题意:简单的01背包,每个物品都有大小和价值,问在V的背包能装下的最大价值转移方才:dp[j] = max(dp[j],dp[j-v[i]]+value[i]);#include #include #include int dp[1010];int value[101
2015-10-11 12:10:49
244
原创 hud 1505
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1505题意:二维的1506,求最大全 F 矩阵的面积。求出每个点F向上连续的的高度,然后一行行求每行最大连续的值
2015-10-10 17:27:49
247
原创 hdu 1506
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1506题意:求最大能截取的面积用动态规划求,每块木板向左(向右)方向上,连续大于等于自己长度的最左(右)边的木板,记录编号遍历所有木板求(right[i] - left[i])*num[i]的最大值,输出;注意:木板的长度 要用long long或者_int64num 2 1
2015-10-10 16:37:29
287
原创 hdu 1231
第1行给出正整数K( 输出最大和、最大连续子序列的第一个和最后一个元dp[i] = max(dp[i-1]+num[i],num[i])#include #include using namespace std;int dp[10010];int num[10010];int s[10010];int main(){ int i,k,flag;
2015-10-09 22:05:14
231
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人