09 2012 档案

SRM 556 DIV2
摘要:1、我去,这个竟然是前两天百度的面试题,不是最优就挂掉,看来面试官也在网上搜新题啊。#include <iostream>#include <queue>#include <algorithm>#include <vector>using namespace std;class ChocolateBar {public: int maxLength(string letters) { int res = 0; vector<int> last(256,-1); int l_size = letters.size(); int cur. 阅读全文

posted @ 2012-09-30 16:07 kakamilan 阅读(206) 评论(0) 推荐(0)

螺旋输出N*N矩阵
摘要:1 #include <iostream> 2 #include <vector> 3 using namespace std; 4 int main() { 5 int x[] = { 0, 1, 0, -1 }; 6 int y[] = { 1, 0, -1, 0 }; 7 int n; 8 int pos_x = 0; 9 int pos_y = 0;10 cin >> n;11 int counter = 1;12 vector<vector<int> > A(n, vector<int>(n, 0));13 i. 阅读全文

posted @ 2012-09-20 21:30 kakamilan 阅读(341) 评论(0) 推荐(0)

SRM 555 DIV2
摘要:第一次做出来第二道题,真不容易啊第一道题比较水,穷举各种情况就可以了 1 #include <iostream> 2 #include <string> 3 #include <vector> 4 #include <cstdlib> 5 #include <cmath> 6 #include <map> 7 #include <algorithm> 8 #include <list> 9 #include <ctime> 10 #include <set> 11 #incl 阅读全文

posted @ 2012-09-08 23:43 kakamilan 阅读(185) 评论(0) 推荐(0)

导航