码迷,mamicode.com
首页 >  
搜索关键字:integer game    ( 20395个结果
[leetcode]_Roman to Integer
题目:给定一个罗马数字串,转换为一个整数。一开始没理解,以为是string to int。后来理解:罗马数字与阿拉伯数字的映射关系,见下图:至此,题目的意思才掌握明白,用程序模拟这张表。无可置否,需要将这张表的映射关系存进一个map中,对输入的string查找map中的映射关系。先贴上代码:(注:s...
分类:其他好文   时间:2014-05-19 21:15:15    阅读次数:295
Integer做WeakHashMap的Key应注意的问题
WeakHashMap使用弱引用来作为Map的Key,利用虚拟机的垃圾回收机制能自动释放Map中没有被使用的条目。但是WeakHashMap释放条目是有条件的:首先条目的Key在系统中没有强引用指向;另外,条目的释放是在垃圾回收之后第一次访问这个WeakHashMap时完成的。 而当我们想...
分类:其他好文   时间:2014-05-19 21:13:21    阅读次数:314
【LeetCode】Jump Game II
Given an array of non-negative integers, you are initially positioned at the first index of the array.Each element in the array represents your maximu...
分类:其他好文   时间:2014-05-19 08:07:26    阅读次数:288
POJ1753(Flip Game)
题目大意:给你一个4*4的矩阵,矩阵里面储存着棋子,棋子有黑色,和白色,你可以任意改变位置(i,j)的棋子,但是规则是这个位置的上下左右的棋子颜色都必须改变。求最少需要改变几颗棋子,使得棋盘的棋子都为白的或都为黑色。解题思路: 枚举+DFS。因为棋盘就16位所以,最多改变16个棋子。枚举每一种至少改...
分类:其他好文   时间:2014-05-18 20:17:09    阅读次数:309
第一次瓶颈
昨天,想了一整个下午。我想要的究竟是什么?怎么开始。起源是,我前天为了aap解决了2个问题。但是,我在想。这些都是很简单的问题,只要知道google maps的api就可以了。我再想,难道这些就是我想要的吗?如果不是,那我想要的究竟是什么?我想要做有个web game?不,我不是很喜欢游戏。我想要做...
分类:其他好文   时间:2014-05-18 19:15:14    阅读次数:221
ACdream1008:A Very Easy Triangle Counting Game
Problem Description Speedcell and Shoutmon love triangles very much.One day,they are playing a game named “Triangle Counting”. In this game,Speedcell draws a round,and draws N points on the circum...
分类:其他好文   时间:2014-05-18 14:19:00    阅读次数:262
LeetCode:Evaluate Reverse Polish Notation
题意:            Evaluate the value of an arithmetic expression in Reverse Polish Notation.        Valid operators are +, -, *, /. Each operand may be an integer or another expression.        So...
分类:其他好文   时间:2014-05-18 08:09:15    阅读次数:190
oracle 数组 array
一维数组示例如下:--Createdon2014-5-15byADMINISTRATOR DECLARE TYPEArr1ISVARRAY(10)OFNUMBER; Tab_1Arr1; TYPEArr2ISTABLEOFNUMBERINDEXBYBINARY_INTEGER; Tab_2Arr2; BEGIN --Teststatementshere Tab_1:=Arr1(1,3,4,6,3,2,8,5); FORaIN1..Tab_1.CountLOOP Dbms_Output.Put..
分类:数据库   时间:2014-05-16 02:28:48    阅读次数:371
LeetCode 012 Integer to Roman
【题目】 Given an integer, convert it to a roman numeral. Input is guaranteed to be within the range from 1 to 3999. 【题意】 给定一个整数,将其表示成罗马数字 【思路】 罗马数字中只使用如下七个基值字母:M,D,C,L,X,V,I,分别用来表示1000、500、100、50、10、5、1。 罗马数组数规则: 基本数字Ⅰ、X 、C 中的任何一个,自身连用构成数目,或者放在大数的右边连用...
分类:其他好文   时间:2014-05-16 01:46:55    阅读次数:312
[求PN点] poj 2505 A multiplication game
题目链接: http://poj.org/problem?id=2505 A multiplication game Time Limit: 1000MS   Memory Limit: 65536K Total Submissions: 5098   Accepted: 2573 Description St...
分类:其他好文   时间:2014-05-15 23:33:22    阅读次数:378
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!