自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

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

原创 常见的八种导致 APP 内存泄漏的问题

像 Java 这样具有垃圾回收功能的语言的好处之一,就是程序员无需手动管理内存分配。这减少了段错误(segmentation fault)导致的闪退,也减少了内存泄漏导致的堆空间膨胀,让编写的代码更加安全。然而,Java 中依然有可能发生内存泄漏。所以你的安卓 APP 依然有可能浪费了大量的内存,甚至由于内存耗尽(OOM)导致闪退。传统的内存泄漏是由忘记释放分配的内存导致的,而逻辑上的内存泄漏则是由

2017-06-03 17:53:50 906

原创 Android避免内存溢出(Out of Memory)方法总结

避免内存溢出的方法,主要是对以下三个方面对程序进行优化内存引用在处理内存引用之前,我们先来复习下什么是强引用、软引用、弱引用、虚引用强引用:强引用是使用最普遍的引用。如果一个对象具有强引用,那垃圾回收器绝不会回收它。 当内存空间不足,Java虚拟机宁愿抛出OutOfMemoryError错误,使程序异常终止,也不会靠随意回收具有强引用的对象来解决内存不足的问题。

2017-06-03 17:36:03 378

原创 Android O预览版的新功能

谷歌一年一度的开发者大会I/O 2017于5月17日发布,这次的开发者大会,谷歌发布了最近的安卓8.0Android O预览版,这篇文章和大家分享一下Android O带来的新功能▲Google重新设计了Android的emoji表情看起来更加卡通,并且更容易传达每个人的‘意图’▲画中画:Android O您可以继续用Dou视频通话,或者在Chrome用Pi

2017-06-03 10:24:21 587

原创 安卓刷机常识和教程

我的安卓手机经常刷机,觉得这是我选择安卓手机的一大原因,刷机还是蛮有趣的。刷机有一些好处,例如因为现在的大部分厂商都会在手机里预装软件,刷一些第三方的rom可以删去这些不用的预装软件,可以体验很多不同手机的系统,找最流畅省电的rom来用,提高手机体验,还有安卓系统是谷歌发布的,但是国内的手机都会删去谷歌服务,刷一些第三方针对原生安卓修改的rom,挂上vpn,我们也可以体验谷歌服务。这篇文章

2017-06-03 10:01:38 3404

原创 UVA 138 Street Numbers

DescriptionA computer programmer lives in a street with houses numbered consecutively (from 1) down one side of the street. Every evening she walks her dog by leaving her house and randomly turnin

2016-07-16 15:11:00 323

原创 CodeForces 569A Music

DescriptionLittle Lesha loves listening to music via his smartphone. But the smartphone doesn't have much memory, so Lesha listens to his favorite songs in a well-known social network InTalk.Unf

2016-07-15 16:04:54 428

原创 CodeForces 567B Berland National Library

DescriptionBerland National Library has recently been built in the capital of Berland. In addition, in the library you can take any of the collected works of Berland leaders, the library has are

2016-07-15 11:02:31 250

转载 Ubuntu 火狐浏览器鼠标选中文字被删除的解决办法

不知道自己做了什么 Ubuntu 火狐浏览器鼠标选中文字被删除烦的要死解决办法在终端中输入命令: ibus-setup将  “在应用程序窗口中启用内嵌编辑模式“ 选项取消

2016-07-15 09:41:26 560

原创 CodeForces 567A Lineland Mail

DescriptionAll cities of Lineland are located on the Ox coordinate axis. Thus, each city is associated with its positionxi — a coordinate on theOx axis. No two cities are located at a single p

2016-07-15 09:38:30 416

原创 uva10763

给你几对数字表示A ->B如果有A->B没有B->A输出NO如果所有都满足输出YES水水的过#include #include #define N 1010int map[N][N];int main(){ int n; while (scanf("%d", &n) && n) { memset(map, 0, sizeof(map));

2015-12-27 21:33:18 313

原创 uva757

John is going on a fishing trip. He has h hours available ( ), and there aren lakes in the area ( ) all reachable along a single, one-way road. John starts at lake 1, but he can finish at any lake

2015-12-27 20:44:53 259

原创 uva 10714

给你几只蚂蚁的位置求所有蚂蚁掉下去的最短时间和最长时间蚂蚁相遇之后会转向等价于他们向前走只是编号换一下先排个序最短时间就是蚂蚁不相遇直接朝着两端走取决于中间的的那只蚂蚁最长时间就是相遇取决于离某一端距离最长的蚂蚁#include #include #include #define N 1000010using namesp

2015-12-27 13:43:45 296

原创 uva10905

给你几个数字找出满足a + b + c = d且 d 最大没看到最大  WA了好几发看到能用暴力过去就试了一下先拍序三层for最大的值用二分来找也可以从d 开始找即num[n- 1], num[n -2]...来找符合的 a b c这样子只用找一次就可以了 #include #include #i

2015-12-26 21:09:57 217

原创 uva10391

给你一些单词找出其中一些单词这些单词可以由另外两个单词合成map水水的就过了改天来手写哈希补上事实是STL这么好用根本不想手写哈希#include #include #include #include #include using namespace std;map hash;string s[150000];int main(){ in

2015-12-26 19:16:26 289

原创 uva10905

给你几个数字让你调整他们的摆放顺序使得得出数最大看了题解用sort水水的就过了sort确实是要比qsort好用不少还可以这样用,真是大开眼界#include #include #include using namespace std;int cmp(string a, string b){ return a + b > b + a;}string

2015-12-26 19:14:12 284

原创 uva11100

题目大意给你一些包大的包可以覆盖小的求最外层至少要几个包并输出每层包里面的情况做法:排序之后找出重复最多的包这就是有几层因为大包会覆盖小包要把重复的包分开#include #include #define N 10010using namespace std;int num[N];int mai

2015-12-25 21:33:09 275

原创 uva 11572

题目大意给你一串数字求其中没有重复数字的最长字串因为数据量大用map先用一个数组保存数据一层for判断num[i]之前有没有出现过用map[num[i]]非常方便如果没出现过就在map中保存下来如果出现过就要从出现的那个数之后开始重新找串有没有出现都要判断当前串的长度是不是min#include #inclu

2015-12-23 19:01:53 286

转载 STL map用法

说明:如果你具备一定的C++ template知识,即使你没有接触过STL,这个文章你也应该可能较轻易的看懂。本人水平有限,不当之处,望大家辅正。 一.Map概述 Map是STL的一个关联容器,它提供一对一(其中第一个可以称为关键字,每个关键字只能在map中出现一次,第二个可能称为该关键字的值)的数据处理能力,由于这个特性,它完成有可能在我们处理一对一数据的时候,在编程上提供快速通道。这里

2015-12-23 16:31:14 201

原创 uva 10282

题目大意是给你一本字典前面是英文 ,后面是外国语言空一行之后给你一些外国单词让你对应字典去找题目还是很好理解的这道题看到了STL的map的好用之处#include #include #include #include using namespace std;map m;int main(){ char ch[30]; char a[

2015-12-23 16:12:17 235

原创 uva188 暴力

A - Perfect HashTime Limit:3000MS    Memory Limit:0KB    64bit IO Format:%lld & %lluSubmitStatusPracticeUVA 188Appoint description:DescriptionPerfect Software, Inc. has obtaine

2015-12-23 15:50:21 318

原创 uva1121 方法一删去前端 方法二 二分

题目大意给你一串数字和一个上限求这串数字中>=上限的最短子序列intput10 155 1 3 5 10 7 4 9 2 85 111 2 3 4 5output23这道题有一个坑点就是如果找不到输出0第一种方法把每一段的权值求出来先找到从第几个点开始之后的点都能大于上限接着从这一段中依次删去前面的段

2015-12-22 09:55:53 282

原创 uva 103

B - Stacking BoxesTime Limit:3000MS    Memory Limit:0KB    64bit IO Format:%lld & %lluSubmitStatusPracticeUVA 103Appoint description:DescriptionBackgroundSome concepts in M

2015-12-17 20:36:32 219

原创 uva1152

题目给四个数组ABCD, Ai + Bj + Cx + Dy = 0count++四层循环的爆掉分别枚举A B 和C D在二分搜索判断#include #include #define N 5010#define Max 17000010int num1[Max], num2[Max], a[N][4];int cmp(const void *a, cons

2015-12-13 21:33:23 252

原创 uva111(dp)

A - History GradingTime Limit:3000MS    Memory Limit:0KB    64bit IO Format:%lld & %lluSubmitStatusPracticeUVA 111Appoint description:DescriptionBackgroundMany problems in Co

2015-12-07 19:31:35 263

原创 省赛模拟a

进制转换k = A / Bd = A % B#include #include #include int c;char a[35], b[35];int jinzhi(char c){ if (c == 'a') return 10; if (c == 'b') return 11; if (c == 'c') return 12; if (c

2015-11-22 19:07:20 223

原创 uva11205 The broken pedometer

计时器坏了判断至少几列数字可以判断出这几个数字子集位向量法#include #include int mat[105][20], b[20];int min, p, n;void subset(int cur){ if (cur == p) { for (int i = 0; i < n - 1; i++) for (int j = i + 1; j < n;

2015-11-18 15:43:53 359

原创 uva10167Birthday Cake

题目复制过来格式有错就不复制了给一块蛋糕一堆樱桃求一条直线能够平分所有的樱桃即有一半的樱桃在线的上方,一半在下方樱桃不能在线上0ut0 1

2015-11-09 15:03:00 300

原创 uva532Dungeon Master

DescriptionYou are trapped in a 3D dungeon and need to find the quickest way out! The dungeon is composed of unit cubes which may or may not be filled with rock. It takes one minute to move one un

2015-10-31 19:03:39 262

原创 uva705 Slash Maze

DescriptionBy filling a rectangle with slashes (/) and backslashes ( ), you can generate nice little mazes. Here is an example: As you can see, paths in the maze cannot branch, so the whole

2015-10-29 18:10:46 276

原创 mentohust 使用

因为晚上想在宿舍敲题,所以安装了mentohust用在ubuntu  替代锐捷连接校园网需要mentohust的安装包一份配置文件以下就是配置文件把我空的usename(学号)ip 网关  dns等等根据办校园网是给的数据补充完整# MentoHUST for Linux By HustMoon Studio## 配置文件名称必须是小写/

2015-10-29 17:10:31 1808

原创 uva 784

首先找到墨水把它变为#先判断它的上下左右是否为空如果是dfs一开始想当然的认为碰到X就返回是错的只要它周围的四个点为空都可以dfs下去#include #include char map[50][100];void dfs(int x, int y){ map[x][y] = '#'; if (map[x - 1][y] == '

2015-10-28 21:32:08 284

原创 uva657 The die is cast

B - The die is castTime Limit:3000MS    Memory Limit:0KB    64bit IO Format:%lld & %lluSubmitStatusDescriptionInterGames is a high-tech startup company that specializes in developing tec

2015-10-28 19:41:16 261

原创 uva572 Oil Deposits

A - Oil DepositsTime Limit:3000MS    Memory Limit:0KB    64bit IO Format:%lld & %lluSubmitStatusDescriptionThe GeoSurvComp geologic survey company is responsible for detecting undergroun

2015-10-27 21:36:40 268

原创 uva327

F - Evaluating Simple C ExpressionsTime Limit:3000MS    Memory Limit:0KB    64bit IO Format:%lld & %lluSubmitStatusPracticeUVA 327DescriptionThe task in this problem is to evaluate a s

2015-10-26 21:51:44 333

转载 uva112 Tree Summing

DescriptionBackground LISP was one of the earliest high-level programming languages and, with FORTRAN, is one of the oldest languages currently being used. Lists, which are the fundamental data struct

2015-10-24 18:43:15 329

原创 uva548 -treeDescription Download as PDF You are to determine the value of the leaf node in a given

DescriptionYou are to determine the value of the leaf node in a given binary tree that is the terminal node of a path of least value from the root of the binary tree to any leaf. The value of a pa

2015-10-24 18:30:38 664

原创 uva10106 高精度

高精度的乘法两个数相乘结果用另一个数组来存放re两次想了很久才发现最后没考虑0#include #include char a[255], b[255];int x[255], y[255], sum[550];void re(int len1, int len2){ for (int i = 0, j = len1 - 1; i < len1; i++, j--

2015-09-11 21:37:47 270

原创 uva424高精度

Integer Inquiry One of the first users of BIT's new supercomputer was Chip Diller. Heextended his explorationof powers of 3 to go from 0 to 333 and he explored taking various sumsof those numbers.``Th

2015-09-11 21:33:46 375

原创 uva644-字符串

Immediate Decodability An encoding of a set of symbols is said to be immediately decodable if no code for one symbol is the prefix of a code for another symbol. We will assume for this pro

2015-09-01 19:09:47 252

原创 uva644-字符串

Immediate Decodability An encoding of a set of symbols is said to be immediately decodable if no code for one symbol is the prefix of a code for another symbol. We will assume for this pro

2015-09-01 19:06:44 273

空空如也

空空如也

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

TA关注的人

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