摘要: 用stl 写代码明显是短了,时间也直线上升不用stl 写的#include<stdio.h>#include<stdlib.h>int f[10000002];int cmp ( const void *a , const void *b ){return *(int *)a - *(int *)b;}int main(){ int a,i,k,n,s,e; char st[3]; while(scanf("%d %d",&n,&k)!=EOF) { for(i=0;i< k;i++) { scanf("%s %d&q 阅读全文
posted @ 2012-04-19 22:29 skyming 阅读(248) 评论(0) 推荐(0) 编辑
摘要: 题意: 每个数的因子都是有1 2 3 5组成,求第n数是几悲剧的是,不知道怎么回事,电脑上的各个编译器都不能用了#include <iostream>#include <cstdio>#include <queue>using namespace std;typedef pair<long long ,int> node_type;int main(){ int sum[1500]; priority_queue <node_type, vector<node_type>,greater<node_type> > 阅读全文
posted @ 2012-04-19 21:11 skyming 阅读(209) 评论(0) 推荐(0) 编辑
摘要: 题意:模拟window进程#include<iostream>#include<cstdio>#include<string.h>#include<string>#include <queue>using namespace std;struct msg{ string name; int sum,val; bool operator < (const msg &a) const { return a.val<val; }};int main(){ char str[100]; priority_queue < 阅读全文
posted @ 2012-04-19 16:52 skyming 阅读(245) 评论(0) 推荐(0) 编辑