• 博客园logo
  • 会员
  • 周边
  • 新闻
  • 博问
  • 闪存
  • 众包
  • 赞助商
  • Chat2DB
    • 搜索
      所有博客
    • 搜索
      当前博客
  • 写随笔 我的博客 短消息 简洁模式
    用户头像
    我的博客 我的园子 账号设置 会员中心 简洁模式 ... 退出登录
    注册 登录
 






xujian9502

 
 

Powered by 博客园
博客园 | 首页 | 新随笔 | 联系 | 订阅 订阅 | 管理

2015年7月8日

cf #308 div2
摘要: C乱搞。。。有时间问问正解。。。D枚举一个点。。然后枚举其他点计算斜率。 斜率存起来乱搞一下。E暴力枚举括号的位置。然后求一下表达式的值。 阅读全文
posted @ 2015-07-08 11:10 xj9502 阅读(101) 评论(0) 推荐(0)
 

2015年1月14日

STL map
摘要: #includemapMapName;element.first 和 element.second 访问 key 和 value。关于迭代器 map :: iterator ite; 用迭代器遍历map for(ite = Map.begin(); ite != Map.end(); ite+... 阅读全文
posted @ 2015-01-14 14:53 xj9502 阅读(134) 评论(0) 推荐(0)
 

2014年7月30日

bzoj1588 裸 splay 模板题
摘要: 以前做过了。。重新做一下。 然后被坑出翔。。看了以前代码。。加了 if(scanf("%d",&vv)==-1) vv=0 之后秒过了。。。尼玛。。简直了。。#include #include #include #include #include #include using namespace s... 阅读全文
posted @ 2014-07-30 16:43 xj9502 阅读(1766) 评论(1) 推荐(0)
 
poj3468 线段树 or splay
摘要: poj3468 裸线段树。因为在熟悉splay 所以就用splay交了一发。。。开始用的scanf()!==2 居然TLE了。。。然后我就当单组测试数据做的 然后就过了 囧TZ #include #include #include #include #include #include using n... 阅读全文
posted @ 2014-07-30 11:13 xj9502 阅读(1013) 评论(0) 推荐(0)
 

2014年4月10日

训练赛。
摘要: http://www.bnuoj.com/bnuoj/contest_show.php?cid=3743#infoA按照给定的表的顺序判断一下输出就可以了。。。#include #include using namespace std;int main(){ int T,x; scanf("%d",&T); while (T--){ scanf("%d", &x); if (x == 1 || x == 5 || x == 6) puts("Unknown"); else{ if(x==11... 阅读全文
posted @ 2014-04-10 17:18 xj9502 阅读(328) 评论(0) 推荐(0)
 

2013年4月9日

常指针与常量指针
摘要: const char *p;char const *p 常量指针。 一个指向常量的指针,指针是变量。char* const p; 指针常量。指针本身是一个常量。const char* const p;指向常量的指针常量。指针是常量,且指向一个常量。 阅读全文
posted @ 2013-04-09 16:32 xj9502 阅读(151) 评论(0) 推荐(0)
 

2013年3月22日

gdb
摘要: 编译时必须加上参数-g ,例:g++ -g temp.cpp -o temp.通过Gcc编译生成可执行文件才能用Gdb进行调试。进入gdb界面:gdb temp.提示符变成(gdb)(1)查看文件在Gdb中键入”l”(list)就可以查看所载入的文件(2)设置断点只需在”b”后加入对应的行号即可(这是最常用的方式,另外还有其他方式设置断点)。如下所示:(gdb)b 6代码运行到第五行之前暂停(并没有运行第五行)。(3)查看断点情况(Gdb)info b(4)运行代码Gdb默认从首行开始运行代码,可键入”r”(run)即可(若想从程序中指定行开始运行,可在r后面加上行号)。(5)查看变量值查看断 阅读全文
posted @ 2013-03-22 20:46 xj9502 阅读(185) 评论(0) 推荐(0)
 

2012年9月28日

STL priority_queue
摘要: 双关键字 优先级队列按 f关键字 为 第一关键字 从大到小按 b关键字 为 第二关键字 从小到大cmp 与 sort 的恰好相反....#include <iostream>#include <cstdio>#include <cstdlib>#include <algorithm>#include <queue>#include <cmath>using namespace std;int n,m,t;struct node{ int b,f; };struct cmp{ bool operator()(node &am 阅读全文
posted @ 2012-09-28 14:57 xj9502 阅读(147) 评论(0) 推荐(0)
 

2012年7月23日

dijkstra spfa记录最短路径路线
摘要: path[i] 为 原点到i 的最短路径中 i的前驱结点。if(dis[j]>dis[u]+cost[u][j]){ dis[j]=dis[u]+cost[u][j]; path[j]=u;}最后while 或 递归输出即可 阅读全文
posted @ 2012-07-23 17:54 xj9502 阅读(183) 评论(0) 推荐(0)
 
floyd 记录最短路径路线
摘要: 设 path[i][j] 记录i到j的最短路径中j的前驱顶点。初始化: i到j有边,则 path[i][j]:=i; path[j][i]:=j;for k:=1 to n do for i:=1 to n do for j:=1 to n do if d[i][k]+d[k][j]<d[i][j] then begin d[i][j]:=d[i][k]+d[k][j]; path[i][j]:=path[k][j]; end; 阅读全文
posted @ 2012-07-23 17:19 xj9502 阅读(765) 评论(1) 推荐(0)
 
下一页