摘要: 都忘了欧拉路径是什么了。。用dfs搜 标记边 刚开始直接从I-N搜 直接超时 2了 先找符合起点和终点的点搜 即度数是奇数d单dfs也超了 后来换了个姿势。。 1 /* 2 ID: shangca2 3 LANG: C++ 4 TASK: fence 5 */ 6 #include 7 #include 8 #include 9 #include10 #include11 using namespace std;12 int w[510][510],n,p[2010],flag,m,de[510],t;13 void dfs(int u,int d)14 {15 ... 阅读全文
posted @ 2013-08-20 21:59 _雨 阅读(223) 评论(0) 推荐(0) 编辑
摘要: 直接枚举角度 数据比较水吧 1 /* 2 ID: shangca2 3 LANG: C++ 4 TASK: spin 5 */ 6 #include 7 #include 8 #include 9 #include10 #include11 using namespace std;12 struct node13 {14 int l[10],r[10],k,v;15 }p[10];16 int f[6][370];17 int main()18 {19 freopen("spin.in","r",stdin);20 freopen("spin. 阅读全文
posted @ 2013-08-20 20:33 _雨 阅读(195) 评论(0) 推荐(0) 编辑
摘要: 最短路复杂度估计错误 以为SPFA是N*m的 用了dij超时 用SPFA直接跑就好了O(k*e) K 一般为2,3; 1 /* 2 ID: shangca2 3 LANG: C++ 4 TASK: butter 5 */ 6 #include 7 #include 8 #include 9 #include 10 #include 11 #include 12 using namespace std; 13 #define M 1500 14 #define P 850 15 #define N 550 16 #define INF 0xfffff... 阅读全文
posted @ 2013-08-20 19:42 _雨 阅读(241) 评论(0) 推荐(0) 编辑