自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+

Cross

一半惊喜,一半遗憾。

  • 博客(327)
  • 收藏
  • 关注

原创 Test Deep Link

https://ro-1251001122.cos.ap-shanghai.myqcloud.com/index.htmlhttps://ro-1251001122.cos.ap-shanghai.myqcloud.com/index.html?arg1=1&arg2=2?arg1=1&arg2=2

2020-08-18 19:47:28 578

原创 Unity Android 8.0(API 级别 26)引入了自适应启动器图标

使用Android Studio制作icons参考博客:https://blog.csdn.net/CrazyApp/article/details/95078757https://blog.csdn.net/egostudio/article/details/81869020制作完成之后导入Unity参考博客:http://www.luyixian.cn/news_show_272127.aspx整体的流程拿到1024的icon图,打开Android Studio,选中res文件夹

2020-06-04 09:42:30 609

原创 c++链表(写个例子证明一些知识点,太久没写忘光了)

#include<iostream>#include<cstdio>#include<cstring>#include<algorithm>#include<string>#include<vector>#include <ctime>#include<queue>#include&l...

2020-02-21 02:05:20 239

原创 gitlab内网服务器部署(win10主机)

注:安装遇到的问题自行百度虚拟机:vmware workstation 12 pro 官网下载虚拟机序列号:5A02H-AU243-TZJ49-GTC7K-3C61N (自己去百度)centos7 官网下载(本人下载CentOS-7-x86_64-Everything-1804.iso) 安装的时候记得选带图形化界面的,忘了截图,叫GHOME_啥的来着下载gitl...

2018-08-01 17:50:40 6314 5

原创 shell 递归遍历文件夹 对文件行首和末尾进行修改

功能:    递归遍历文件夹下的cs文件或者lua文件,并对文件的行首或者末尾插入代码#!/bin/bashstr=""luafile=falsecsfile=falsedfs(){ #echo $1 for file in $1/* do if [ -d $file ] then dfs $file elif [ -f $file ] then #文件...

2018-07-10 13:35:28 401

原创 Codeforces Round #485 (Div. 2) D. Fair BFS

链接:戳这里D. Fairtime limit per test2 secondsmemory limit per test512 megabytesinputstandard inputoutputstandard outputSome company is going to hold a fair in Byteland. There are nn towns in Byteland and ...

2018-06-09 17:27:19 163

原创 C#中使用结构体+有参构造函数

具体看代码吧:using System;using System.Collections.Generic;using System.Linq;using System.Text;using System.Threading.Tasks;namespace MyFirstApp{ public struct node { public str

2016-12-09 21:30:14 11049 1

原创 linux c/c++ 读取指定目录下的文件名

#include #include /*struct dirent{ long d_ino; // inode number 索引节点号 off_t d_off; // offset to this dirent 在目录文件中的偏移 unsigned short d_reclen; // length of this d_name 文件名长 unsigned char

2016-11-26 20:17:42 5932

原创 C++实现快排函数

技巧:对于每一段区间[l,r],取一个key值为a[l],接下来要将这个key值放到一个位置上使得当前它的左边的数都比它小,右边的数都比它大。存在一个交换操作;具体看代码代码:#include #include using namespace std;template void Qsort(T *a,int left,int right){ int l = left,

2016-11-23 16:15:35 4176

原创 leetcode 113. Path Sum II 二叉树求符合和值为sum的链

技巧:链表二叉树的掌握,以及链表递归深层次的了解代码:/** * Definition for a binary tree node. * struct TreeNode { * int val; * TreeNode *left; * TreeNode *right; * TreeNode(int x) : val(x), left(N

2016-11-22 12:05:44 290

原创 leetcode 110. Balanced Binary Tree 判断是否是一颗平衡二叉树

技巧:链表的掌握,以及auto 对于c++11的使用技巧代码:/** * Definition for a binary tree node. * struct TreeNode { * int val; * TreeNode *left; * TreeNode *right; * TreeNode(int x) : val(x), le

2016-11-21 21:13:15 374

原创 HashMap简单实现询问long long范围内数据出现的个数

题意:给出n个long long范围内的数,以及q个询问,每次询问x 输出数x出现的次数思路:将每个数取模%MOD,用邻接表存储数据,当前节点存储的是一个key的值v,以及v出现的次数,和与它取mod相等的上一个数代码:

2016-11-17 20:17:45 674

原创 leetcode 96. Unique Binary Search Trees 增量技巧

题意:n个节点的二叉树,输出n个节点能组成多少二叉树的形态,unique思路:n=1 ans=1n=2 ans=2n=3 ans=5n=4 ans=?假设新加入的点放在根节点的位置,那么我们可以枚举:当左边的节点个数为0,右边节点个数为2的种类:ans[0]*ans[2]=2当左边的节点个数为1,右边节点个数为1的种类:ans[1]*ans[1]=1

2016-11-13 20:54:48 278

原创 C++ 拷贝构造函数中浅拷贝与深拷贝

浅拷贝构造函数 看一段拷贝构造函数的代码#include <iostream>#include <cstring>using namespace std;class Array{public : Array(){ cout<<"Array()"<<endl; } Array(const Array &arr){ /// 拷贝构造函数

2016-11-12 13:48:02 8062 1

原创 leetcode 24. Swap Nodes in Pairs 单向链表操作

Get:当前指针a指向的地址如果是空的话,a->next无法指向任何地址将单向链表的奇偶位置互换代码:/** * Definition for singly-linked list. * struct ListNode { * int val; * ListNode *next; * ListNode(int x) : val(x), next(N

2016-11-11 10:08:25 290

原创 leetcode 21. Merge Two Sorted Lists 两个单向链表合并 指针与解指针

代码:/** * Definition for singly-linked list. * struct ListNode { * int val; * ListNode *next; * ListNode(int x) : val(x), next(NULL) {} * }; */class Solution {public: ListNod

2016-11-10 22:23:16 369

原创 leetcode 19. Remove Nth Node From End of List 单向链表删除第n个数

代码:/** * Definition for singly-linked list. * struct ListNode { * int val; * ListNode *next; * ListNode(int x) : val(x), next(NULL) {} * }; */class Solution {public: ListNod

2016-11-10 21:23:19 261

原创 queue 简单底层实现

代码:#include using namespace std;template struct node{ T val; node *next; node(){ next=NULL; } node(T x){ val=x; next=NULL; }};template class Que

2016-11-04 21:37:09 1025

原创 stack 底层简单实现 链表实现

代码:#includeusing namespace std;template struct node{ T val; node *next; node(){ next=NULL; } node(T x){ val=x; next=NULL; }};template class Stack{private : n

2016-11-04 21:14:14 321

原创 stack 底层简单实现 动态数组

代码:#include #include using namespace std;template class Stack{private : T* data; /// 给指针分配一个内存空间 int sz; /// 动态数组的大小 int len; /// 栈的元素个数public : Stack(){ data=new T[1]

2016-10-31 16:56:52 649

原创 vector 简单底层实现

代码:#include #include #include using namespace std;template class Vector{private : T* data; /// 动态数组 指针指向一个内存空间 int len; /// 当前存在元素个数 int sz; /// 当前动态数组的大小public : Vector(){

2016-10-31 15:49:39 2207

原创 网易笔试题 分析

链接:戳这里题意:小易是一个数论爱好者,并且对于一个数的奇数约数十分感兴趣。一天小易遇到这样一个问题: 定义函数f(x)为x最大的奇数约数,x为正整数。 例如:f(44) = 11.现在给出一个N,需要求出 f(1) + f(2) + f(3).......f(N)例如: N = 7 f(1) + f(2) + f(3) + f(4) + f(5) + f(6) + f

2016-10-26 17:10:37 627

原创 leetcode 18. 4Sum 暴力枚举

链接:戳这里题意:给出长度为n的整数序列和目标target,定义一个四元组a[i]+a[j]+a[k]+a[l]==target 输出所有满足条件的四元组 ,两个四元组不同当且仅当至少一个元素不同思路:先升序排序,枚举当前a[i],然后再枚举a[j],接下来在区间[j+1,n-1]中找出两个a[l],a[r]使得a[i]+a[j]+a[l]+a[r]=tar因为是升

2016-10-26 14:15:09 321

原创 leetcode 15. 3Sum 暴力枚举

链接:戳这里题意:给出长度为n的整数序列,要求找出满足条件的所有不同三元组使得三个数和为0两个三元组不相同意义为:集合中至少有一个数不同思路:序列按升序排序,枚举a[k],接着在[0,k-1]选出两个数a[i],a[j] 相加使得和为-a[k],即为答案 复杂度O(n*n)由于序列是升序排序,所以a[i]+a[j]的值是会随着i,j的移动而显得有单调性当a[i]

2016-10-26 12:23:10 401

原创 leetcode 11. Container With Most Water 贪心

链接:戳这里题意:给出长度为n的正整数序列 h[i] ,表示一条竖直线段为 [i,0] [i,hi]现在从上往下浇水,问任意选两条线段使得装水的容量最大,输出装满水之后容器竖截面的面积思路:贪心思想,枚举l=0,r=n 对于当前最佳答案区间[l,r] 答案为: (r-l)*min(h[l],h[r])那么需要找出中间的区间是否存在一个更大的(r1-l1)*h[i

2016-10-25 21:39:46 366

原创 leetcode 3. Longest Substring Without Repeating Characters dp

链接:戳这里题意:给出一串字符串,输出最长的子序列长度满足(该子序列中不出现重复的元素)思路:dp[i] 表示在当前位置i的值为x,存在上一个x出现的位置为dp[i]那么维护一个左边界L,L每次更新是因为出现了x......x类似这样的情况,更新为L=max(L,第一个x出现的位置)因为你不管怎么取都不能在往第一个出现x的位置左边走了对于 x..x..y..y.

2016-10-24 21:32:05 226

原创 leetcode 2. Add Two Numbers 指针链表

题目链接:戳这里代码:/** * Definition for singly-linked list. * struct ListNode { * int val; * ListNode *next; * ListNode(int x) : val(x), next(NULL) {} * }; */class Solution {publi

2016-10-24 17:51:23 192

原创 Codeforces Round #376 (Div. 2) C 并查集

链接:戳这里C. Sockstime limit per test:2 secondsmemory limit per test:256 megabytesinput:standard inputoutput:standard outputArseniy is already grown-up and in

2016-10-17 20:24:05 624

原创 2016-2017 CT S03E05: Codeforces Trainings Season 3 Episode 5 J

链接:戳这里题意:二维平面上给出n(奇数)个点,要求找出能包围n/2+1个点的面积最小的矩形,该矩形平行于坐标轴思路:枚举矩形的width的边界,然后把框起来的点按y排序,枚举当前y,然后找到Y[I+m-1]的位置,统计最小面积代码:#include #include #include #include using namespace std

2016-10-16 13:18:00 779

原创 hdu 5928 极角排序+dp

链接:戳这里Birthday GiftTime Limit: 9000/4500 MS (Java/Others)    Memory Limit: 65536/65536 K (Java/Others)Problem DescriptionBoth Mr. Frog and Wallice love running. Wallice missed

2016-10-15 14:57:55 831

原创 hdu 5091 线段树+扫描线思想

链接:戳这里Beam CannonTime Limit: 3000/1500 MS (Java/Others)    Memory Limit: 65536/65536 K (Java/Others)Problem DescriptionRecently, the γ galaxies broke out Star Wars. Each planet i

2016-10-13 19:51:22 426

原创 Intel Code Challenge Elimination Round (Div.1 + Div.2, combined) C 并查集

链接:戳这里C. Destroying Arraytime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputYou are given an array consisting of n non-negative in

2016-10-07 21:57:22 373

原创 hdu 5927 DFS

链接:戳这里Auxiliary SetTime Limit: 9000/4500 MS (Java/Others)    Memory Limit: 65536/65536 K (Java/OtherProblem DescriptionGiven a rooted tree with n vertices, some of the vertices are

2016-10-06 17:49:54 726 2

原创 hdu 5908 模拟

链接:戳这里Abelian PeriodTime Limit: 2000/1000 MS (Java/Others)    Memory Limit: 262144/131072 K (Java/Others)Problem DescriptionLet S be a number string, and occ(S,x) means the times

2016-10-05 14:29:49 431

原创 hdu 5918 KMP

链接:戳这里Sequence ITime Limit: 3000/1500 MS (Java/Others)    Memory Limit: 65536/65536 K (Java/Others)Problem DescriptionMr. Frog has two sequences a1,a2,⋯,an and b1,b2,⋯,bm and a n

2016-10-04 17:37:48 1047 2

原创 Codeforces Round #375 (Div. 2) D bfs

链接:戳这里D. Lakes in Berlandtime limit per test:2 secondsmemory limit per test:256 megabytesinput:standard inputoutput:standard outputThe map of Berland

2016-10-04 16:58:29 262

原创 Codeforces Round #374 (Div. 2) D 贪心+优先队列

链接:戳这里D. Maxim and Arraytime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputRecently Maxim has found an array of n integers, neede

2016-10-01 16:11:38 527

原创 Codeforces Round #374 (Div. 2) C bfs+dp

链接:戳这里C. Journeytime limit per test3 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputRecently Irina arrived to one of the most famous cities of Ber

2016-10-01 15:19:20 413

原创 玲珑OJ 1045 - I. Quailty and LRU Algorithm 模拟双向链表

链接:戳这里1045 - I. Quailty and LRU AlgorithmTime Limit:2s Memory Limit:128MByteDESCRIPTIONQuailty is learning a type of page replacement algorithm for memory management in operation s

2016-09-25 20:52:31 446

原创 hdu 5904 水题

链接:戳这里LCISTime Limit: 4000/2000 MS (Java/Others)    Memory Limit: 65536/65536 K (Java/Others)Problem DescriptionAlex has two sequences a1,a2,...,an and b1,b2,...,bm. He w

2016-09-24 21:41:17 685

空空如也

空空如也

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

TA关注的人

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