ADDED   SRM/528/1A.cpp
Index: SRM/528/1A.cpp
==================================================================
--- SRM/528/1A.cpp
+++ SRM/528/1A.cpp
@@ -0,0 +1,107 @@
+#include <iostream>
+#include <sstream>
+#include <iomanip>
+#include <vector>
+#include <string>
+#include <map>
+#include <set>
+#include <algorithm>
+#include <numeric>
+#include <iterator>
+#include <functional>
+#include <complex>
+#include <queue>
+#include <stack>
+#include <cmath>
+#include <cassert>
+#include <cstring>
+#ifdef __GNUC__
+#include <ext/hash_map>
+#define unordered_map __gnu_cxx::hash_map
+#else
+#include <unordered_map>
+#endif
+using namespace std;
+typedef long long LL;
+typedef complex<double> CMP;
+
+class Cut { public:
+	static bool TensFirst(int a, int b)
+	{
+		if(a%10 != b%10)
+			return a%10 < b%10;
+		return a < b;
+	}
+
+	int getMaximum(vector <int> eelLengths, int maxCuts)
+	{
+		sort(eelLengths.begin(), eelLengths.end(), &TensFirst);
+
+		int una = 0;
+		for(int i=0; i<eelLengths.size(); ++i) {
+			int e = eelLengths[i];
+			while( maxCuts && e>10 )
+				una++, maxCuts--, e-=10;
+			if( e == 10 )
+				una++;
+		}
+		return una;
+	}
+};
+
+// BEGIN CUT HERE
+#include <ctime>
+double start_time; string timer()
+ { ostringstream os; os << " (" << int((clock()-start_time)/CLOCKS_PER_SEC*1000) << " msec)"; return os.str(); }
+template<typename T> ostream& operator<<(ostream& os, const vector<T>& v)
+ { os << "{ ";
+   for(typename vector<T>::const_iterator it=v.begin(); it!=v.end(); ++it)
+   os << '\"' << *it << '\"' << (it+1==v.end() ? "" : ", "); os << " }"; return os; }
+void verify_case(const int& Expected, const int& Received) {
+ bool ok = (Expected == Received);
+ if(ok) cerr << "PASSED" << timer() << endl;  else { cerr << "FAILED" << timer() << endl;
+ cerr << "\to: \"" << Expected << '\"' << endl << "\tx: \"" << Received << '\"' << endl; } }
+#define CASE(N) {cerr << "Test Case #" << N << "..." << flush; start_time=clock();
+#define END	 verify_case(_, Cut().getMaximum(eelLengths, maxCuts));}
+int main(){
+
+CASE(0)
+	int eelLengths_[] = {13, 20, 13};
+	  vector <int> eelLengths(eelLengths_, eelLengths_+sizeof(eelLengths_)/sizeof(*eelLengths_)); 
+	int maxCuts = 2; 
+	int _ = 3; 
+END
+CASE(1)
+	int eelLengths_[] = {5, 5, 5, 5};
+	  vector <int> eelLengths(eelLengths_, eelLengths_+sizeof(eelLengths_)/sizeof(*eelLengths_)); 
+	int maxCuts = 2; 
+	int _ = 0; 
+END
+CASE(2)
+	int eelLengths_[] = {34, 10, 48};
+	  vector <int> eelLengths(eelLengths_, eelLengths_+sizeof(eelLengths_)/sizeof(*eelLengths_)); 
+	int maxCuts = 4; 
+	int _ = 5; 
+END
+CASE(3)
+	int eelLengths_[] = {30, 50, 30, 50};
+	  vector <int> eelLengths(eelLengths_, eelLengths_+sizeof(eelLengths_)/sizeof(*eelLengths_)); 
+	int maxCuts = 350; 
+	int _ = 16; 
+END
+/*
+CASE(4)
+	int eelLengths_[] = ;
+	  vector <int> eelLengths(eelLengths_, eelLengths_+sizeof(eelLengths_)/sizeof(*eelLengths_)); 
+	int maxCuts = ; 
+	int _ = ; 
+END
+CASE(5)
+	int eelLengths_[] = ;
+	  vector <int> eelLengths(eelLengths_, eelLengths_+sizeof(eelLengths_)/sizeof(*eelLengths_)); 
+	int maxCuts = ; 
+	int _ = ; 
+END
+*/
+}
+// END CUT HERE

ADDED   SRM/528/1B.cpp
Index: SRM/528/1B.cpp
==================================================================
--- SRM/528/1B.cpp
+++ SRM/528/1B.cpp
@@ -0,0 +1,127 @@
+#include <iostream>
+#include <sstream>
+#include <iomanip>
+#include <vector>
+#include <string>
+#include <map>
+#include <set>
+#include <algorithm>
+#include <numeric>
+#include <iterator>
+#include <functional>
+#include <complex>
+#include <queue>
+#include <stack>
+#include <cmath>
+#include <cassert>
+#include <cstring>
+#ifdef __GNUC__
+#include <ext/hash_map>
+#define unordered_map __gnu_cxx::hash_map
+#else
+#include <unordered_map>
+#endif
+using namespace std;
+typedef long long LL;
+typedef complex<double> CMP;
+
+template<typename T>
+struct DP2x
+{
+	const int N1, N2;
+	vector<T> data;
+	DP2x(int, int N2, const T& t = T())
+		: N1(2), N2(N2), data(N1*N2, t) { assert(data.size()*sizeof(T)<(1<<26)); }
+	T& operator()(int i1, int i2)
+		{ i1&=1; return data[ (i1*N2)+i2 ]; }
+	void swap(DP2x& rhs)
+		{ data.swap(rhs.data); }
+};
+
+class SPartition { public:
+	long long getCount(string s)
+	{
+		if( s.size()%2 != 0 )
+			return 0;
+
+		int N = s.size()/2;
+		DP2x<LL> dp(s.size()+1, 1<<N);
+		for(int i=s.size(); i>=0; --i)
+			for(int bits=0,ni=min(N,i); bits<(1<<ni); ++bits)
+			{
+				if( i == s.size() )
+					dp(i,bits) = (bits==0 ? 1 : 0);
+				else {
+					if( bits == 0 ) {
+						dp(i, bits) = dp(i+1, 1) * 2;
+					} else {
+						int iMax = 0;
+						while( (2<<iMax) <= bits )
+							++iMax;
+						int oldb = s[i-1-iMax];
+						int newb = s[i];
+						LL tot = 0;
+						if( oldb == newb )
+							tot += dp(i+1, (bits &~ (1<<iMax))<<1);
+						if( (bits<<1 | 1) < (1<<N) )
+							tot += dp(i+1, bits<<1 | 1);
+						dp(i,bits) = tot;
+					}
+				}
+			}
+		return dp(0, 0);
+	}
+};
+
+// BEGIN CUT HERE
+#include <ctime>
+double start_time; string timer()
+ { ostringstream os; os << " (" << int((clock()-start_time)/CLOCKS_PER_SEC*1000) << " msec)"; return os.str(); }
+template<typename T> ostream& operator<<(ostream& os, const vector<T>& v)
+ { os << "{ ";
+   for(typename vector<T>::const_iterator it=v.begin(); it!=v.end(); ++it)
+   os << '\"' << *it << '\"' << (it+1==v.end() ? "" : ", "); os << " }"; return os; }
+void verify_case(const long long& Expected, const long long& Received) {
+ bool ok = (Expected == Received);
+ if(ok) cerr << "PASSED" << timer() << endl;  else { cerr << "FAILED" << timer() << endl;
+ cerr << "\to: \"" << Expected << '\"' << endl << "\tx: \"" << Received << '\"' << endl; } }
+#define CASE(N) {cerr << "Test Case #" << N << "..." << flush; start_time=clock();
+#define END	 verify_case(_, SPartition().getCount(s));}
+int main(){
+
+CASE(0)
+	string s = "oxox"; 
+	long long _ = 2LL; 
+END
+CASE(1)
+	string s = "oooxxx"; 
+	long long _ = 0LL; 
+END
+CASE(2)
+	string s = "xoxxox"; 
+	long long _ = 4LL; 
+END
+CASE(3)
+	string s = "xo"; 
+	long long _ = 0LL; 
+END
+CASE(4)
+	string s = "ooooxoox"; 
+	long long _ = 8LL; 
+END
+CASE(5)
+	string s = "ooxxoxox"; 
+	long long _ = 8LL; 
+END
+CASE(6)
+	string s = "oxoxoxoxoxoxoxoxoxoxoxoxoxoxoxoxoxoxoxox"; 
+	long long _ = -1LL; 
+END
+/*
+CASE(7)
+	string s = ; 
+	long long _ = LL; 
+END
+*/
+}
+// END CUT HERE

ADDED   SRM/528/1C.cpp
Index: SRM/528/1C.cpp
==================================================================
--- SRM/528/1C.cpp
+++ SRM/528/1C.cpp
@@ -0,0 +1,132 @@
+#include <iostream>
+#include <sstream>
+#include <iomanip>
+#include <vector>
+#include <string>
+#include <map>
+#include <set>
+#include <algorithm>
+#include <numeric>
+#include <iterator>
+#include <functional>
+#include <complex>
+#include <queue>
+#include <stack>
+#include <cmath>
+#include <cassert>
+#include <cstring>
+#ifdef __GNUC__
+#include <ext/hash_map>
+#define unordered_map __gnu_cxx::hash_map
+#else
+#include <unordered_map>
+#endif
+using namespace std;
+typedef long long LL;
+typedef complex<double> CMP;
+
+template<typename T>
+struct DP2x
+{
+	const int N1, N2;
+	vector<T> data;
+	DP2x(int, int N2, const T& t = T())
+		: N1(2), N2(N2), data(N1*N2, t) { assert(data.size()*sizeof(T)<(1<<26)); }
+	T& operator()(int i1, int i2)
+		{ i1&=1; return data[ (i1*N2)+i2 ]; }
+	void swap(DP2x& rhs)
+		{ data.swap(rhs.data); }
+};
+
+class ColorfulCookie { public:
+	int getMaximum(vector <int> cookies, int P1, int P2)
+	{
+		int L = 0;
+		int R = accumulate(cookies.begin(), cookies.end(), 0) / (P1+P2) + 1;
+		while( R-L > 1 ) { // [L, R)
+			int C = (L+R) / 2;
+			(possible(cookies, P1, P2, C) ? L : R) = C;
+		}
+		return L * (P1+P2);
+	}
+
+	bool possible(const vector<int>& C, int P1, int P2, int Times)
+	{
+		DP2x<int> maxP2forP1(C.size()+1, Times+1, -1);
+		maxP2forP1(0,0) = 0;
+		for(int i=0; i<C.size(); ++i)
+			for(int n=0; n<=Times; ++n) {
+				maxP2forP1(i+1,n) = maxP2forP1(i,n);
+				for(int a=0; a<=n; ++a) {
+					if( n-a>=0 && maxP2forP1(i,n-a)>=0 && C[i]-a*P1>=0 )
+						maxP2forP1(i+1,n) = max(maxP2forP1(i+1,n),
+							maxP2forP1(i,n-a) + min(Times-a,(C[i]-a*P1)/P2)
+						);
+				}
+			}
+		return maxP2forP1(C.size(), Times) >= Times;
+	}
+};
+
+// BEGIN CUT HERE
+#include <ctime>
+double start_time; string timer()
+ { ostringstream os; os << " (" << int((clock()-start_time)/CLOCKS_PER_SEC*1000) << " msec)"; return os.str(); }
+template<typename T> ostream& operator<<(ostream& os, const vector<T>& v)
+ { os << "{ ";
+   for(typename vector<T>::const_iterator it=v.begin(); it!=v.end(); ++it)
+   os << '\"' << *it << '\"' << (it+1==v.end() ? "" : ", "); os << " }"; return os; }
+void verify_case(const int& Expected, const int& Received) {
+ bool ok = (Expected == Received);
+ if(ok) cerr << "PASSED" << timer() << endl;  else { cerr << "FAILED" << timer() << endl;
+ cerr << "\to: \"" << Expected << '\"' << endl << "\tx: \"" << Received << '\"' << endl; } }
+#define CASE(N) {cerr << "Test Case #" << N << "..." << flush; start_time=clock();
+#define END	 verify_case(_, ColorfulCookie().getMaximum(cookies, P1, P2));}
+int main(){
+
+CASE(0)
+	int cookies_[] = {100, 100};
+	  vector <int> cookies(cookies_, cookies_+sizeof(cookies_)/sizeof(*cookies_)); 
+	int P1 = 50; 
+	int P2 = 50; 
+	int _ = 200; 
+END
+CASE(1)
+	int cookies_[] = {50, 250, 50};
+	  vector <int> cookies(cookies_, cookies_+sizeof(cookies_)/sizeof(*cookies_)); 
+	int P1 = 50; 
+	int P2 = 100; 
+	int _ = 300; 
+END
+CASE(2)
+	int cookies_[] = {2000};
+	  vector <int> cookies(cookies_, cookies_+sizeof(cookies_)/sizeof(*cookies_)); 
+	int P1 = 100; 
+	int P2 = 200; 
+	int _ = 0; 
+END
+CASE(3)
+	int cookies_[] = {123, 456, 789, 555};
+	  vector <int> cookies(cookies_, cookies_+sizeof(cookies_)/sizeof(*cookies_)); 
+	int P1 = 58; 
+	int P2 = 158; 
+	int _ = 1728; 
+END
+/*
+CASE(4)
+	int cookies_[] = ;
+	  vector <int> cookies(cookies_, cookies_+sizeof(cookies_)/sizeof(*cookies_)); 
+	int P1 = ; 
+	int P2 = ; 
+	int _ = ; 
+END
+CASE(5)
+	int cookies_[] = ;
+	  vector <int> cookies(cookies_, cookies_+sizeof(cookies_)/sizeof(*cookies_)); 
+	int P1 = ; 
+	int P2 = ; 
+	int _ = ; 
+END
+*/
+}
+// END CUT HERE

Index: lib/typical/dp.cpp
==================================================================
--- lib/typical/dp.cpp
+++ lib/typical/dp.cpp
@@ -10,11 +10,11 @@
 		{ return data[ (i1*N2)+i2 ]; }
 	void swap(DP2& rhs)
 		{ data.swap(rhs.data); }
 };
 
-// Tested: Codeforces #13 C
+// Tested: Codeforces #13 C, SRM 528 Lv2
 template<typename T>
 struct DP2x
 {
 	const int N1, N2;
 	vector<T> data;