比赛 20150423 评测结果 AAAAAAAAAAAAAA
题目名称 奶牛跑步2 最终得分 100
用户昵称 wolf. 运行时间 0.659 s
代码语言 C++ 内存使用 0.31 MiB
提交时间 2015-04-23 11:10:59
显示代码纯文本
#include<iostream>
#include<fstream>
#include<bitset>
#include<vector>
#include<deque>
#include<map>
#include<set>
#include<queue>
#include<string>
#include<algorithm>
#include<cmath>
#include<ctime>
#include<cstdio>
using namespace std;
#if defined wolf
const string ok="OK";
const string kk="	";
ofstream nnew("cowjogb.in",ios::app);
ifstream fin("cowjogb.in");
#define fout cout
#define Endl endl
#else
ifstream fin("cowjogb.in");
ofstream fout("cowjogb.out");
#endif
const long long IMAX=9223372036854775807ll;
vector<long long> TT;
int core(){
	vector<long long> num;
	num.push_back(IMAX);
	for(int i=TT.size()-1;i>=0;--i){
		bool fall=1;
		for(int j=0;j!=num.size();++j){
			if(num[j]>TT[i]){
				num[j]=TT[i];
				fall=0;
				break;
			}
		}
		if(fall){
			num.push_back(TT[i]);
		}
	}
	return num.size();
}
int main(){
	#if defined wolf
	int u;
	fin>>u; 
	for(int i=0;i!=u;++i){
		int e;
		fin>>e;
		cout<<e<<" ";
		TT.push_back(e);
	}
	cout<<endl;
	fout<<core()<<endl;
	return 0;
	#endif
	long long n,t;
	fin>>n>>t;
	for(int i=0;i!=n;++i){
		long long beg,v;
		fin>>beg>>v;
		TT.push_back(beg+v*t);
	}
	fout<<core()<<endl;
	//-------------------------*/
	#if defined wolf
	cout<<endl<<(double)clock()/CLOCKS_PER_SEC<<'s'<<endl;
	#endif
	return 0;
}
//Designed by wolf
//Thu Apr 23 2015