上一页 1 ··· 5 6 7 8 9
摘要: 1 void reverse( string &s ){ 2 int n = s.size(); 3 for(int i = 0 ; i < n/2 ; i++ )//这个循环走了n/2次,所以O(n) 4 swap( s[i] , s[n-1-i] ); 5 } 1 int count = 1; 阅读全文
posted @ 2019-08-08 21:22 acwarming 阅读(179) 评论(0) 推荐(0) 编辑
摘要: 首先理解sg函数必须先理解mex函数 mex是求除它集合内的最小大于等于0的整数,例:mex{1,2}=0;mex{2}=0;mex{0,1,2}=3;mex{0,5}=1。 而sg函数是啥呢? 对于任意状态 x , 定义 sg(x) = mex(f),其中f 是 x 后继状态的sg函数值的集合(就 阅读全文
posted @ 2019-08-08 12:37 acwarming 阅读(780) 评论(0) 推荐(0) 编辑
摘要: string 操作: 1 =,assign() //赋以新值 2 s.assign(str); 3 s.assign(str,1,3);//如果str是”iamangel” 就是把”ama”赋给字符串 4 s.assign(str,2,string::npos);//把字符串str从索引值2开始到结 阅读全文
posted @ 2019-08-07 21:28 acwarming 阅读(151) 评论(0) 推荐(0) 编辑
摘要: 1 #include<bits/stdc++.h> 2 #define ll long long 3 #define ull unsigned long long 4 #define INF 0x3f3f3f3f 5 #define eps 1e-8 6 #define PI acos(-1.0) 阅读全文
posted @ 2019-08-07 21:00 acwarming 阅读(163) 评论(0) 推荐(0) 编辑
上一页 1 ··· 5 6 7 8 9