K. Color Graph 题意: 给定一个简单图,点个数<=16,删去部分边后,使得该图中无边数为奇数得环,问剩下的边数最大为多少? 思路: 如果一个图中无奇数边的环,那么这个图一定是个二分图.只要枚举二分图的左部,统计所有从左部到右部的边个数,答案就是枚举出的所有边数的最大值.(因为最优解一定也是一个二分图,所以一定会被枚举到) //赛后补题,只过样例,仅供参考 #include <bits/stdc++.h> using namespace std; const int maxn
之前写过一篇,这是第二篇.上一篇用了多种编程语言来做,这一次是以学算法为主,所以打算都用python来完成. 4. Median of Two Sorted Arrays There are two sorted arrays nums1 and nums2 of size m and n respectively. Find the median of the two sorted arrays. The overall run time complexity should be O(log
http://codeforces.com/contest/574/problem/D Bear and Blocks time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output Limak is a little bear who loves to play. Today he is playing by destroying block