摘要: 博客链接:https://blog.csdn.net/bone_ace/article/details/46239187 阅读全文
posted @ 2018-07-28 17:29 cglong 阅读(120) 评论(0) 推荐(0) 编辑
摘要: 题目链接:https://vjudge.net/problem/UVALive-6442 题意:给出一个有n个点并且每个点等距的圆环,有m个硬币放在圆环的随机位置上(多个硬币可以放在同一个位置),要你求使得每个硬币和相邻硬币距离相等时花费的最小值。(保证m是n的因数) 花费的定义:所有硬币中移动步数 阅读全文
posted @ 2018-07-28 10:47 cglong 阅读(193) 评论(0) 推荐(0) 编辑
摘要: 题目链接:https://vjudge.net/problem/UVALive-6434 题意:给你n个数字,要你把这n个数字分成m组,每一组的消耗值定义为改组最大值和最小值之差,要求这m组的消耗值总和最小。 思路:既然我们要求把它分成m组,并且各组的最大值和最小值之差的和最小,我们就可以先把它分成 阅读全文
posted @ 2018-07-28 09:55 cglong 阅读(278) 评论(0) 推荐(0) 编辑
摘要: In an n∗mn∗m maze, the right-bottom corner is the exit (position (n,m)(n,m) is the exit). In every position of this maze, there is either a 00 or a 11 阅读全文
posted @ 2018-07-24 13:13 cglong 阅读(264) 评论(0) 推荐(0) 编辑
摘要: Problem Statement You are given nn strings str1,str2,…,strnstr1,str2,…,strn, each consisting of ( and ). The objective is to determine whether it is p 阅读全文
posted @ 2018-07-24 10:40 cglong 阅读(137) 评论(0) 推荐(0) 编辑
摘要: 昂贵的聘礼 Time Limit: 1000MS Memory Limit: 10000K Total Submissions: 54946 Accepted: 16518 Description 年轻的探险家来到了一个印第安部落里。在那里他和酋长的女儿相爱了,于是便向酋长去求亲。酋长要他用1000 阅读全文
posted @ 2018-07-23 13:39 cglong 阅读(1155) 评论(0) 推荐(0) 编辑
摘要: 题目链接:http://codeforces.com/gym/100971/problem/J J. Robots at Warehouse time limit per test 2.0 s memory limit per test 256 MB input standard input out 阅读全文
posted @ 2018-07-18 14:07 cglong 阅读(181) 评论(0) 推荐(1) 编辑
摘要: C. Report time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output Each month Blake gets the repo 阅读全文
posted @ 2018-07-18 12:39 cglong 阅读(218) 评论(0) 推荐(0) 编辑
摘要: 给出一段区间a-b,统计这个区间内0-9出现的次数。 比如 10-19,1出现11次(10,11,12,13,14,15,16,17,18,19,其中11包括2个1),其余数字各出现1次。 给出一段区间a-b,统计这个区间内0-9出现的次数。 比如 10-19,1出现11次(10,11,12,13, 阅读全文
posted @ 2018-07-15 09:46 cglong 阅读(168) 评论(0) 推荐(0) 编辑
摘要: 给定一个十进制正整数N,写下从1开始,到N的所有正数,计算出其中出现所有1的个数。 例如:n = 12,包含了5个1。1,10,12共包含3个1,11包含2个1,总共5个1。 给定一个十进制正整数N,写下从1开始,到N的所有正数,计算出其中出现所有1的个数。 例如:n = 12,包含了5个1。1,1 阅读全文
posted @ 2018-07-14 14:03 cglong 阅读(307) 评论(0) 推荐(0) 编辑