2012年5月24日

摘要: http://acm.hdu.edu.cn/showproblem.php?pid=4163稳定排序View Code #include <iostream>#include <cstdlib>#include <cstring>#include <string>#include <stack>#include <queue>#include <map>using namespace std;typedef struct L{ int price; int idx;}L;L kk[1000001];int cm 阅读全文
posted @ 2012-05-24 23:19 LegendaryAC 阅读(206) 评论(0) 推荐(0) 编辑
 
摘要: http://acm.hdu.edu.cn/showproblem.php?pid=1872稳定排序,用一个变量idx记录位置保持稳定View Code #include <iostream>#include <cstdlib>#include <cstring>#include <string>#include <stack>#include <queue>#include <map>using namespace std;typedef struct L{ char name[51]; int score; 阅读全文
posted @ 2012-05-24 22:04 LegendaryAC 阅读(246) 评论(0) 推荐(0) 编辑
 
摘要: http://acm.hdu.edu.cn/showproblem.php?pid=1022STL中栈的应用练习,数组要开够啊。。。无语View Code #include <iostream>#include <stack>using namespace std;int main(){ stack <char> s; char in[11],out[11]; int n; bool flag[30]; while(~scanf("%d%s%s",&n,in,out)) { int i,j,cnt; i=j=cnt=0; ... 阅读全文
posted @ 2012-05-24 16:30 LegendaryAC 阅读(142) 评论(0) 推荐(0) 编辑
 
摘要: http://acm.hdu.edu.cn/showproblem.php?pid=1273乱搞题,n-1减去起点,把剩下的点分成尽可能相等的两部分1、2(为了得到尽可能大的答案),对于1内部来讲,显然总能保证“新鲜”,在新鲜1后,不难看出2的每个点都对应着一个“新鲜”说的乱七八糟,大概就这样吧。。。View Code #include <iostream>#include <queue>#include <stack>#include <vector>using namespace std;int main(){ int n; while(sc 阅读全文
posted @ 2012-05-24 13:46 LegendaryAC 阅读(244) 评论(0) 推荐(0) 编辑