随笔分类 -  贪心

上一页 1 ··· 7 8 9 10 11 12 13 14 15 ··· 20 下一页
摘要:(hotel.cpp/c/pas) 【问题描述】 丽江河边有n 家很有特色的客栈,客栈按照其位置顺序从 1 到n 编号。每家客栈都按照 某一种色调进行装饰(总共 k 种,用整数 0 ~ k-1 表示),且每家客栈都设有一家咖啡店,每 家咖啡店均有各自的最低消费。 两位游客一起去丽江旅... 阅读全文
posted @ 2017-10-04 18:45 AWCXV 阅读(131) 评论(0) 推荐(0)
摘要:【题目链接】:http://hihocoder.com/problemset/problem/1496【题意】 【题解】 先把这n个数排个序吧. 这样相邻的数字就在一起了; 这样a[i]&a[i+1]的值肯定是尽可能地大了; 然后乘上a[i]*a[i+1]再取max就好; 奇怪的贪... 阅读全文
posted @ 2017-10-04 18:45 AWCXV 阅读(88) 评论(0) 推荐(0)
摘要:【题目链接】:http://codeforces.com/contest/767/problem/B【题意】 排队去办护照; 给你n个人何时来的信息; 然后问你应该何时去才能在队伍中等待的时间最短; (如果你和别人同时到,你要等到和你同时到的人全都办完了才轮到你); 【题解】 细... 阅读全文
posted @ 2017-10-04 18:45 AWCXV 阅读(153) 评论(0) 推荐(0)
摘要:【题目链接】:http://codeforces.com/contest/527/problem/B【题意】 给你两个字符串; 允许你交换一个字符串的两个字符一次; 问你这两个字符串最少会有多少个位置上的字符不同 【题解】 考虑一次交换能够造成的结果 ->不同的字符个数减少1 -... 阅读全文
posted @ 2017-10-04 18:45 AWCXV 阅读(251) 评论(0) 推荐(0)
摘要:【题目链接】:http://codeforces.com/contest/534/problem/D【题意】 n个人依次进入一个房间; 进进来的人会和房间里面没有组队的人握一次手; (这里的握手只计算主动握手的那个人的握手次数); (任意时刻,任意3个人都能组队); 给出每个人的握... 阅读全文
posted @ 2017-10-04 18:45 AWCXV 阅读(265) 评论(0) 推荐(0)
摘要:【题目链接】:http://www.lydsy.com/JudgeOnline/problem.php?id=1034【题意】 【题解】 如果己方最小的大于对方最小的(严格大于) 或己方最大的大于对方最大的(严格大于) 则让这对最大最小的PK;答案递增2 否则, 采用田忌赛马的思想... 阅读全文
posted @ 2017-10-04 18:45 AWCXV 阅读(104) 评论(0) 推荐(0)
摘要:【题目链接】:http://codeforces.com/contest/791/problem/C【题意】 给你n-k+1个限制 要求 a[i]..a[i]+k-1里面有相同的元素,或全都不同; 让你输出可能的一个序列 【题解】 先找到YES的一段 (找不到就全都输出一样的);... 阅读全文
posted @ 2017-10-04 18:45 AWCXV 阅读(155) 评论(0) 推荐(0)
摘要:time limit per test2 seconds memory limit per test256 megabytes inputstandard input outputstandard output Every Codeforces user has rating, de... 阅读全文
posted @ 2017-10-04 18:45 AWCXV 阅读(152) 评论(0) 推荐(0)
摘要:time limit per test2 seconds memory limit per test256 megabytes inputstandard input outputstandard output Santa Claus likes palindromes very m... 阅读全文
posted @ 2017-10-04 18:45 AWCXV 阅读(115) 评论(0) 推荐(0)
摘要:time limit per test2 seconds memory limit per test256 megabytes inputstandard input outputstandard output You’ve got array A, consisting of n ... 阅读全文
posted @ 2017-10-04 18:45 AWCXV 阅读(156) 评论(0) 推荐(0)
摘要:time limit per test1 second memory limit per test256 megabytes inputstandard input outputstandard output There are n employees in Alternative ... 阅读全文
posted @ 2017-10-04 18:45 AWCXV 阅读(217) 评论(0) 推荐(0)
摘要:time limit per test1 second memory limit per test256 megabytes inputstandard input outputstandard output The winter in Berland lasts n days. F... 阅读全文
posted @ 2017-10-04 18:45 AWCXV 阅读(240) 评论(0) 推荐(0)
摘要:time limit per test1 second memory limit per test256 megabytes inputstandard input outputstandard output The tram in Berland goes along a stra... 阅读全文
posted @ 2017-10-04 18:45 AWCXV 阅读(207) 评论(0) 推荐(0)
摘要:time limit per test2 seconds memory limit per test256 megabytes inputstandard input outputstandard output Hongcow is ruler of the world. As ru... 阅读全文
posted @ 2017-10-04 18:45 AWCXV 阅读(140) 评论(0) 推荐(0)
摘要:time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output A long time ago, in a galaxy far ... 阅读全文
posted @ 2017-10-04 18:45 AWCXV 阅读(185) 评论(0) 推荐(0)
摘要:Problem StatementRecently, Alice had to take a test. The test consisted of a sequence of true/false questions. Alice was completely unprepared... 阅读全文
posted @ 2017-10-04 18:45 AWCXV 阅读(228) 评论(0) 推荐(0)
摘要:time limit per test1 second memory limit per test256 megabytes inputstandard input outputstandard output Companies always have a lot of equipm... 阅读全文
posted @ 2017-10-04 18:45 AWCXV 阅读(157) 评论(0) 推荐(0)
摘要:Time Limit: 1 second Memory Limit: 32 MB【问题描述】高考结束后,同学们大都找到了一份临时工作,渴望挣得一些零用钱。从今天起,Matrix67将连续工作N天(1#include #include #include #include #includ... 阅读全文
posted @ 2017-10-04 18:45 AWCXV 阅读(124) 评论(0) 推荐(0)
摘要:时间限制:1s 内存限制:32MB 问题描述 回文串是一个正读和反读都一样的字符串,比如level或者noon就是回文串。回文数组也是如此,比如[100,200,100]或者[178,256,256,178]就是回文数组... 阅读全文
posted @ 2017-10-04 18:45 AWCXV 阅读(446) 评论(0) 推荐(0)
摘要:Time Limit: 3 second Memory Limit: 2 MB【问题描述】元旦快到了,校学生会让乐乐负责新年晚会的纪念品发放工作。为使得参加晚会的同学所获得 的纪念品价值相对均衡,他要把购来的纪念品根据价格进行分组,但每组最多只能包括两件纪念品, 并且每组纪念品的价格... 阅读全文
posted @ 2017-10-04 18:45 AWCXV 阅读(127) 评论(0) 推荐(0)

上一页 1 ··· 7 8 9 10 11 12 13 14 15 ··· 20 下一页