自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(12)
  • 收藏
  • 关注

原创 hdoj水题练习(七)

hdoj 1237表达式求值 by 两个栈起初Runtime Error(ACCESS_VIOLATION)    最后参考了这篇博客    特别要注意0满满的都是细节    也是很艰辛//hdoj 1237 表达式求值#include <stdio.h>#include <stack>#include <string.h>///strcmp#incl...

2018-04-22 00:20:40 220

原创 hdoj水题练习(六)

emmm,这个系列似乎没那么水了><DP系列,虽然个人觉得第一题没那么典型,不过确实也用到了自底向上的递推。hdoj 2062思路:递推求解每个分组中数的个数注意:1、long long 和 %lld(Runtime Error(ACCESS_VIOLATION) or WA...)          2、字典序          3、m要减去空集的情况//hdoj 2062#inc...

2018-04-20 20:44:26 185

原创 hdoj水题练习(五)

hdoj2031我的思路:(注意数值转字符或字符串)//hdoj 2031#include <string>#include <stdio.h>#include <iostream>#include <sstream>//字符串流对象using namespace std;int main(){ int n,r; bool minus...

2018-04-20 17:58:04 211

原创 某度笔试编程题

刚做出来,好气哦,不确定对不对,欢迎大家纠错~~题目大概是输入 n行m列,起始点sx,sy,求能到达的最大数字。只能往比自己大的方向走。#include <iostream>#include<vector>using namespace std;int n,m,sx,sy;void until_ismax(int i,int j,vector<vector...

2018-04-18 22:59:41 224

原创 hdoj水题练习(四)

//hdoj 2057十六进制输入输出:%x刚开始自己傻逼地用字符串来做转换TATlearn from others:        由于题目所说的16进制数长度小于15位,所以换算成2进制位的话小于64(16*4)位,需用长整形。        long  long  和_int64输出16进制数时,不能输出负数,若是负数必须转换一下。实测:负数输出的是补码-1 0fffffffffffffff...

2018-04-18 11:27:09 169

原创 hdoj水题练习(三)

字符串系列(包括上一篇的2072)//hdoj 2081#include<string>#include<iostream>using namespace std;int main(){ int n; cin>>n; for(int i=0;i<n;++i){ string l,s="6"; cin>>l; s+=l.substr(6,5...

2018-04-18 11:17:33 194

原创 中序遍历二叉树

//中序遍历1#include<stack>void inorder(TreeNode* root){//注意p的更新! if(!root) return; stack<TreeNode*> stk; stk.push(root); TreeNode* p; while(!stk.empty()){ while(p=stk.top(...

2018-04-13 20:39:14 197

原创 归并排序

//归并排序#include<vector>#include<iostream>using namespace std;void merge(vector<int> array,vector<int>&res,int m,int n, int t){ int i=m,j=n,k=m; for(;i<n&&j&...

2018-04-13 12:19:46 158

原创 堆排序

//堆排序#include<vector>#include<iostream>using namespace std;void heapAdjust(int s,int t,vector<int>& array){//s,t从1开始,用于数组下标时要-1 int head=array[s-1]; for(int j=2*s;j<=t;...

2018-04-13 10:28:31 135

原创 快速排序

这么基础的东西不应该生疏了!//快速排序#include<vector>#include<iostream>#include<stdio.h>using namespace std;int partion(int low,int high,vector<int>&array){ int pivot=array[low]; whi...

2018-04-13 09:07:19 134

原创 hdoj水题练习(二)

hdoj2072  惭愧,做了好久。但依然是水题嗯。//hdoj2072#include<string>#include<set>#include<iostream>#include <sstream>                                       //getlineusing namespace std;int mai...

2018-04-06 17:04:51 292

原创 hdoj水题练习(一)

刷了不少剑指offer和leetcode练习算法,都是只要写个函数,结果被要求格式的输入输出打败!哭!赶快练习!按这个顺序:https://blog.csdn.net/liuqiyao_01/article/details/8477645//hdoj1089 针对行数未知的输入#include <stdio.h>//要有.hint main(){    int a, b;    whi...

2018-04-06 15:00:05 996

空空如也

空空如也

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

TA关注的人

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