Android空指针异常小结——微型技术报告1 在开发新闻客户端的过程中,经常会出现空指针的问题。空指针异常通常是不出现则以一出现就有惊人的破坏力。因为自己水平有限,想着以后的开发过程中也会有遗漏的地方,所以特来总结一下经常出现的问题。下面举例说明:(并解释何为空指针异常)1.所谓的指针,就是java中的对象的引用。比如String s;这个s就是指针。2.所谓的空指针,就是指针的内容为null,比如上面的s,如果令它指向null,...
字典树基础模板 1.查询一个单词是否出现/* trie tree的储存方式:将字母储存在边上,边的节点连接与它相连的字母 trie[rt][x]=tot:rt是上个节点编号,x是字母,tot是下个节点编号 */ #include<cstdio>#include<iostream>#include<algorithm>#include<cstring&g...
2018武大校赛.D. Who killed Cock Robin(树形dfs) 链接:https://www.nowcoder.com/acm/contest/104/C来源:牛客网题目描述 由于系统限制,C题无法在此评测,此题为现场赛的D题 Who killed Cock Robin? I, said the Sparrow, With my bow and arrow,I killed Cock Robin. Who saw ...
UVALive 7261 Xiongnu's Land 题目大意:给一个矩形区域的右上角的坐标(R,R)的值R,这个矩形区域的左下角的坐标为(0,0),再在这个矩形区域里面给出n个小矩形,现在求一条垂直于x轴的分割线使得线左右两边的小矩形面积在满足,左>右的情况下尽可能的接近;思路:统计一下每个点左右两边的值,暴力来解决,遍历一遍就ok了#include<cstdio> #include<cstring> #inc...
启发式算法 https://shaoweicai.wordpress.com/2010/09/23/%E5%90%AF%E5%8F%91%E5%BC%8F%E7%AE%97%E6%B3%95%EF%BC%88heuristic-algorithm%EF%BC%89/启发式算法(Heuristic Algorithm)有不同的定义:一种定义为,一个基于直观或经验的构造的算
Codeforces 961C Chessboard Magnus decided to play a classic chess game. Though what he saw in his locker shocked him! His favourite chessboard got broken into 4 pieces, each of size n by n, n is always odd. And what's even wo
Codeforces-462C. A Twisty Movement(前缀和/dp) C. A Twisty Movementtime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputA dragon symbolizes wisdom, power and wealth. On Lunar New Year's Day, people m...
Codeforces 931.C Laboratory Work C. Laboratory Worktime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputAnya and Kirill are doing a physics laboratory work. In one of the tasks they hav...
Codeforces Round #468 B. World Cup B. World CupThe last stage of Football World Cup is played using the play-off system.There are n teams left in this stage, they are enumerated from 1 to n. Several rounds are held, in each round the r...
cf 461 div2.C. A Twisty Movement C. A Twisty Movementtime limit per test 1 secondmemory limit per test 256 megabytesA dragon symbolizes wisdom, power and wealth. On Lunar New Year's Day,people model a dragon with bamboo strips ...
POJ3321-Apple Tree(dfs序+线段树) poj3321 原题链接:http://poj.org/problem?id=3321Apple TreeTime Limit: 2000MS Memory Limit: 65536KTotal Submissions: 30871 Accepted: 9243DescriptionThere is an apple tree outside of kaka's house. Every autu...
cf #div2.461-C.Cave Painting C. Cave Paintingtime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputImp is watching a documentary about cave painting.Some numbers, carved in chaotic o...
CFR 461 DIV2-D. Robot Vacuum Cleaner D. Robot Vacuum Cleanertime limit per test 1 second memory limit per test 256 megabytesProblem DescriptionPushok the dog has been chasing Imp for a few hours already. Fortunately, Imp knows that Push...
POJ2528-Mayor's posters(线段树+离散化) 原题地址:点击打开链接Mayor's postersTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 70678 Accepted: 20384DescriptionThe citizens of Bytetown, AB, could no
icpc-beijing-cats and fish 原题:时间限制:1000ms单点时限:1000ms内存限制:256MB描述There are many homeless cats in PKU campus. They are all happy because the students in the cat club of PKU take good care of them. Li lei
2017icpc-beijing-j(pangu and stone) 同学去的比赛,j题是个dp就补了一下原题:点击打开链接#1636 : Pangu and Stones时间限制:1000ms单点时限:1000ms内存限制:256MB描述In Chinese mythology, Pangu is the first living being and the creator of th
POJ1328-Radar Installation(贪心) POJ1328Radar InstallationTime Limit: 1000MS Memory Limit: 10000KTotal Submissions: 93037 Accepted: 20765DescriptionAssume the coasting is an infinite stra
POJ3107-God father(树形dp??) 原题链接:http://poj.org/problem?id=3107GodfatherTime Limit: 2000MS Memory Limit: 65536KTotal Submissions: 6121 Accepted: 2164DescriptionLast
HDU2196-Computer(树形dp) 原题传送门ComputerTime Limit: 1000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 31201 Accepted Submission(s): 3989Problem DescriptionA school bo
HDU1520-Anniversary party(树形dp) Problem DescriptionThere is going to be a party to celebrate the 80-th Anniversary of the Ural State University. The University has a hierarchical structure of employees. It means that the supervi