TinaCristal's Blog


  • Home

  • Tags

  • Categories

  • Archives

  • Search

历届试题 打印十字图

Posted on 2019-03-12 | In 蓝桥杯

问题描述
小明为某机构设计了一个十字型的徽标(并非红十字会啊),如下所示:

Read more »

算法提高 合并石子

Posted on 2019-03-12 | In 蓝桥杯

问题描述

  在一条直线上有n堆石子,每堆有一定的数量,每次可以将两堆相邻的石子合并,合并后放在两堆的中间位置,合并的费用为两堆石子的总数。求把所有石子合并成一堆的最小花费。

Read more »

字符串比较== strcmp

Posted on 2019-03-12 | In c++

strcmp是用来判断char类型的字符串是否相等的,char字符串实际上就是字符串的首地址。

Read more »

A1057 Stack

Posted on 2019-03-11 | In pat

Stack is one of the most fundamental data structures, which is based on the principle of Last In First Out (LIFO). The basic operations include Push (inserting an element onto the top position) and Pop (deleting the top element). Now you are supposed to implement a stack with an extra operation: PeekMedian – return the median value of all the elements in the stack. With N elements, the median value is defined to be the (N/2)-th smallest element if N is even, or ((N+1)/2)-th if N is odd.

Read more »

A1068. Find More Coins

Posted on 2019-03-11 | In pat

Eva loves to collect coins from all over the universe, including some other planets like Mars. One day she visited a universal shopping mall which could accept all kinds of coins as payments. However, there was a special requirement of the payment: for each bill, she must pay the exact amount. Since she has as many as 10
​4
​​ coins with her, she definitely needs your help. You are supposed to tell her, for any given amount of money, whether or not she can find some coins to pay for it.

Read more »

A1040 Longest Symmetric String

Posted on 2019-03-11 | In pat

Given a string, you are supposed to output the length of the longest symmetric sub-string. For example, given Is PAT&TAP symmetric?, the longest symmetric sub-string is s PAT&TAP s, hence you must output 11.

Read more »

A1045 Favorite Color Stripe

Posted on 2019-03-10 | In pat

Eva is trying to make her own color stripe out of a given one. She would like to keep only her favorite colors in her favorite order by cutting off those unwanted pieces and sewing the remaining parts together to form her favorite color stripe.

Read more »

A1007 最大连续子序列和

Posted on 2019-03-10 | In pat

LCS 动态规划

dp[i] 表示以a[i]结尾的最大的连续子序列的和

最大连续子序列和=max(dp[0],dp[1],dp[2]….dp[n-1])

Read more »

历届试题 地宫取宝

Posted on 2019-03-10 | In 蓝桥杯

问题描述

  X 国王有一个地宫宝库。是 n x m 个格子的矩阵。每个格子放一件宝贝。每个宝贝贴着价值标签。

Read more »

算法提高 学霸的迷宫

Posted on 2019-03-10 | In 蓝桥杯

问题描述

  学霸抢走了大家的作业,班长为了帮同学们找回作业,决定去找学霸决斗。但学霸为了不要别人打扰,住在一个城堡里,城堡外面是一个二维的格子迷宫,要进城堡必须得先通过迷宫。因为班长还有妹子要陪,磨刀不误砍柴功,他为了节约时间,从线人那里搞到了迷宫的地图,准备提前计算最短的路线。可是他现在正向妹子解释这件事情,于是就委托你帮他找一条最短的路线。

Read more »

1…8910…45

TinaCristal

443 posts
57 categories
55 tags
GitHub E-Mail
© 2020 TinaCristal
Powered by Hexo
|
Theme — NexT.Mist v5.1.4