青青草原综合久久大伊人导航_色综合久久天天综合_日日噜噜夜夜狠狠久久丁香五月_热久久这里只有精品

2010年5月12日

網絡編程小例

     摘要: //server.c  1#include <stdlib.h> 2#include <stdio.h> 3#include <errno.h> 4#include <string.h> 5#include <unistd.h> ...  閱讀全文
posted @ 2010-05-12 10:01 zhongguoa 閱讀(353) | 評論 (0)編輯 收藏
2008年12月2日

連堆都不會用

心煩
posted @ 2008-12-02 08:12 zhongguoa 閱讀(251) | 評論 (0)編輯 收藏
2008年8月28日

旋轉卡殼

轉得老子的腦殼子都卡住了
posted @ 2008-08-28 05:57 zhongguoa 閱讀(543) | 評論 (0)編輯 收藏
2008年7月30日

終于明白了凸包

明天再看看具體的代碼怎么寫
posted @ 2008-07-30 02:35 zhongguoa 閱讀(345) | 評論 (1)編輯 收藏
2008年5月10日

pku1032關于數論的一個結論

把自然數N分解成若干個互不相同的正整數,使乘積最大;

由于這種分解的數目是有限的,所以最大積存在;

假設最大積的分解為

n=a1+a2+a3+...+a[t-2]+a[t-1]+a[t]

(a1<a2<a3<...<a[t-2]<a[t-1]<a[t])

Now, from the five rules above, we could make the mutiple maximum.

to an N, find the integer k, fits

A=2+3+4+...+(k-1)+k <= N < A+(k+1)=B

Suppose N = A + p, (0 <= p < k+1)

1) p=0, then answer is Set A

2) 1<=p<=k-1 then answer is Set B - { k+1-p }

3) p=k, then answer is Set A - {2} + {k+2}
posted @ 2008-05-10 13:45 zhongguoa 閱讀(484) | 評論 (0)編輯 收藏
2008年5月8日

itoa

功 能: 把一整數轉換為字符串
用 法: char *itoa(int value, char *string, int radix);
詳細解釋:itoa是英文integer to string a(將整形數轉化為一個字符串,并將值保存在a中)
的縮寫.其中value為要轉化的整數, radix是基數的意思,即先將value轉化為幾進制的數,之后在保存在a 中.
作用:實現數制之間的轉化
比較:ltoa,其中l是long integer(長整形數)
備注:該函數的頭文件是"stdlib.h"        
程序例:
#include <stdlib.h>
#include <stdio.h>
int main(){
    int number = 123456;
    char string[25];
    itoa(number, string, 10);
    printf("integer = %d string = %s\n", number, string);
    return 0;   
}
posted @ 2008-05-08 20:48 zhongguoa 閱讀(1149) | 評論 (0)編輯 收藏
2008年4月10日

并查集的模板



#include<iostream>
using namespace std;

int pre[110],rank[110],n;
int find(int x){
    
int r=x;
    
while(pre[r]!=-1)
        r
=pre[r];
    
while(x!=r){
        
int q=pre[x];
        pre[x]
=r;
        x
=q;
    }

    
return r;
}

void unionone(int a,int b){
    
int t1=find(a);
    
int t2=find(b);
    
if(rank[t1]>rank[t2])
        pre[t2]
=t1;
    
else
        pre[t1]
=t2;
    
if(rank[t1]==rank[t2])
        rank[t2]
++;
    n
--;
}

int main(){
    
int m,i,begin,end;
    
while(1){
        scanf(
"%d""%d",&n,&m);
        
if(n==0&&m==0)
            
break;
        
for(i=0;i<=n;i++){
            rank[i]
=0;
            pre[i]
=-1;
        }

        
for(i=0;i<m;i++){
            scanf(
"%d""%d",&begin,&end);
            
if(find(begin)!=find(end))
                unionone(begin,end);
        }

        printf(
"%d\n",n-1);
    }

    
return 0;
}

posted @ 2008-04-10 23:28 zhongguoa 閱讀(313) | 評論 (0)編輯 收藏
2008年4月9日

歸并求逆序數模板,pku 2299 Ultra-QuickSort,注意long long

#include <stdio.h>
#define MAXN 500000

int height[MAXN+1],temp[MAXN+1];
__int64 sum;

void merge(int *a,int l,int mid,int r) {
    
int i,j,k;
    i
=0,j=l,k=mid;
    
while(j<mid &&<r)    {
        
if(a[j]>a[k]) {
            sum 
+= mid-j;
            temp[i
++= a[k++];
        }

        
else temp[i++= a[j++];
    }

    
while(j<mid)        
        temp[i
++= a[j++];
    
while(k<r)            
        temp[i
++= a[k++];
    
for(i=0; i<r-l; i++) a[l+i] = temp[i];
}

void divide(int *a,int l,int r) {
    
if(l+1<r) {
        
int mid = (l+r)>>1;
        divide(a,l,mid);
        divide(a,mid,r);
        merge(a,l,mid,r);
    }

}


int main() {
    
int n,i;
    
while(scanf("%d",&n)&&n) {
        
for(i=sum=0; i<n; i++) scanf("%d",&height[i]);
        divide(height,
0,n);
        printf(
"%I64d\n",sum);
    }

}
posted @ 2008-04-09 12:54 zhongguoa 閱讀(604) | 評論 (0)編輯 收藏
2008年4月8日

最小公共子序列

Longest Common Subsequence

Problem

Given a sequence A = < a1, a2, ..., am >, let sequence B = < b1, b2, ..., bk > be a subsequence of A if there exists a strictly increasing sequence ( i1<i2<i3 ..., ik ) of indices of A such that for all j = 1,2,...,k, aij = bj. For example, B = < a, b, c, d > is a subsequence of A= < a, b, c, f, d, c > with index sequence < 1, 2, 3 ,5 >.
Given two sequences X and Y, you need to find the length of the longest common subsequence of X and Y.

Input

The input may contain several test cases.

The first line of each test case contains two integers N (the length of X) and M(the length of Y), The second line contains the sequence X, the third line contains the sequence Y, X and Y will be composed only from lowercase letters. (1<=N, M<=100)

Input is terminated by EOF.

Output

Output the length of the longest common subsequence of X and Y on a single line for each test case.

Sample input

6 4
abcfdc
abcd
2 2
ab
cd

Sample output

4
0

#include <stdio.h>
char x[105],y[105];
int c[109][109],i,j,leny,lenx;
int main(){
    
while(scanf("%d %d",&lenx,&leny)!=EOF){
        scanf(
"%s",&x);
        scanf(
"%s",&y);
        
for(i=0;i<=leny;i++)
            c[
0][i]=0;
        
for(i=1;i<=lenx;i++)
            c[i][
0]=0;
        
for(i=1;i<=lenx;i++){
            
for(j=1;j<=leny;j++){
                
if(x[i-1]==y[j-1])
                    c[i][j]
=c[i-1][j-1]+1;
                
else{
                    
if(c[i-1][j]>=c[i][j-1])
                        c[i][j]
=c[i-1][j];
                    
else c[i][j]=c[i][j-1];
                }

            }

        }

        printf(
"%d\n",c[lenx][leny]);
    }

    
return 0;
}

posted @ 2008-04-08 13:27 zhongguoa 閱讀(494) | 評論 (0)編輯 收藏

最大公約數函數gcd(int a,int b)的構造和ax=b (mod n) 的解

Problem

Give you a modular equation ax=b (mod n). Count how many different x (0<=x<n) satisfying the equation.

Input

The input may contain several test cases.

Each test contains a line with three integers a, b and n, each integer is positive and no more than 10^9.

Input is terminated by EOF.

Output

For each test case, output a line containing the number of solutions.

Sample input

4 2 6

Sample output

2

#include <stdio.h>
long a,b,n;
int gcd(long a,long b){
    
if(a==0){
        
return b;
    }

    
else
    
{
        
return gcd(b%a,a);
    }

}

int main(){
    
while(scanf("%d %d %d",&a,&b,&n)!=EOF){
        
long d=gcd(a,n);
        
if(b%d==0)
            printf(
"%d\n",d);
        
else printf("0\n",d);
    }

    
return 0;
}
posted @ 2008-04-08 12:53 zhongguoa 閱讀(1105) | 評論 (1)編輯 收藏
僅列出標題  下一頁
青青草原综合久久大伊人导航_色综合久久天天综合_日日噜噜夜夜狠狠久久丁香五月_热久久这里只有精品
  • <ins id="pjuwb"></ins>
    <blockquote id="pjuwb"><pre id="pjuwb"></pre></blockquote>
    <noscript id="pjuwb"></noscript>
          <sup id="pjuwb"><pre id="pjuwb"></pre></sup>
            <dd id="pjuwb"></dd>
            <abbr id="pjuwb"></abbr>
            亚洲国产日韩欧美在线动漫| 影视先锋久久| 亚洲视频你懂的| 亚洲精品在线一区二区| 91久久综合亚洲鲁鲁五月天| 久久蜜臀精品av| 欧美精品二区三区四区免费看视频| 欧美大片va欧美在线播放| 久久久久久欧美| 欧美va亚洲va香蕉在线| 亚洲三级毛片| 亚洲欧美国产高清| 久久青草欧美一区二区三区| 久久综合网hezyo| 欧美日韩中文字幕日韩欧美| 国产精品毛片在线看| 国产亚洲精品福利| 亚洲精品久久久久中文字幕欢迎你| 中文欧美日韩| 国产亚洲va综合人人澡精品| 激情伊人五月天久久综合| 亚洲精品女av网站| 亚洲欧美日韩一区二区| 久久先锋资源| 一区二区免费在线视频| 欧美伊人影院| 欧美另类videos死尸| 国产日韩亚洲| 亚洲作爱视频| 久久琪琪电影院| 亚洲欧美日韩在线播放| 久久精品视频导航| 欧美日韩一二三四五区| 美国三级日本三级久久99| 欧美激情视频一区二区三区在线播放 | 国产精品亚洲综合| 欧美激情精品久久久久| 欧美午夜在线一二页| 在线观看欧美日本| 国产亚洲一区在线播放| 亚洲精品影视在线观看| 久久不射中文字幕| 亚洲视频免费看| 欧美日韩国产欧美日美国产精品| 欧美va天堂| 国产亚洲欧美一区二区| 国产日韩欧美一区二区三区四区| 国产精品日韩在线| 亚洲乱码日产精品bd| 老司机免费视频久久| 欧美成人免费网| 亚洲欧美视频在线观看视频| 欧美日韩国产在线播放| 国产精品久久久久久久久免费樱桃| 欧美高清视频在线播放| 国内精品久久久久久 | 亚洲日韩欧美视频| 久久精品一区二区国产| 国产欧美一区视频| 亚洲综合欧美| 日韩一级欧洲| 欧美日韩精品伦理作品在线免费观看| 欧美日韩国产成人精品| 国产欧美日韩免费| 激情久久一区| 久久精品国产久精国产一老狼| 久久久国产91| 最新成人在线| 国产精品99久久久久久宅男| 久久狠狠亚洲综合| 亚洲欧洲av一区二区| 国产午夜精品久久久| 久久久精品性| 久久久999精品视频| 国产在线欧美日韩| 欧美成人免费小视频| 一区二区高清在线观看| 欧美亚洲视频在线观看| 国产午夜精品在线| 欧美成年人视频网站欧美| 欧美不卡视频| 亚洲一区二区在线看| 男人天堂欧美日韩| 免费不卡中文字幕视频| 夜色激情一区二区| 亚洲欧美99| 在线看日韩欧美| 日韩午夜电影| 狠狠入ady亚洲精品| 亚洲国产欧美一区二区三区久久| 亚洲欧美日本视频在线观看| 国产揄拍国内精品对白| 欧美国产视频一区二区| 欧美日韩国产不卡| 久久精品国产77777蜜臀| 麻豆91精品| 亚欧美中日韩视频| 欧美岛国在线观看| 欧美一区=区| 欧美成人影音| 久久久久久久综合狠狠综合| 免费成人黄色片| 欧美在线精品一区| 欧美理论电影在线播放| 亚洲青色在线| 午夜久久黄色| 亚洲一区欧美| 欧美激情中文不卡| 久久青草欧美一区二区三区| 欧美人妖另类| 欧美一级淫片播放口| 亚洲伦理自拍| 久久久美女艺术照精彩视频福利播放 | 亚洲国产色一区| 亚洲一级黄色片| 亚洲日本成人在线观看| 欧美在线一二三区| 国产精品自在欧美一区| 欧美大胆人体视频| 国产一区二区三区视频在线观看 | 鲁大师成人一区二区三区| 亚洲免费网址| 欧美精品一区二区在线播放| 美女精品网站| 国产午夜精品一区二区三区欧美 | 亚洲国产欧美在线人成| 欧美视频手机在线| 亚洲国产小视频在线观看| 国产自产2019最新不卡| 亚洲一区在线免费观看| 中文精品视频| 欧美日一区二区三区在线观看国产免| 亚洲天堂免费观看| 亚洲午夜电影| 日韩视频久久| 欧美高清视频| 亚洲精品一区中文| av成人免费在线| 欧美精品一区二区三| 亚洲国产一区二区三区a毛片| 欧美日本一道本在线视频| 另类尿喷潮videofree| 好男人免费精品视频| 性久久久久久久| 久久久久久久综合狠狠综合| 国产在线不卡| 久久综合激情| 亚洲第一福利在线观看| 亚洲精品国久久99热| 欧美激情bt| 一区二区三区你懂的| 国内视频一区| 亚洲毛片在线观看| 国产视频亚洲精品| 欧美一级片一区| 亚洲剧情一区二区| 欧美精品免费播放| 一本色道久久综合亚洲91| 亚洲欧美日韩精品一区二区| 国产精品入口尤物| 久久久久国产精品麻豆ai换脸| 亚洲另类在线一区| 欧美精品在线一区二区| 一区二区久久久久| 久久人人超碰| 99国产精品国产精品久久| 国产精品久久久久久久一区探花 | 亚洲女优在线| 国产精品永久入口久久久| 久久久久久久综合| 欧美亚洲三区| 国产亚洲欧美另类中文| 一本久久综合亚洲鲁鲁| 午夜精品视频在线| 伊人婷婷久久| 欧美新色视频| 老司机午夜精品视频| 在线性视频日韩欧美| 亚洲作爱视频| 美国十次成人| 一级成人国产| 欧美成人高清视频| 午夜在线成人av| 亚洲美女视频| 好看的日韩视频| 国产精品综合久久久| 欧美激情精品久久久久久黑人| 欧美国产日韩一二三区| 在线观看日韩精品| 老妇喷水一区二区三区| 欧美日韩中文字幕在线| 亚洲福利久久| 欧美在线资源| 亚洲免费视频一区二区| 国产精品久久久久久亚洲调教| 亚洲美女网站| 另类av导航| 久久夜色精品国产| 欧美一区二区三区播放老司机| 国产毛片精品视频|