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

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>
            久久精品中文字幕免费mv| 夜夜嗨av一区二区三区四季av | 免费久久99精品国产自| 欧美一区二区三区免费看| 国产亚洲成av人在线观看导航 | 亚洲电影有码| 你懂的视频一区二区| 亚洲精品中文在线| 一区二区三区国产| 国产欧美一区二区精品性色| 久久午夜激情| 欧美精品二区| 欧美亚洲午夜视频在线观看| 久久久久国产精品一区| 亚洲九九爱视频| 午夜精品久久久久久久99樱桃 | 亚洲欧美一区二区精品久久久| 亚洲欧美视频在线观看视频| 伊人精品在线| 一区二区电影免费观看| 国产一区三区三区| 亚洲日本电影| 国产一区二区丝袜高跟鞋图片 | 亚洲国产另类久久久精品极度| 欧美色视频在线| 狼人天天伊人久久| 欧美午夜电影在线观看| 免费一级欧美片在线观看| 欧美午夜无遮挡| 欧美高清在线精品一区| 国产噜噜噜噜噜久久久久久久久| 亚洲国产成人精品久久| 国产一区二区三区直播精品电影| 亚洲人成小说网站色在线| 国产日韩欧美综合精品| 一区二区三区黄色| 日韩视频中文字幕| 久久免费国产| 久久精品二区亚洲w码| 欧美日韩一区二区三区高清| 免费观看日韩| 国内精品久久久久久| 亚洲午夜91| 中文日韩电影网站| 欧美大片网址| 欧美激情第五页| 国模精品一区二区三区| 亚洲欧美日韩区| 亚洲欧美日韩专区| 欧美日韩在线一区二区三区| 亚洲激情校园春色| 亚洲人午夜精品免费| 久久久综合网站| 久久免费99精品久久久久久| 国产欧美一区二区精品秋霞影院| 一区二区三区日韩精品视频| 正在播放亚洲| 欧美丝袜一区二区| 一区二区三区三区在线| 中文在线资源观看网站视频免费不卡 | 亚洲精品在线二区| 日韩视频免费| 欧美精品入口| 亚洲免费观看高清完整版在线观看熊 | 久久久久天天天天| 美女任你摸久久| 又紧又大又爽精品一区二区| 久久久精彩视频| 免费成年人欧美视频| 在线看欧美日韩| 免费成人网www| 亚洲激情国产| 亚洲午夜在线观看| 国产精品羞羞答答| 久久九九精品99国产精品| 久久综合中文字幕| 91久久久久久久久| 欧美日韩国产片| 亚洲影院色无极综合| 久久国产一二区| 亚洲福利在线视频| 欧美精品乱码久久久久久按摩| 亚洲精品久久久久| 亚洲欧美日韩中文视频| 国语自产精品视频在线看8查询8| 久久久久久91香蕉国产| 亚洲区中文字幕| 亚洲欧美怡红院| 一区二区三区自拍| 欧美日韩国产在线播放网站| 亚洲欧美国产三级| 欧美1区2区| 亚洲综合色自拍一区| 国产一区二区av| 欧美激情91| 亚洲女优在线| 欧美国产日韩一区二区在线观看 | 欧美亚洲一区| 亚洲精品社区| 国产伦精品一区| 牛夜精品久久久久久久99黑人| 99视频在线观看一区三区| 久久精品一区二区| 一区二区三区日韩欧美精品| 国产午夜久久久久| 欧美日韩一区在线播放| 久久精品亚洲一区二区三区浴池| 亚洲精品乱码久久久久久蜜桃麻豆| 欧美在线观看你懂的| 亚洲日本中文字幕免费在线不卡| 国产精品女同互慰在线看| 免费国产一区二区| 性欧美1819sex性高清| 亚洲精品一区二区三区婷婷月| 久久精品官网| 亚洲一区成人| 91久久精品国产91久久| 国产一区91| 国产精品推荐精品| 欧美日韩在线免费视频| 麻豆精品精品国产自在97香蕉| 午夜久久99| 亚洲午夜精品久久久久久浪潮| 亚洲高清在线精品| 免费在线成人av| 久久婷婷国产麻豆91天堂| 午夜在线a亚洲v天堂网2018| 在线视频亚洲一区| 日韩亚洲欧美成人一区| 亚洲国产欧美一区| 在线成人欧美| 精品999网站| 黄色免费成人| 黄色小说综合网站| 国内精品模特av私拍在线观看 | 蜜臀91精品一区二区三区| 欧美在线免费观看亚洲| 性色一区二区| 西瓜成人精品人成网站| 午夜精品电影| 羞羞漫画18久久大片| 亚久久调教视频| 久久精品国产综合精品| 久久高清免费观看| 久久一二三国产| 乱码第一页成人| 欧美国产欧美亚洲国产日韩mv天天看完整 | 亚洲精品一区中文| 99亚洲视频| 亚洲欧美制服另类日韩| 欧美在线视频一区二区| 久久激情综合网| 美女精品网站| 欧美日韩18| 国产精品入口福利| 国产一区二区三区日韩| 亚洲大胆人体视频| 999亚洲国产精| 亚洲欧美三级在线| 久久久久久久999精品视频| 另类酷文…触手系列精品集v1小说| 老鸭窝毛片一区二区三区| 欧美成人日本| 一区二区不卡在线视频 午夜欧美不卡在| 一本到12不卡视频在线dvd| 亚洲综合久久久久| 久久久久综合网| 欧美精品一区在线| 国产精品亚洲视频| 亚洲国产精品电影| 亚洲性视频网站| 两个人的视频www国产精品| 亚洲欧洲一区| 欧美一区视频在线| 欧美国产在线视频| 国产日韩精品在线播放| 亚洲美女区一区| 欧美一区二区三区视频免费| 亚洲大片免费看| 欧美一级专区免费大片| 欧美大片91| 国模私拍视频一区| 亚洲一二三四区| 亚洲国产va精品久久久不卡综合| 在线亚洲免费| 欧美h视频在线| 国产伊人精品| 亚洲免费在线视频| 亚洲高清色综合| 久久久久久久久综合| 国产精品二区二区三区| 亚洲激情成人在线| 久久久久久噜噜噜久久久精品| 亚洲国产欧美日韩另类综合| 亚洲欧美影院| 欧美小视频在线观看| 日韩午夜视频在线观看| 六月丁香综合| 欧美在线看片a免费观看| 国产精品久久久久久福利一牛影视 |