"??" 其实就是一个广搜能解决的问题,但是!!!不知道为啥, 自己码了个广搜还总是WA12,看不到样例哎呀好气。 这个题其实应该在广搜基础上多想一步,根据题目,最后走出来的路肯定是:城镇 荒野 城镇 荒野,这样子,所以我们也不用判断走的每一步到底是啥,直接算总共多少步,然后ans/2是a,剩下的给 ...
分类:
其他好文 时间:
2019-12-12 01:22:23
阅读次数:
95
一道比较简单的容斥题(? 可以容斥一下, 设$i, j ,k$分别代表$i$行有颜色, $j$行有颜色, 出现$k$种颜色的方案数 $$ ans = \sum_{i=0}^n\sum_{j=0}^m\sum_{k=0}^c( 1)^{(i+j+k+n+m+c)}C_n^iC_m^jC_c^k(k+1 ...
分类:
Web程序 时间:
2019-12-12 01:15:39
阅读次数:
99
>> a=[1 2;3 4;5 6];>> b=ones(2,3)b = 1 1 1 1 1 1 >> a*b 矩阵的乘法ans = 3 3 3 7 7 7 11 11 11 ??>> c=ones(3,2)c = 1 1 1 1 1 1 >> a+c 矩阵的加法ans = 2 3 4 5 6 7 ...
分类:
其他好文 时间:
2019-12-11 21:59:04
阅读次数:
463
>> ones(2:3)ans = 1 1 1 1 1 1 >> 2*ones(2:3)ans = 2 2 2 2 2 2 >> rand(3,3) 产生0~1中的随机数ans = 0.359326 0.667090 0.241347 0.925524 0.999806 0.712061 0.464 ...
分类:
其他好文 时间:
2019-12-11 20:59:59
阅读次数:
126
1.礼物 先给你们来个简单点的。 http://hzoj.com/contest/220/problem/1 那么其实就是在求最小的: $$\begin{array}{rcl}ans&=&\sum\limits_{i=1}^{n}(x_i y_i+c)^2\\&=&\sum\limits_{i=1} ...
分类:
其他好文 时间:
2019-12-11 20:58:33
阅读次数:
163
1&&0 %AND 1 ||0 % OR octave:6> PS1('>> '); >> octave:1> 5+6 ans = 11 octave:2> 1==2 ans = 0 octave:3> 1==2 %false %XXX %为注释 ans = 0 octave:4> 1~=2 %表示 ...
分类:
其他好文 时间:
2019-12-10 20:57:25
阅读次数:
176
解题思路 考虑顺时针旋转 $i$ 步得到的结果,根据Burnside引理,有 $$ Ans=\frac{\sum\limits_{i=0}^{n 1}C(i)}{n} $$ $C(i)$ 为旋转 $i$ 步时不动点的数量。 实际上,旋转 $i$ 步得到的是 $\frac{n}{\gcd(n,i)}$ ...
分类:
其他好文 时间:
2019-12-09 17:07:00
阅读次数:
95
J组: T1: 没什么好说的。 code: #include <bits/stdc++.h> using namespace std; string s; int main(){ cin >> s ; int ans=0; for(int i=0; i<8; i++) if(s[i]=='1') a ...
分类:
其他好文 时间:
2019-12-08 15:51:26
阅读次数:
159
贪心 #include <iostream> #include<algorithm> #include<string.h> #include<set> using namespace std; const int maxn=100010; int ans[maxn]; int a[4]; void ...
分类:
其他好文 时间:
2019-12-07 17:57:19
阅读次数:
217
#include<iostream> using namespace std; const int MAX=2e5+10; int cnt[MAX]; int ans[MAX]; int a[MAX]; int main() { int n,m,zero=0,one=0; cin>>n>>m; fo ...
分类:
其他好文 时间:
2019-12-07 14:25:29
阅读次数:
93