题目链接
题意:牧师John能否安排到所有婚礼,使其为所有婚礼送上祝福(祝福时间大于婚礼从时间的一半)。
思路:贪心,按照婚礼中间时间从小到大排序,尽量早结束婚礼祝福时间最晚开始(每个婚礼都有一个祝福时间最晚开始的时间)比较早的婚礼。
代码:
#include
#include
#include
#include
using namespace std;
...
分类:
其他好文 时间:
2014-08-17 17:03:52
阅读次数:
158
在开始新的一天之前,先整合下前面6天我们所学的Day 1: android的背景知识,平台架构与相关特性,还有开发环境的搭建Day 2: 四大组件的初步了解,app的生命周期,app工程目录的理解,开发简单的电话拨号器, 六大布局,三种提示方式;九妹9patch工作制作局部缩放的素材Day...
分类:
移动开发 时间:
2014-08-17 03:39:31
阅读次数:
308
Description
Happy Birthday
Today it's February 13th. It's a very special day: Miguel's birthday! Like every year, he's organised a big celebration for all his friends. He pr...
分类:
移动开发 时间:
2014-08-16 19:51:52
阅读次数:
267
小猪的Android入门之路 Day 7 part 1
Android的数据存储与访问之——文件
在开始本节之前先复习下前六天学到的知识点...
如果前面六天学的你都会了,就可以部署一些比较简单的App了,你可以做出一个自定义的UI界面,实现一些点击
页面跳转!好了,假如现在要我们做一个简单的记事本,相信大家都噼里啪啦地做出自己的界面来了,但是真正写
东西进去,那些信息保存去哪里?我们貌似只学过往Intent里putExtras()写入Bundle类型的数据,但是如果
我们下次重新开软件呢?之前写的东西都不...
分类:
移动开发 时间:
2014-08-16 13:53:00
阅读次数:
288
#计算两个时间的间隔#计算间隔天数select TIMESTAMPDIFF(day,'2014-06-01',date(now()))#计算间隔月数select TIMESTAMPDIFF(month,'2014-01-01',date(now()))#计算间隔年数select TIMESTAMPD...
分类:
数据库 时间:
2014-08-16 13:46:20
阅读次数:
259
Detect the Virus
Time Limit: 2 Seconds Memory Limit: 65536 KB
One day, Nobita found that his computer is extremely slow. After several hours' work, he finally found that it was a virus that...
分类:
其他好文 时间:
2014-08-16 09:44:50
阅读次数:
377
One day, Twilight Sparkle is interested in how to sort a sequence of integersa1,?a2,?...,?anin non-decreasing order. Being a young unicorn, the only o...
分类:
其他好文 时间:
2014-08-15 20:55:49
阅读次数:
206
Problem Description
Some people believe that there are three cycles in a person's life that start the day he or she is born. These three cycles are the physical, emotional, and intellectual cycles,...
分类:
其他好文 时间:
2014-08-15 17:58:59
阅读次数:
240
1 window.onload = function(){ 2 var uS = 604800; //后台提供 : 秒 3 var day=hour=minute=second=0, timer; 4 var demo = document.getElementById(...
分类:
Web程序 时间:
2014-08-15 17:45:29
阅读次数:
210
#include void main(){ int year,month,day,sum,m; printf("请输入年月日(如:1991,1,1)\n"); scanf("%d,%d,%d",&year,&month,&day); if((month==2&&day==30)||(month==2...
分类:
其他好文 时间:
2014-08-14 23:49:26
阅读次数:
243