- 博客(389)
- 资源 (6)
- 收藏
- 关注
原创 HDU 1429 胜利大逃亡(续)
胜利大逃亡(续)Time Limit: 4000/2000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 9153 Accepted Submission(s): 3303Problem DescriptionIgnatius再次被魔王抓走了(
2017-08-06 17:29:44
540
原创 Educational Codeforces Round 26总结
A. Text Volumetime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputYou are given a text of single-space separate
2017-08-04 02:23:52
875
原创 方块消除游戏(完美世界2017秋招真题)
方块消除游戏(完美世界2017秋招真题) 题目描述 如下图,有10*10个不同颜色的方块,每个方块可能是红、绿、蓝、黄、紫5种颜色之一。当点击其中某一个方块时,如果它有相邻的同颜色方块,则将所有与此方块连续同颜色相邻的方块消除;剩下的方块中,如果下方有空位则向下移动,如果左侧整列都为空位则向左移动。 输入
2017-07-27 20:47:07
1637
原创 App运行时发生OOM的原因你知道几种?应该如何避免?
App运行时发生OOM的原因你知道几种?应该如何避免?1.资源对象用完没有关闭,造成内存泄漏。避免:对于资源性对象,在try catch finally中将资源对象放在finally中进行回收处理,可以有效避免OOM。资源性对象例如: 1-1:Cursor(使用Curosr.close()) 1-2: 没有关闭InputStream/OutputStrea
2017-07-26 16:31:52
3023
原创 各种常见排序算法(复习)
1.插入排序import java.util.Scanner;/** * * 作者:张宇翔 * 创建日期:2017年7月19日 下午12:57:18 * 描述:插入排序 * 时间复杂度: * 平均情况:O(n^2) * 最坏情况:O(n^2) * 最好情况:O(n) * 空间复杂度:O(1) * 稳定性:稳定 * 复杂性:简单
2017-07-19 13:03:51
628
原创 Educational Codeforces Round 25总结
A. Binary Protocoltime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputPolycarp has just invented a new binary p
2017-07-17 09:15:28
916
原创 Codeforces Round #421 (Div. 2)总结
A. Mister B and Book Readingtime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputMister B once received a gift:
2017-06-28 09:09:37
490
原创 Codeforces Round #420 (Div. 2)总结
A. Okabe and Future Gadget Laboratorytime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputOkabe needs to renova
2017-06-26 11:14:41
410
原创 Educational Codeforces Round 23总结
A. Treasure Hunttime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputCaptain Bill the Hummingbird and his crew r
2017-06-16 11:31:37
599
原创 Educational Codeforces Round 22
A. The Contesttime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputPasha is participating in a contest on one w
2017-06-06 14:49:44
625
原创 Codeforces Round #417 (Div. 2)总结
A. Sagheer and Crossroadstime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputSagheer is walking in the street w
2017-06-02 10:57:29
395
原创 笔试编程经典(leetcode在线编程)
题目描述Given a binary tree, find its minimum depth.The minimum depth is the number of nodes along the shortest path from the root node down to the nearest leaf node.代码:/** * Definition for b
2017-05-31 22:48:49
1426
原创 Educational Codeforces Round 21总结
A. Lucky Yeartime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputApart from having lots of holidays throughout
2017-05-23 22:34:32
488
原创 面试题目汇总(JAVA算法/数据结构)
1.题目:输入一个正整数数组,把数组里所有数字拼接起来排成一个数,打印能拼接出的所有数字中最小的一个。例如输入数组{3,32,321},则打印出这三个数字能排成的最小数字为321323。代码:import java.util.ArrayList;import java.util.Collections;import java.util.Comparator;import java.u
2017-05-18 14:06:01
25385
4
原创 Codeforces Round #411 (Div. 2)总结
A. Fake NPtime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputTavak and Seyyed are good friends. Seyyed is very
2017-05-05 09:34:07
367
原创 Educational Codeforces Round 20总结
A. Maximal Binary Matrixtime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputYou are given matrix with n rows an
2017-05-02 11:31:41
656
原创 Tinkoff Challenge - Elimination Round总结
A. Oleg and sharestime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputOleg the bank client checks share prices
2017-04-25 16:17:04
699
原创 Codeforces Round #368 (Div. 2) 总结
A. Brain's Photostime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputSmall, but very brave, mouse Brain was no
2016-08-21 14:17:20
435
原创 POJ 1950
DessertTime Limit: 1000MS Memory Limit: 30000KTotal Submissions: 5473 Accepted: 2048DescriptionFJ has a new rule about the cows lining up for dinner. Not only m
2016-07-02 08:26:22
512
原创 POJ 3126 Prime Path
Prime PathTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 16065 Accepted: 9068DescriptionThe ministers of the cabinet were quite upset by the message fr
2016-05-20 15:00:30
418
原创 UVA 10036 Divisibility
题意:给你N个数,在N个数中加入加号或减号,判断能否组成整除K的组合。解:刚开始想到了暴搜,但是一看数据太大,只有想其他办法。原来是dp,我们可以这样理解,dp[i][j]表示被第i个数除时,余数为j.让后它为真时,dp[i+1][(j+a[i]+k)%k]=1; dp[i+1][(j-a[i]+k)%k]=1;这两个也是真。最后,判断一下dp[n][0]是否为真就可以了
2016-05-18 22:48:33
628
原创 uva 10003 Cutting Sticks(区间DP)
题意:给出一个长l的木棍, 再给出n个要求切割的点,每次切割的代价是当前木棍的长度, 现在要求输出最小代价。/*给定一段len长的木棍,有n个切割点,每个切割点切掉的花费是当前切割点所在木棍的长度,求最少的花费。*/#include#include#include#include#include#include#includeusing namespace std;const
2016-05-18 22:11:38
320
原创 ZOJ 2027 Travelling Fee(最短路)
Travelling FeeTime Limit: 2 Seconds Memory Limit: 65536 KBSamball is going to travel in the coming vacation. Now it's time to make a plan. After choosing the destination city, the next st
2016-05-18 09:55:51
447
原创 POJ 3259 Wormholes(最短路)
Language:DefaultWormholesTime Limit: 2000MS Memory Limit: 65536KTotal Submissions: 41408 Accepted: 15221DescriptionWhile exploring his many farms, Farmer Jo
2016-05-18 08:48:47
344
原创 JAVA 多线程下载文件
package MutilDownLoad;import java.io.File;import java.io.InputStream;import java.io.RandomAccessFile;import java.net.HttpURLConnection;import java.net.URL;public class Main { protected static
2016-05-16 13:40:11
382
原创 2016"百度之星" - 资格赛(Astar Round1)
Problem A Accepts: 599 Submissions: 5110 Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others)Problem Description度熊手上有一本字典存储了大量的单词,有一次,他把所
2016-05-14 15:29:54
3242
原创 Android 在网上查看图片(最简单的版本)
今天学了在网上看图片的基础,mark一下吧。布局文件很简单,就是一个Button和一个ImageView<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_w
2016-05-11 22:48:28
496
原创 计蒜客 —— 乘法游戏
乘法游戏是在一行牌上进行的。每一张牌包括了一个正整数。在每一个移动中,玩家拿出一张牌,得分是用它的数字乘以它左边和右边的数,所以不允许拿第1张和最后1张牌。最后一次移动后,这里只剩下两张牌。 你的目标是使得分的和最小。例如,如果数是10 1 50 20 5,依次拿1、20、50,总分是10*1*50+50*20*5+10*50*5=8000而拿50、20、1,总分是
2016-05-11 14:39:30
840
原创 Android实现ListView显示信息,点击每个item,跳转到相应界面
界面如下:(做这个目的仅仅是为了学习一点小知识,因为自己才刚开始)实现的方法比较简单,就是定义一个ListView,然后设置监听,ListView对每个条目的监听是setOnItemClickListener。onItemClick(AdapterView parent, View view, int position, long id)这段代码中,
2016-05-11 08:46:34
75187
19
原创 Android 点击一个按钮,弹出一个对话框
界面非常的简单,就是一个Button,点击这个Button呢,会弹出一个对话框<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_par
2016-05-09 21:34:32
39850
2
原创 Android使用ListView将数据显示到手机屏幕上
下面是一个LinearLayout,里面的内容超级简单,就是一个ListView<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_pa
2016-05-08 20:56:06
2540
2
原创 Android实现查询数据库,把数据库内容显示到屏幕
首先,是布局文件,非常的简单,一个可以滑动的ScrollView包裹一个线性布局,线性布局里面无内容<ScrollView xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="
2016-05-08 18:23:25
40672
11
原创 Codeforces Round #350 (Div. 2)
A. Holidaystime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputOn the planet Mars a year lasts exactly n days (
2016-05-07 18:33:18
702
原创 Android 中handler的理解
andriod提供了Handler 和 Looper 来满足线程间的通信。Handler先进先出原则。Looper类用来管理特定线程内对象之间的消息交换(MessageExchange)。1)Looper: 一个线程可以产生一个Looper对象,由它来管理此线程里的MessageQueue(消息队列)。 2)Handler: 你可以构造Handler对象来与Looper沟通,以便pus
2016-05-06 21:28:43
1254
1
原创 HDU 1546 Idiomatic Phrases Game(最短路径)DIJ算法
Idiomatic Phrases GameTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 3144 Accepted Submission(s): 1019Problem DescriptionTom
2016-05-04 22:56:31
499
原创 BestCoder Round #82 (div.2)
ztr loves math Accepts: 315 Submissions: 1975 Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others)问题描述ztr喜欢研究数学,一天,他在思考直角三角形方程组的Lower版,即n=x^{2}
2016-05-02 19:35:51
365
原创 线段树区间修改
#1078 : 线段树的区间修改时间限制:10000ms单点时限:1000ms内存限制:256MB描述对于小Ho表现出的对线段树的理解,小Hi表示挺满意的,但是满意就够了么?于是小Hi将问题改了改,又出给了小Ho:假设货架上从左到右摆放了N种商品,并且依次标号为1到N,其中标号为i的商品的价格为Pi。小Hi的每次操作分为两种可能,第一
2016-04-27 16:53:26
518
原创 BestCoder Round #77 (div.2) 总结
so easy Accepts: 512 Submissions: 1601 Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others)问题描述已知一个包含 nn 个元素的正整数集合 SS,设 f(S)f(S) 为集合 SS 中所有元素的
2016-03-26 21:59:02
343
原创 人靠自己
在这个日益复杂的现实生活中,你靠谁?当然,有些人会说靠朋友,靠亲人,我就想问声,他们真的靠的住吗?你的那么多朋友里有几个靠的住的?你的亲人里又有几个愿意出全力来帮你的?或许你会问那还靠谁,其实,唯一靠的住的只有自己。 如果说,你认为自己都靠不住,那你的朋友亲人就更靠不住了。现在的社会很现实,你如果想在这个社会生存下去,没人可以帮你太多,只有自己努力更
2016-03-17 07:11:05
647
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人