摘要:题目: 这个题最后一个数据没有通过 ,先这样吧,过几天应该有题解,到时候在完善一下。。。
阅读全文
摘要:题目: 思路 方法一:判断字符串的每一个子串,若是对称的,则求出它的长度即可。这种办法对每一个子串,从两头向中间判断是不是子串。总的时间复杂度为O(n^3), 下面给出时间复杂度是O(n^2)的思路。 方法二:与方法一正好相反,字符串中的每一个开始,向两边扩展,此时可分为两种情况: (1)对称子串长
阅读全文
摘要:复数运算规则: 乘法法则规则: 规定复数的乘法按照以下的法则进行: 设z1=a+bi,z2=c+di(a、b、c、d∈R)是任意两个复数,那么它们的积(a+bi)(c+di)=(ac-bd)+(bc+ad)i. 其实就是把两个复数相乘,类似两个多项式相乘,展开得:ac+adi+bci+bdi^2,因
阅读全文
摘要:传送门 :安慰奶牛 1 #include<iostream> 2 #include<cstdio> 3 #include<algorithm> 4 #include<cstdlib> 5 6 using namespace std; 7 8 struct node{ 9 int x,y,w; 10
阅读全文
摘要:1 //求从(sx.sy)到(gx.gy)的最短距离; 2 3 #include<iostream> 4 #include<cstdio> 5 #include<cstdio> 6 #include<queue> 7 #include<cstring> 8 #define INF 99999999
阅读全文
摘要:1 #include<iostream> 2 #include<cstring> 3 #include<cstdio> 4 #include<queue> 5 #define MAX 9999999 6 7 using namespace std; 8 9 struct node { 10 int
阅读全文
摘要:1 #include 2 #include 3 #include 4 using namespace std; 5 int main() 6 { 7 int str[2000],tmp[2000]; 8 int n,q,l,r,j; 9 while(~scanf("%d%d...
阅读全文
摘要:1 #include 2 #include 3 #include 4 #include 5 using namespace std; 6 const char s2[15] ="Successful"; 7 const char s3[15] ="Failed"; 8 int main() 9 {...
阅读全文
摘要:1 #include<cstdio> 2 #include<cstring> 3 #include<queue> 4 #include<iostream> 5 #include<algorithm> 6 #include<cmath> 7 using namespace std; 8 #define
阅读全文
摘要:1 #include 2 #include 3 #include 4 #include 5 using namespace std; 6 7 int s[100][100]; 8 int dp[100][100]; 9 int max(int a,int b)10 {11 if(...
阅读全文
摘要:1 #include 2 #include 3 #include 4 using namespace std; 5 struct node{ 6 int g,p; 7 double ave; 8 } s[10010]; 9 10 int main()11 {12 int n...
阅读全文
摘要:1 #include 2 #include 3 #include 4 using namespace std; 5 char s[20]; 6 const char s1[11]={'1','0','x','9','8','7','6','5','4','3','2'}; 7 const int ...
阅读全文
摘要:1 #include 2 #include 3 #include 4 using namespace std; 5 long long sum=0; 6 void print_permutation(int n,int s,int *a,int cur);//n为输出的,s为元素个数,a为数组,c...
阅读全文
摘要:1 #include 2 #include 3 #include 4 #include 5 using namespace std; 6 const int maxn=150; 7 const int mod=1000000007; 8 int dp[maxn][maxn]; 9 10 i...
阅读全文
摘要:1 #include 2 using namespace std; 3 int main() 4 { 5 6 char c; 7 int a,b; 8 scanf("%c%d%d",&c,&a,&b); 9 if(c=='+')10 pr...
阅读全文
摘要:1 #include 2 #include 3 #include 4 using namespace std; 5 int main() 6 { 7 int a[1010],b[1010]; 8 int n,m,l,r,k,i,j; 9 while(~scanf("%d",...
阅读全文
摘要:1 #include 2 #include 3 using namespace std; 4 int main() 5 { 6 7 long long ans,n; 8 while(~scanf("%lld",&n)) 9 {10 if(n=n-3。别人的...
阅读全文
摘要:1 #include 2 #include 3 #include 4 #include 5 #include 6 using namespace std; 7 map s0,s1; 8 char str0[90],str1[90]; 9 10 void zh(char str0[],in...
阅读全文
摘要:1 #include 2 #include 3 #include 4 #include 5 using namespace std; 6 7 char str[100010]; 8 int a[5000000]; 9 10 int main()11 {12 int i,k,j,n...
阅读全文