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

2010年5月12日

網(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 閱讀(355) | 評(píng)論 (0)編輯 收藏
2008年12月2日

連堆都不會(huì)用

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

旋轉(zhuǎn)卡殼

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

終于明白了凸包

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

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 閱讀(487) | 評(píng)論 (0)編輯 收藏
2008年5月8日

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 閱讀(1155) | 評(píng)論 (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 閱讀(316) | 評(píng)論 (0)編輯 收藏
2008年4月9日

歸并求逆序數(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 閱讀(608) | 評(píng)論 (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 閱讀(502) | 評(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 閱讀(1111) | 評(píng)論 (1)編輯 收藏
僅列出標(biāo)題  下一頁(yè)
青青草原综合久久大伊人导航_色综合久久天天综合_日日噜噜夜夜狠狠久久丁香五月_热久久这里只有精品
  • <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>
            久久久久久网站| 欧美成人一品| 亚洲欧美资源在线| 狠狠爱综合网| 欧美区视频在线观看| 亚洲一区二区伦理| 老司机凹凸av亚洲导航| 亚洲精选91| 国产伦精品一区二区三| 噜噜噜91成人网| 亚洲图片激情小说| 久久综合五月天婷婷伊人| 亚洲人成在线观看一区二区| 欧美色图首页| 久久男女视频| 亚洲免费在线精品一区| 亚洲国产精品成人综合| 亚洲一线二线三线久久久| 国内精品久久久久久| 欧美激情综合在线| 久久精品99| 一区二区三区视频在线播放| 免费观看一级特黄欧美大片| 亚洲视频在线观看网站| 亚洲国产裸拍裸体视频在线观看乱了中文 | 亚洲一区国产| 在线播放日韩专区| 国产精品久久久一区二区| 久久亚洲美女| 亚洲欧美日韩视频二区| 欧美区高清在线| 久久久成人精品| 亚洲女同在线| 亚洲乱码视频| 欧美jizzhd精品欧美巨大免费| 午夜精品999| 夜夜嗨av一区二区三区四季av| 国模私拍视频一区| 国产精品成人播放| 欧美精品一线| 另类天堂视频在线观看| 亚洲自拍偷拍网址| 一区二区三区视频在线| 最新成人av网站| 亚洲国产精品v| 欧美福利一区| 久久亚洲综合色| 免费亚洲视频| 久久精品五月婷婷| 午夜精品999| 日韩一区二区久久| 亚洲经典视频在线观看| 欧美sm视频| 久久精品一区二区三区中文字幕| 欧美一级二级三级蜜桃| 羞羞漫画18久久大片| 亚洲欧美欧美一区二区三区| 一区二区三区产品免费精品久久75 | 欧美福利一区| 免费高清在线一区| 久久裸体艺术| 久久久国产午夜精品| 欧美综合国产| 久久精品视频在线播放| 久久精品av麻豆的观看方式 | 在线中文字幕不卡| 一本到高清视频免费精品| 亚洲最新在线视频| 中日韩视频在线观看| 亚洲一区精品在线| 亚洲欧美日韩精品一区二区 | 国产精品久久久久久久app| 欧美激情欧美激情在线五月| 欧美黄免费看| 欧美日韩精品综合在线| 国产精品草草| 国产美女高潮久久白浆| 国产一区二区三区自拍| 精品51国产黑色丝袜高跟鞋| 亚洲人成7777| 一区二区三区欧美激情| 亚洲午夜精品一区二区三区他趣| 亚洲在线免费观看| 欧美在线关看| 久久亚裔精品欧美| 欧美日韩精品免费看 | 欧美色欧美亚洲另类二区| 欧美日韩亚洲视频一区| 国产欧美欧美| 在线观看视频一区二区| 亚洲精品无人区| 午夜天堂精品久久久久| 久久精品日韩欧美| 亚洲国产精品一区二区第四页av| 日韩视频久久| 欧美一级夜夜爽| 蜜桃久久av一区| 欧美日韩在线直播| 国产视频综合在线| 亚洲精品一区中文| 欧美一区精品| 欧美精品一区三区| 国产日韩亚洲欧美精品| 亚洲第一综合天堂另类专| 夜夜爽www精品| 久久精品日产第一区二区| 亚洲国产精品久久人人爱蜜臀| aa级大片欧美| 久久偷窥视频| 国产精品va在线| 国内在线观看一区二区三区| 亚洲精一区二区三区| 性伦欧美刺激片在线观看| 久久综合电影| 一区二区三区欧美成人| 另类尿喷潮videofree| 国产精品国产三级国产专播精品人| 欧美精品情趣视频| 久久精品国产99国产精品澳门| 欧美成年人视频| 国产日韩欧美一区二区三区四区| 亚洲人精品午夜| 久久国产精品网站| 亚洲精品美女| 久久久久久久久综合| 国产精品久久久久久久久| 亚洲国产黄色| 久久国产欧美| 一区二区三区产品免费精品久久75 | 久久av在线看| 欧美天堂亚洲电影院在线播放| 黄色小说综合网站| 亚洲欧美国产高清va在线播| 欧美好骚综合网| 亚洲欧美在线一区二区| 欧美日韩调教| 91久久中文| 老司机凹凸av亚洲导航| 亚洲欧美清纯在线制服| 欧美日韩亚洲综合一区| 91久久国产综合久久蜜月精品 | 国产精品视频| 在线亚洲观看| 亚洲第一综合天堂另类专| 性欧美video另类hd性玩具| 欧美日韩另类一区| 最新高清无码专区| 久久久青草婷婷精品综合日韩| 一区二区三区.www| 欧美成人亚洲成人日韩成人| 伊人久久大香线蕉av超碰演员| 亚洲欧美日韩一区二区在线| 久久久另类综合| 亚洲欧美另类国产| 国产精品chinese| 在线视频你懂得一区二区三区| 欧美黄色aa电影| 久久综合色综合88| 国内久久视频| 欧美在线视频一区| 亚洲影院污污.| 国产精品久久久久秋霞鲁丝| 夜色激情一区二区| 亚洲精品乱码久久久久久日本蜜臀 | 性色一区二区| 亚洲视频视频在线| 亚洲一区免费观看| 久久久亚洲人| 欧美一区二区三区视频免费播放| 国产乱码精品一区二区三区av| 亚洲主播在线| 亚洲一区二区三区免费观看 | 影音先锋亚洲电影| 麻豆精品网站| 久久综合九色综合欧美狠狠| 1204国产成人精品视频| 狂野欧美一区| 久久综合九色99| 亚洲欧洲日韩综合二区| 亚洲精品久久久久| 欧美另类视频在线| 日韩网站在线看片你懂的| 亚洲激情视频| 欧美绝品在线观看成人午夜影视| 亚洲欧美日韩国产综合在线| 亚洲高清色综合| 嫩模写真一区二区三区三州| 亚洲人精品午夜| 国产一区二区日韩精品| 亚洲黄色成人久久久| 男人的天堂成人在线| 免费观看成人网| 正在播放亚洲一区| 中日韩在线视频| 国产伪娘ts一区| 欧美大片在线看| 欧美日韩免费观看一区二区三区 | 欧美日韩999| 亚洲自拍偷拍麻豆| 久久不见久久见免费视频1|