思路要开阔些,或者说要转化一下思路,别太死 把每一个点当拐点,爆一边就能够。用记忆化搜索也行。都不会超时 #include<bits/stdc++.h> using namespace std; int n; #define o ans=max(ans, char C[105][105]; int ...
分类:
其他好文 时间:
2017-06-05 00:23:10
阅读次数:
245
The Hamming distance between two integers is the number of positions at which the corresponding bits are different. Given two integers x and y, calcul ...
分类:
其他好文 时间:
2017-06-04 20:05:48
阅读次数:
160
2017 计蒜之道 初赛 第四场 rank 178 题解 1A 1 #include <bits/stdc++.h> 2 using namespace std; 3 int n,m,k,v[110][110]; 4 void setrow(int c) 5 { 6 for(int j=1;j<=m ...
分类:
其他好文 时间:
2017-06-04 09:46:08
阅读次数:
274
题意:给定一个字符串,求有多少种树与之对应,对应方式是,每次遍历左节点,没有了,就回溯; 分析:d[i,j] = sum(d[i+1,k-1],d[k,j]) (str[i]==str[k]); 坑点是数组竟然要long long 不然会超时,神奇; 1 #include <bits/stdc++. ...
分类:
其他好文 时间:
2017-06-03 18:16:59
阅读次数:
238
看一下bits/stl_map和bits/stl_set能够看到map和set的定义例如以下: 84 template <typename _Key, typename _Tp, typename _Compare = std::less<_Key>, 85 typename _Alloc = st ...
分类:
系统相关 时间:
2017-06-03 09:54:38
阅读次数:
189
A. 每条人行道有六条车道会撞到。 #include<bits/stdc++.h> using namespace std; int a[4],b[4],c[4],d[4]; int main() { ios::sync_with_stdio(0); for(int i = 0;i < 4;i++) ...
分类:
其他好文 时间:
2017-06-03 09:53:19
阅读次数:
132
题目链接:hiho1080 直接看代码吧,两个标记分开处理 1 #include<bits/stdc++.h> 2 using namespace std; 3 #define ll long long 4 #define mod 1000000007 5 #define pi (4*atan(1. ...
分类:
其他好文 时间:
2017-06-02 15:40:23
阅读次数:
176
A. Sagheer and Crossroads 枚举 #include <bits/stdc++.h> using namespace std; typedef long long int LL; const int MAXN = 100005; int n; int a[4][4]; int ...
分类:
其他好文 时间:
2017-06-02 14:46:48
阅读次数:
168
题目链接 题面有点长需耐心读题。 A.一个人行道上的人被撞有4种情况 1.所在车道有车驶出 2.右边车道有左转车 3.左边车道有右转车 4.对面车道有直行车 #include <bits/stdc++.h> #define rep(i, j, k) for(int i = j;i <= k;i ++ ...
分类:
其他好文 时间:
2017-06-02 13:27:47
阅读次数:
179
DES 支持8位加密解密,3Des支持24位,Aes支持32位。3Des是Des算法做三次。位数的单位是字节byte。不是bits。 3Des是把24位分成3组。第一组八位用来加密,第二组8位用于解密,第三组8位用于加密,所以。假设秘钥为123456781234567812345678(3组1-8) ...
分类:
移动开发 时间:
2017-06-02 11:41:16
阅读次数:
272