利用日期类的nextday(); 或者先加一个月的天数,然后判断是否大于给定天数,然后再加一个月的天数,在判断.... ...
分类:
其他好文 时间:
2017-06-24 17:27:05
阅读次数:
124
选择参考点,0年1月1日(认为是闰年)。日期a,日期b,算出abs((a-0)-(b-0)).视情况加1,若连续的日期视为两天,则res=abs((a-0)-(b-0))+1 . ...
分类:
其他好文 时间:
2017-06-24 15:30:41
阅读次数:
237
题目背景 快noip了,yyy很紧张! 题目描述 现在各大oj上有n个比赛,每个比赛的开始、结束的时间点是知道的。 yyy认为,参加越多的比赛,noip就能考的越好(假的) 所以,他想知道他最多能参加几个比赛。 由于yyy是蒟蒻,如果要参加一个比赛必须善始善终,而且不能同时参加2个及以上的比赛。 输 ...
分类:
其他好文 时间:
2017-06-23 18:27:27
阅读次数:
150
100. Same Tree Total Accepted: 100129 Total Submissions: 236623 Difficulty: Easy Given two binary trees, write a function to check if they are equal o ...
分类:
其他好文 时间:
2017-06-22 10:05:21
阅读次数:
117
#include #include #include using namespace std; int mypow(int k){ int res=1; while(k--){res*=10;} return res; } int main(){ int sum; int a,b,k; while(... ...
分类:
其他好文 时间:
2017-06-22 00:10:49
阅读次数:
137
#include #include #include using namespace std; struct Student{ char name[10]; int id; int grade; }student[100005]; bool cmp1(Student a,Student b){ re... ...
分类:
其他好文 时间:
2017-06-21 21:56:12
阅读次数:
132
通过两种遍历结果重建,必须有中序遍历(找到根的位置)。 ...
分类:
其他好文 时间:
2017-06-21 21:10:00
阅读次数:
180