随笔分类 - 数据结构与算法----栈
stack STL
    
摘要:Problem Description 某省自从实行了很多年的畅通工程计划后,终于修建了很多路。不过路多了也不好,每次要从一个城镇到另一个城镇时,都有许多种道路方案可以选择,而某些方案要比另一些方案行走的距离要短很多。这让行人很困扰。现在,已知起点和终点,请你计算出要从起点到终点,最短需要行走多少距
        阅读全文
                
摘要:迷宫问题 Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 41913 Accepted: 23240 Description 定义一个二维数组: int maze[5][5] = { 0, 1, 0, 0, 0, 0, 1, 0,
        阅读全文
                
摘要:Given a string S of '(' and ')' parentheses, we add the minimum number of parentheses ( '(' or ')', and in any positions ) so that the resulting paren
        阅读全文
                
摘要:Given two sequences pushed and popped with distinct values, return true if and only if this could have been the result of a sequence of push and pop o
        阅读全文
                
摘要:Given a balanced parentheses string S, compute the score of the string based on the following rule: () has score 1 AB has score A + B, where A and B a
        阅读全文
                
摘要:You are given two arrays (without duplicates) nums1 and nums2 where nums1’s elements are subset of nums2. Find all the next greater numbers for nums1'
        阅读全文
                
摘要:You're now a baseball game point recorder. Given a list of strings, each string can be one of the 4 following types: Each round's operation is permane
        阅读全文
                
摘要:题目描述 假设一个表达式有英文字母(小写)、运算符(+,—,*,/)和左右小(圆)括号构成,以“@”作为表达式的结束符。请编写一个程序检查表达式中的左右圆括号是否匹配,若匹配,则返回“YES”;否则返回“NO”。表达式长度小于255,左圆括号少于20个。 输入输出格式 输入格式: 一行:表达式 输出
        阅读全文
                
摘要:题目描述 请你编一程序实现两种不同进制之间的数据转换。 输入输出格式 输入格式: 共三行,第一行是一个正整数,表示需要转换的数的进制n(2≤n≤16),第二行是一个n进制数,若n>10n>10则用大写字母A−F表示数码10−15,并且该nn进制数对应的十进制的值不超过1000000000,第三行也是
        阅读全文
                
摘要:题目描述 小鱼最近被要求参加一个数字游戏,要求它把看到的一串数字(长度不一定,以0结束,最多不超过100个,数字不超过2^32-1),记住了然后反着念出来(表示结束的数字0就不要念出来了)。这对小鱼的那点记忆力来说实在是太难了,你也不想想小鱼的整个脑袋才多大,其中一部分还是好吃的肉!所以请你帮小鱼编
        阅读全文
                
摘要:Train Problem I Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 42031 Accepted Submission(s): 15
        阅读全文
                

浙公网安备 33010602011771号