http://ac.jobdu.com/problem.php?pid=1156
题目1156:谁是你的潜在朋友
时间限制:1 秒
内存限制:32 兆
特殊判题:否
提交:3990
解决:1837
题目描述:
“臭味相投”——这是我们描述朋友时喜欢用的词汇。两个人是朋友通常意味着他们存在着许多共同的兴趣。然而作为一个宅男,...
分类:
其他好文 时间:
2015-01-04 17:09:08
阅读次数:
153
http://ac.jobdu.com/problem.php?pid=1186
题目1186:打印日期
时间限制:1 秒
内存限制:32 兆
特殊判题:否
提交:4343
解决:1509
题目描述:
给出年分m和一年中的第n天,算出第n天是几月几号。
输入:
输入包括两个整数y(1
输出:
可能有...
分类:
其他好文 时间:
2015-01-04 15:19:19
阅读次数:
118
http://ac.jobdu.com/problem.php?pid=1096
很经典的计算任意两个日期之间的差值。
方法:利用预处理,以空间换时间的方法,计算任意日期与初始日期0年1月1日之间的差值。再讲两差值求差+1即可。本题关键在预处理部分
#include
#define
ISYEAR(x) x%100!=0&&x%4==0||x%400==0?1:0
in...
分类:
其他好文 时间:
2015-01-04 10:00:12
阅读次数:
157
题目1001:A+B for Matrices
时间限制:1 秒
内存限制:32 兆
特殊判题:否
提交:14669
解决:5996
题目描述:
This time, you are supposed to find A+B where A and B are two matrices, and then count the num...
分类:
其他好文 时间:
2015-01-04 01:18:51
阅读次数:
202
题目1002:Grading
时间限制:1 秒
内存限制:32 兆
特殊判题:否
提交:15686
解决:4053
题目描述:
Grading hundreds of thousands of Graduate Entrance Exams is a hard work. It is even harder to design a...
分类:
其他好文 时间:
2015-01-04 01:18:50
阅读次数:
178
http://ac.jobdu.com/problem.php?pid=1023
分别写cmp函数即可。
#include
#include
#include
using namespace std;
struct E{
char number[10];
char name[10];
int score;
}buf[100000+10];
bool cmp1(E ...
分类:
编程语言 时间:
2015-01-03 22:29:32
阅读次数:
446
题目描述:
Finding all occurrences of a pattern in a text is a problem that arises frequently in text-editing programs.
Typically,the text is a document being edited,and the pattern searched f...
分类:
其他好文 时间:
2015-01-03 11:59:34
阅读次数:
157
题目描述:
输入n个整数,依次输出每个数的约数的个数
输入:
输入的第一行为N,即数组的个数(N
接下来的1行包括N个整数,其中每个数的范围为(1
当N=0时输入结束。
输出:
可能有多组输入数据,对于每组输入数据,
输出N行,其中每一行对应上面的一个数的约数的个数。
样例输入:
5
1 3 4 6 12
样例输出:
1
2
3
4
6
...
分类:
其他好文 时间:
2015-01-03 11:57:05
阅读次数:
137
题目描述:
对于一个字符串,将其后缀子串进行排序,例如grain
其子串有:
grain
rain
ain
in
n
然后对各子串按字典顺序排序,即:
ain,grain,in,n,rain
输入:
每个案例为一行字符串。
输出:
将子串排序输出
样例输入:
grain
样例输出:
ain
grain
in
n
rain
...
分类:
编程语言 时间:
2015-01-03 09:30:54
阅读次数:
169
题目描述:
浙江桐乡乌镇共有n个人,请找出该镇上的前m个大富翁.
输入:
输入包含多组测试用例.
每个用例首先包含2个整数n(0
n和m同时为0时表示输入结束.
输出:
请输出乌镇前m个大富翁的财产数,财产多的排前面,如果大富翁不足m个,则全部输出,每组输出占一行.
样例输入:
3 1
2 5 -1
5 3
1 2 3 ...
分类:
其他好文 时间:
2015-01-03 09:28:53
阅读次数:
137