2012年8月13日

[贪心] COJ 1236 删数游戏

摘要: 每次查找第一个降序的首字符,如果不存在就删除结尾字符,链表,O(n)。# include <cstdio># include <iostream>using namespace std;struct node{ char ch; node *pre, *next;};void b(node *head, char *s){ head->ch = s[0]; node *tmp = head; for (int i = 0; s[i]; ++i) { node *cur = new node; cur->ch = s[i+1]; ... 阅读全文

posted @ 2012-08-13 16:30 getgoing 阅读(286) 评论(0) 推荐(0) 编辑

导航