题目意思是 :
给你一个n([1,17])表示有n个数据结构里的术语,然后n个对这些术语的定义,让你对这些术语和定义对号入座(相当于进行连线,A术语连A术语的定义)。然后一个
k([0,n]),问你至少前k个术语定义对应错的总共有多少种。
起先我也不怎么会,忘完了,后来看别人的题解,可能我语文真的不怎么好,不是很能理解,然后问的别人...然后xxx给我说我有写个题解的必要了 so.....
分类:
其他好文 时间:
2014-07-18 21:31:37
阅读次数:
180
题解:简单的NIM游戏,直接计算SG函数,至于找先手策略则按字典序异或掉,去除石子后再异或判断,若可行则直接输出。#include const int N=1005;int SG[N],b[N],hash[N],a[N],sum,tmp,i,j,n,m; void FSG(int s){ ...
分类:
其他好文 时间:
2014-07-18 21:09:31
阅读次数:
206
题解:正难则反,从总数中减去全部相邻不相同的数目就是答案,n*(n-1)^(m-1):第一个房间有n中染色方案,剩下m-1个房间均只有n-1种染色方案,用总数减就是答案。#include const int mod=100003; typedef long long LL; LL n,m; LL p...
分类:
其他好文 时间:
2014-07-18 20:20:40
阅读次数:
212
<!DOCTYPEhtmlPUBLIC"-//W3C//DTDXHTML1.0Transitional//EN""http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html><head><metahttp-equiv="Content-Type"content="text/html;charset=utf-8"/><title>prototype与jQuery冲突解决4<..
分类:
Web程序 时间:
2014-07-18 17:06:14
阅读次数:
224
题解:数据结构的基本操作,用STL可以完美实现,就是比较慢……#include #include #include #include #include const int MAXN=500005; const int INF=~0U>>1; using namespace std; ...
分类:
其他好文 时间:
2014-07-17 17:39:20
阅读次数:
193
解决ScrollView嵌套ViewPager出现的滑动冲突问题...
分类:
其他好文 时间:
2014-07-17 17:15:45
阅读次数:
260
题解:注意题目中规定取到最后一粒石子的人算输,所以是Anti-Nim游戏,胜负判断为:先手必胜: 1.所有堆的石子数都为1且游戏的SG值为0; 2.有些堆的石子数大于1且游戏的SG值不为0。#include int main(){ int t,n,s,x,tmp; scanf("%d...
分类:
其他好文 时间:
2014-07-17 11:09:17
阅读次数:
303
题解:直接使用STL中的hash去重即可#include #include using namespace std;int ans[50010];int main(){ int T,n,tmp; scanf("%d",&T); while(T--){ int cnt=...
分类:
其他好文 时间:
2014-07-17 10:02:58
阅读次数:
231
题解:简单博弈论#include int main(){ int n; while(scanf("%d",&n),n!=0) if (n&1) puts("Bob"); else puts("Alice"); return 0;}
分类:
其他好文 时间:
2014-07-17 10:01:29
阅读次数:
259
题解:鉴于二进制的思想来划分#include int main(){ int n,d=0;scanf("%d",&n); while(1<<d<=n)d++; printf("%d\n",d);}
分类:
其他好文 时间:
2014-07-17 09:58:59
阅读次数:
197