自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(10)
  • 资源 (4)
  • 收藏
  • 关注

原创 BUPT OJ 非平方等式

纯粹数学题。如果无脑直接枚举肯定超时。所以我就超时了。。。后来分析了一下。x^2+s(x)*x-n=0,能拆开成 x*(x+s(x))=n的形式,由于n小于10^18次方,x最大s(x)=162,所以能够得到不等式  sqrt(n)-162剩下的就没啥了/*USER_ID: test#bupt_wcyPROBLEM: 130SUBMISSION_TIME: 2017-01

2017-01-26 21:18:18 770

原创 BUPT OJ 中序遍历树

水题。开始看错,当成按照每个节点代表的字符顺序访问了,后来改完就可以了。#include#include#includeusing namespace std;char func[101];bool relation[100][100]={false};bool visited[100]={false};string result;string temp;void dfs

2017-01-24 15:43:01 872

原创 BUPT OJ 虚数

#include#include#include#includeusing namespace std;class complex{ public: int real; int image; complex(int a=0,int b=0) { real=a; image=b; } };class cmp{ public: bool operator()(

2017-01-23 18:29:37 439

原创 BUPT OJ 寻找宝藏

水题#include#includeusing namespace std;class node{public: int parent; int branches; node() { branches=0; parent=-1; }};const int MAXSIZE = 10000;class tree{public: node point[MAXSIZ

2017-01-23 14:48:16 402

原创 BUPT OJ IP地址

水题#include#includeusing namespace std;inline bool ipstring(string ip){int threes=0;for(int i=0;i{if(ip[i]=='.')threes++;} return threes==3&&ip[ip.size()-1]!='.'&&ip[0]!='.';

2017-01-18 16:12:50 879

原创 BUPT OJ 矩阵幂

水题#include#include#define MAXSIZE 10using namespace std;int k;class matrix{ public: int n; int metric[MAXSIZE][MAXSIZE]; friend ostream& operator<<(ostream&out,matrix &a); friend istream&

2017-01-15 12:36:13 306

原创 BUPT OJ 最小距离查询

用了类似邻接表的结构,一个vector,存放每种字母对应的出现位置,并在插入时排序。用cin超时,scanf通过。。。 怪不得连题目描述里#include#include#include#include#include#include#define MAXSIZE 100001using namespace std;class node{ public:

2017-01-14 23:06:13 375

原创 BUPT OJ 中序遍历序列

水#include#include#includeusing namespace std;int main(){ int t,n,x; cin>>t; while(t--) { vectorBeforeSort; vectorAfterSort; cin>>n; while(n--) { cin>>x; BeforeSor

2017-01-14 16:28:01 343

原创 BUPT OJ 统计节点个数

#include#define MAXSIZE 1000using namespace std;class node{ public: int degree; int parent; int numOfSon; int son[1000]; node() { degree=0; parent=0; numOfSon=0; }};class

2017-01-14 16:10:14 343

原创 BUPT OJ 文件系统

孩子兄弟表示法的多叉树遍历 #include#includeusing namespace std;enum type{file,dir};class node{public: string name; type mytype; node*child; node*brother;//孩子兄弟表示法; };void CreateFile(node*pt,string f

2017-01-13 17:28:29 1127

数据结构与算法(java语言秒速)

数据结构与算法,用java写的,有需要的就下载看看吧

2015-10-25

visual c++可视化编程教程

很好的可视化编程材料 基础的必看 (特别适用于刚刚脱离dos窗口下编程的童鞋)

2014-07-11

关于c++的参考手册

新人发福利咯 本资料有详细的c++各种函数解析与用法

2014-05-26

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除