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

網(wǎng)絡(luò)編程小例

     摘要: //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) | 評(píng)論 (0)編輯 收藏

連堆都不會(huì)用

心煩
posted @ 2008-12-02 08:12 zhongguoa 閱讀(251) | 評(píng)論 (0)編輯 收藏

旋轉(zhuǎn)卡殼

轉(zhuǎn)得老子的腦殼子都卡住了
posted @ 2008-08-28 05:57 zhongguoa 閱讀(543) | 評(píng)論 (0)編輯 收藏

終于明白了凸包

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

pku1032關(guān)于數(shù)論的一個(gè)結(jié)論

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

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

假設(shè)最大積的分解為

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) | 評(píng)論 (0)編輯 收藏

itoa

功 能: 把一整數(shù)轉(zhuǎn)換為字符串
用 法: char *itoa(int value, char *string, int radix);
詳細(xì)解釋:itoa是英文integer to string a(將整形數(shù)轉(zhuǎn)化為一個(gè)字符串,并將值保存在a中)
的縮寫.其中value為要轉(zhuǎn)化的整數(shù), radix是基數(shù)的意思,即先將value轉(zhuǎn)化為幾進(jìn)制的數(shù),之后在保存在a 中.
作用:實(shí)現(xiàn)數(shù)制之間的轉(zhuǎn)化
比較:ltoa,其中l(wèi)是long integer(長(zhǎng)整形數(shù))
備注:該函數(shù)的頭文件是"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) | 評(píng)論 (0)編輯 收藏

并查集的模板



#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) | 評(píng)論 (0)編輯 收藏

歸并求逆序數(shù)模板,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) | 評(píng)論 (0)編輯 收藏

最小公共子序列

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) | 評(píng)論 (0)編輯 收藏

最大公約數(shù)函數(shù)gcd(int a,int b)的構(gòu)造和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 閱讀(1104) | 評(píng)論 (1)編輯 收藏
僅列出標(biāo)題
共2頁(yè): 1 2 
青青草原综合久久大伊人导航_色综合久久天天综合_日日噜噜夜夜狠狠久久丁香五月_热久久这里只有精品
  • <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>
            国产精品香蕉在线观看| 欧美亚洲日本网站| 久久久99久久精品女同性| 亚洲全黄一级网站| 久久综合色一综合色88| 欧美一级视频精品观看| 亚洲一级在线观看| 亚洲精品一区二区三区四区高清 | 一区二区三区视频在线| 欧美激情一区在线观看| 欧美成人资源| 亚洲第一在线| 一区二区久久久久| 黄色另类av| 亚洲大片免费看| 最新成人在线| 亚洲欧美美女| 免费精品99久久国产综合精品| 欧美顶级少妇做爰| 亚洲精品永久免费| 午夜亚洲性色视频| 欧美成人精品不卡视频在线观看| 欧美精品一区二区三区蜜臀| 欧美性色综合| 好吊视频一区二区三区四区| 亚洲视频www| 欧美成人高清视频| 亚洲小说区图片区| 欧美激情aⅴ一区二区三区| 国产日产欧美a一级在线| 亚洲免费观看| 免费不卡在线观看| 亚洲欧美一区二区三区极速播放 | 欧美日韩一区在线观看视频| 国产欧美日韩精品丝袜高跟鞋| 日韩天堂av| 亚洲日本电影| 欧美精品九九99久久| 亚洲大胆在线| 久久综合一区二区| 久久综合给合| 亚洲国产影院| 亚洲高清影视| 免费在线观看成人av| 久久精品在这里| 在线精品视频免费观看| 牛夜精品久久久久久久99黑人| 久久er精品视频| 在线播放中文字幕一区| 蜜臀a∨国产成人精品| 性做久久久久久久久| 国产午夜亚洲精品不卡| 久久躁狠狠躁夜夜爽| 久久综合九色综合欧美就去吻| 亚洲国产日韩一区| 99天天综合性| 激情小说亚洲一区| 亚洲电影在线看| 国产精品入口麻豆原神| 久久男女视频| 欧美系列亚洲系列| 久久综合久久综合这里只有精品 | 亚洲一区综合| 国产亚洲一级高清| 日韩一区二区精品| 91久久精品日日躁夜夜躁国产| 一本色道久久综合亚洲精品婷婷| 国产视频一区二区在线观看 | 亚洲免费观看高清完整版在线观看熊| 国产精品激情电影| 亚洲第一视频网站| 韩国av一区二区三区四区| 日韩一区二区福利| 午夜亚洲性色福利视频| 一本在线高清不卡dvd | 亚洲欧洲久久| 国内精品久久久久久| 亚洲私人黄色宅男| 亚洲视频1区2区| 欧美吻胸吃奶大尺度电影| 欧美xxx成人| 亚洲国产精品v| 久久―日本道色综合久久| 久久久久9999亚洲精品| 国产老女人精品毛片久久| 一区二区三区视频在线| 亚洲欧美日韩一区| 国产精品大片wwwwww| 亚洲视频axxx| 久久亚洲精品网站| 亚洲另类黄色| 国产精品女同互慰在线看| 亚洲欧美一区二区三区久久 | 麻豆成人小视频| 精品av久久久久电影| 蜜臀av在线播放一区二区三区| 欧美韩日精品| 午夜精品一区二区三区在线播放 | 欧美激情一区二区三区| 一本色道久久综合亚洲91| 欧美午夜激情在线| 亚洲香蕉在线观看| 亚洲高清在线播放| 欧美日韩另类国产亚洲欧美一级| 亚洲国产欧美一区二区三区同亚洲| 日韩一级成人av| 国产亚洲精品高潮| 欧美三级资源在线| 久久久噜噜噜| 欧美一区观看| 欧美亚洲一级| 欧美与黑人午夜性猛交久久久| 禁久久精品乱码| 国产精品自拍网站| 国产精品久久久久久久久果冻传媒| 久久久蜜臀国产一区二区| 中文在线资源观看网站视频免费不卡 | 亚洲综合国产| 亚洲电影自拍| 国产日韩一区二区三区在线| 久热精品视频在线观看| 国产精品影片在线观看| 亚洲欧洲综合| 亚洲国产精品一区二区第四页av | 美腿丝袜亚洲色图| 中文亚洲免费| 中文欧美日韩| 亚洲一区二区三区精品在线| 亚洲无亚洲人成网站77777| 亚洲精品影视| 亚洲欧美日本另类| 久久青青草综合| 亚洲第一成人在线| 久热国产精品| 亚洲日本aⅴ片在线观看香蕉| 在线观看亚洲精品视频| 亚洲第一在线视频| 夜色激情一区二区| 国产精品99久久久久久久久| 在线中文字幕一区| 久久久久免费| 亚洲欧洲美洲综合色网| 亚洲在线播放电影| 免费成年人欧美视频| 欧美日韩久久精品| 国产亚洲欧洲一区高清在线观看| 在线欧美不卡| 久久国产精品电影| 日韩一二三区视频| 欧美成人精品h版在线观看| 国产精品成人一区二区三区夜夜夜| 国产一区二区黄色| 99在线视频精品| 老司机午夜免费精品视频| 亚洲一区二区三区视频| 你懂的视频欧美| 在线精品视频在线观看高清 | 99精品久久免费看蜜臀剧情介绍| 亚洲特黄一级片| 欧美精品七区| 一区二区三区产品免费精品久久75 | 美日韩精品视频免费看| 久久精品国产清自在天天线| 国产麻豆精品在线观看| 亚欧美中日韩视频| 午夜亚洲精品| 亚洲国产成人高清精品| 亚洲高清免费| 欧美日韩综合久久| 性欧美长视频| 久久久999成人| 99精品热视频只有精品10| 亚洲激情国产精品| 亚洲国产精品久久久久秋霞影院 | 一区二区三区高清视频在线观看| 欧美日韩在线播| 久久综合狠狠综合久久综青草 | 欧美国产高潮xxxx1819| 欧美精品自拍| 久久激五月天综合精品| 欧美精品一区二区三区一线天视频 | 日韩午夜视频在线观看| 亚洲午夜久久久久久久久电影网| 国产伦精品一区二区三区视频孕妇| 久久精品免费电影| 欧美日韩国内自拍| 欧美中文字幕在线播放| 欧美久久久久久久久久| 久久久www成人免费精品| 欧美精品日日鲁夜夜添| 玖玖国产精品视频| 国产日韩欧美二区| 亚洲一区二区三区国产| av成人福利| 欧美日本簧片| 99天天综合性| 午夜激情一区| 黑丝一区二区三区| 欧美一区二区三区四区夜夜大片 | 欧美一区不卡|