题意:输入一个n以EOF作为结束,之后n行每行输入一个x,一个v,x代表当前车的坐标,v代表车的速度,问最后总共的超车数。解题思路:思路其实很简单,用将车排序,按照x1y2排序。然后比较就好了,当x1y2时超车数就增加。不过这题数据量比较大,暴力搜索的话肯定超时。在网上看到别人的思路才明白,也了解了...
分类:
其他好文 时间:
2014-05-23 09:04:06
阅读次数:
246
题目描述
给你一个有N个数的集合S和一个数X,判断是否存在S的一个子集,子集里的数的最小公倍数正好是X。
输入
第一行是数据组数T。 接下来有多组数据,每组数据包含两行: 第一行有2个数N和X,1
输出
对于每一组数据,输出一行"Case #X: Y",X是第几组数据,Y是Yes或No。
样例输入
2
4 20
2 3 4 5
3 61
3 4 5
样例输出
Case #1: ...
分类:
其他好文 时间:
2014-05-22 09:33:09
阅读次数:
180
指针悬空
指针悬空在我们使用指针的时候很容易被忽视,主要的表现是:指针所指向的内存
释放,指针并没有置为NULL,致使一个不可控制的指针。
#include
#include
int *pointer;
void func()
{
int n=8;
pointer=&n;
printf("pointer point data is %d\n",...
分类:
编程语言 时间:
2014-05-22 09:03:09
阅读次数:
371
是不是看题目觉的看不懂?其实我自己也看不懂,但是又找不到更好的词来形容。为了更好的表达我的意思,请看下。如果有一张成绩表(Points),学生(student)成绩(point)科目(subject)张三70英语张三80数学李四75语文李四85数学我想知道每个学生成绩最好的是哪一科,该怎么算??我们...
分类:
数据库 时间:
2014-05-21 20:43:22
阅读次数:
316
#include
#include
using namespace std;
class Point
{
public:
Point(double a,double b):x(a),y(b) {}
double getx()
{
return x;
}
double gety()
{
...
分类:
其他好文 时间:
2014-05-21 14:44:07
阅读次数:
281
Tautology
Time Limit: 1000MS
Memory Limit: 65536K
Total Submissions: 9078
Accepted: 3477
Description
WFF 'N PROOF is a logic game played with dice. Each die has six...
分类:
其他好文 时间:
2014-05-21 13:53:44
阅读次数:
259
POJ【数论/组合/博弈论】题目列表
POJ【数论/组合/博弈论】题目列表
原来的列表比较水,今天换了一个难一些的列表,重新开始做~
红色的代表已经AC过,蓝色的代表做了但是还没过。这句话貌似在我空间里的每份列表里都有额。
博弈论
POJ 2234 Matches Game
POJ 2975 Nim
POJ 2505 A multiplication game
POJ...
分类:
其他好文 时间:
2014-05-21 11:09:40
阅读次数:
346
#include
#include
using namespace std;
class Point
{
public:
Point(double a,double b):x(a),y(b) {}
double getx()
{
return x;
}
double gety()
{
return y;
...
分类:
其他好文 时间:
2014-05-21 10:09:26
阅读次数:
309
Catch That Cow
Problem Description
Farmer John has been informed of the location of a fugitive cow and wants to catch her immediately. He starts at a point N (0 ≤ N ≤ 100,000) on a number li...
分类:
其他好文 时间:
2014-05-21 07:02:40
阅读次数:
312