|
[原创]X64调用门的使用---R3提权R0读写MSR ---支持WIN7 WIN10
你动GDT表,PG不管吗,时间长了大概率还是会蓝屏 |
|
|
|
|
|
|
|
|
|
[原创]代码混淆之我见(一)
腻害腻害 |
|
|
|
信息学竞赛技能树问题求解!WRONG到吐血了
已自己解决~ 是没赋初值的问题 下面是AC的程序 #include <iostream> #include <cstdio> #include <cstring> #include <cstdlib> #define MAXN 60 using namespace std; int map[MAXN][MAXN]; int f[MAXN][MAXN][505]; int sum[MAXN][MAXN]; //第i列第1行到第j行的和 int main() { freopen("Test.in","r",stdin); freopen("Test.out","w",stdout); int i,j,k,v; int N,M; int maxSum = -1; int temp; scanf("%d %d",&N,&M); for(i = 1;i <= N;i ++) { for(j = 1;j <= N+1-i;j ++) { scanf("%d",&map[i][j]); } } for(i = 1;i <= N;i ++) { for(j = 1;j <= N+1-i;j ++) { sum[i][j] = sum[i-1][j] + map[i][j]; } } for(i = N;i >= 1;i --) for(j = 0;j <= N-i+1;j ++) for(k = 0;k <= M;k ++) f[i][j][k] = -987654321; f[N+1][0][0] = 0; //f[N][1][1] = map[N][1]; for(i = N;i >= 1;i --) { for(j = 0;j <= N-i+1;j ++) { for(k = j;k <= M;k ++) { for(v = j-1;v <= N-i;v ++) { f[i][j][k] = max(f[i][j][k],f[i+1][v][k-j]); } f[i][j][k] += sum[j][i]; if(maxSum < f[i][j][k]) { maxSum = f[i][j][k]; } } } } printf("%d\n",maxSum); return 0; } |
|
POJ2052 FLOYD算法解决,WRONG到吐了
[QUOTE=李晓岚;1006544] printf("%d",(int)(map[1][2]+0.5)); 需要round to nearest integer.[/QUOTE] 非常非常非常感谢!!!分给你了 最后输出 printf("%d",(int)(map[1][2]+0.5)); AC了 贴出完整代码给以后纠结这个问题的人参考 #include <iostream> #include <cstdio> #include <cstring> #include <cstdlib> #include <math.h> #define MAXN 205 #define MAX 999999 struct node { int line; //-1 suggest that this is start point,-2 refer to end point int x,y; }NODE[MAXN]; int nowPoint = 1; double map[MAXN][MAXN]; void createNode(int line,int x,int y) { NODE[nowPoint].line = line; NODE[nowPoint].x = x; NODE[nowPoint].y = y; nowPoint ++; } int main() { freopen("Test.in","r",stdin); freopen("Test.out","w",stdout); double ls; int i,j,k; int sX,sY,eX,eY; int stopX,stopY; scanf("%d %d %d %d",&sX,&sY,&eX,&eY); createNode(-1,sX,sY); createNode(-2,eX,eY); //先创建1,2下标为起点和重点 int lineNumber = 1; while(scanf("%d %d",&stopX,&stopY) != EOF) { if(stopX == -1 && stopY == -1) { lineNumber ++; } else { createNode(lineNumber,stopX,stopY); } } //建图 for(i = 1;i < nowPoint;i ++) { for(j = 1;j < nowPoint;j ++) { if(i == j) { map[i][j] = 0.0; } else if(i != j && map[i][j] == 0.0) { if(NODE[i].line == NODE[j].line && (i == j-1 ||i == j + 1))//一条线上的,坐地铁到达 { ls = (sqrt((double)((NODE[i].x-NODE[j].x)*(NODE[i].x-NODE[j].x)+(NODE[i].y-NODE[j].y)*(NODE[i].y-NODE[j].y))))/4000*6.0; map[i][j] = ls; map[j][i] = ls; } else //步行到达 { ls = (sqrt((double)((NODE[i].x-NODE[j].x)*(NODE[i].x-NODE[j].x)+(NODE[i].y-NODE[j].y)*(NODE[i].y-NODE[j].y))))/1000*6.0; map[i][j] = ls; map[j][i] = ls; } } } } //floyd for(k = 1;k < nowPoint;k ++) { for(i = 1;i < nowPoint;i ++) { if(i != k) { for(j = 1;j < nowPoint;j ++) { if(i != j) { if(map[i][j] > map[i][k] + map[k][j]) { map[i][j] = map[i][k] + map[k][j]; } } } } } } printf("%d",(int)(map[1][2]+0.5)); return 0; } |
|
POJ2052 FLOYD算法解决,WRONG到吐了
[QUOTE=李晓岚;1006435]我说的意思是,假如一条地铁线路经过三个站点,只能坐地铁从一号到二号,从二号到三号,而并不能直接从一号直接到三号。所以if(NODE[i].line == NODE[j].line)//一条线上的,坐地铁到达 ,而且是直接到达,不经过其它中间站点,这个判断条件是不对的。[/QUOTE] 确实是这个地方有问题,NODE[i].line == NODE[j].line && (i == j-1 ||i == j + 1)条件改成这个还是不行能帮忙修改下吗?我调了一天半,实在是不知道再怎么改了 跪谢! |
|
POJ2052 FLOYD算法解决,WRONG到吐了
[QUOTE=李晓岚;1006380]if(NODE[i].line == NODE[j].line)//一条线上的,坐地铁到达 { ls = (sqrt((double)((NODE[i].x-NODE[j].x)...[/QUOTE] 这是建图过程的代码,前面加了约束条件map[i][j] == 0.0,是为了加快效率,而且你从i到j,和从j到i的时间是一样的 |
|
[求助]帮忙推荐几本好的算法书
《算法导论》,必须的! |
|
|
|
[求助]小弟15岁,不只是否可以学C++
完全可以,想学就直接开始不用想那么多 |
操作理由
RANk
{{ user_info.golds == '' ? 0 : user_info.golds }}
雪币
{{ experience }}
课程经验
{{ score }}
学习收益
{{study_duration_fmt}}
学习时长
基本信息
荣誉称号:
{{ honorary_title }}
能力排名:
No.{{ rank_num }}
等 级:
LV{{ rank_lv-100 }}
活跃值:
在线值:
浏览人数:{{ visits }}
最近活跃:{{ last_active_time }}
注册时间:{{ user_info.create_date_jsonfmt }}
勋章
兑换勋章
证书
证书查询 >
能力值