上一页 1 ··· 24 25 26 27 28 29 30 31 32 ··· 46 下一页
摘要: Python的输入数野生字符串,需要自己转型,常用的转型函数有: strip :将两端的空白字符去掉,返回str slipt :将字符串用空白字符分开,返回[str] map:把list里面的值映射到指定类型,返回[type] isspace:是否用空行组成 EOF用来抓异常 输出加','不换行 P 阅读全文
posted @ 2017-08-04 13:29 starry_sky 阅读(3578) 评论(0) 推荐(1)
摘要: A. Text Volume You are given a text of single-space separated words, consisting of small and capital Latin letters. Volume of the word is number of ca 阅读全文
posted @ 2017-08-04 11:43 starry_sky 阅读(351) 评论(0) 推荐(0)
摘要: 题目大意:任意△ABC中F、D、E分别为三边的三等分点中点,将其分别与对应的顶点相连,得到一个新的△RPQ。 现在给出△ABC的坐标,求△RPQ的面积 解题思路:求出△ABC的面积三角形 ABC 的面积 可以证明:S△BPQ :S△ABC = 1 : 7 也可以用每个边用向量缩减三倍求三分点,然后求 阅读全文
posted @ 2017-08-03 18:14 starry_sky 阅读(339) 评论(0) 推荐(0)
摘要: 给定n行m列个正方形,求可以组成多少个三角形。 如1×2,有18个。 总的点有N个,那个答案就是C(N,3),然后减去横向、竖向、斜向的三点共线的个数即可,斜线三点共线等价于所枚举的矩形的长宽成倍数关系,即gcd不为1。(这个想不懂,先放在这) 阅读全文
posted @ 2017-08-03 18:09 starry_sky 阅读(181) 评论(0) 推荐(0)
摘要: 题意是给定一个字符串,求最少把它分成多少份,使的每一份都是回文串。 错了好多遍,最后发现是贪心思路出了问题,一开始求出dp[i][j],dp[i][j]表示第i个到第j个这段子串是否是回文串,求出来后,我直接从1开始遍历,每次求最右边的,这种贪心思路是有问题的。 赛后看了别人的才知道可以用动态规划, 阅读全文
posted @ 2017-08-03 18:02 starry_sky 阅读(228) 评论(0) 推荐(0)
摘要: A - The Trip, 2007 小包可以放在打包里,求最少的数量。 做法就是求出现相同数字最多的。 B - Partitioning by Palindromes 传送 C - Seek the Name, Seek the Fame The little cat is so famous, 阅读全文
posted @ 2017-08-03 17:56 starry_sky 阅读(142) 评论(0) 推荐(0)
摘要: Heavy Transportation Description Background Hugo Heavy is happy. After the breakdown of the Cargolifter project he can now expand business. But he nee 阅读全文
posted @ 2017-08-03 11:18 starry_sky 阅读(145) 评论(0) 推荐(0)
摘要: Frogger Description Freddy Frog is sitting on a stone in the middle of a lake. Suddenly he notices Fiona Frog who is sitting on another stone. He plan 阅读全文
posted @ 2017-08-03 10:01 starry_sky 阅读(183) 评论(0) 推荐(0)
摘要: Description Bessie is out in the field and wants to get back to the barn to get as much sleep as possible before Farmer John wakes her for the morning 阅读全文
posted @ 2017-08-02 21:02 starry_sky 阅读(138) 评论(0) 推荐(0)
摘要: 还是畅通工程 Problem Description 某省调查乡村交通状况,得到的统计表中列出了任意两村庄间的距离。省政府“畅通工程”的目标是使全省任何两个村庄间都可以实现公路交通(但不一定有直接的公路相连,只要能间接通过公路可达即可),并要求铺设的公路总长度为最小。请计算最小的公路总长度。 Inp 阅读全文
posted @ 2017-08-02 20:25 starry_sky 阅读(156) 评论(0) 推荐(0)
上一页 1 ··· 24 25 26 27 28 29 30 31 32 ··· 46 下一页