摘要: 经典的欧拉回路题http://poj.org/problem?id=1041欧拉回路:每条边经过一次且仅一次的称为欧拉回路(euler cycle, euler circuit)。存在欧拉回路的充要条件:每个点的度数都是偶数, 且图连通。#include "iostream"#include "stdio.h"#include "string.h"#include "algorithm"using namespace std;int G[50][2000]; //G[点][边] = 点,这样是为了能方便让边lexi 阅读全文
posted @ 2011-08-04 18:56 Firecoder 阅读(153) 评论(0) 推荐(0) 编辑
摘要: http://poj.org/problem?id=3267#include "stdio.h"#include "iostream"#include "string.h"using namespace std;char dict[610][30]; //the cows' dictionarychar seq[310]; //the received messageint dp[310];int min(int a, int b){ return a < b ? a : b;}int main(){ int n, L, 阅读全文
posted @ 2011-08-04 11:59 Firecoder 阅读(128) 评论(0) 推荐(0) 编辑