Differences From Artifact [ae16b2462960bb78]:
- File
lib/typical/dp.cpp
- 2011-10-04 17:30:15 - part of checkin [a01c3ec3ed] on branch trunk - 520 library update (user: kinaba) [annotate]
To Artifact [feb5fdb1e50b8e31]:
- File
lib/typical/dp.cpp
- 2011-12-29 06:57:30 - part of checkin [3d2bcff745] on branch trunk - 528 (user: kinaba) [annotate]
8 8 : N1(N1), N2(N2), data(N1*N2, t) { assert(data.size()*sizeof(T)<(1<<26)); }
9 9 T& operator()(int i1, int i2)
10 10 { return data[ (i1*N2)+i2 ]; }
11 11 void swap(DP2& rhs)
12 12 { data.swap(rhs.data); }
13 13 };
14 14
15 -// Tested: Codeforces #13 C
15 +// Tested: Codeforces #13 C, SRM 528 Lv2
16 16 template<typename T>
17 17 struct DP2x
18 18 {
19 19 const int N1, N2;
20 20 vector<T> data;
21 21 DP2x(int, int N2, const T& t = T())
22 22 : N1(2), N2(N2), data(N1*N2, t) { assert(data.size()*sizeof(T)<(1<<26)); }