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

網(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>
            国产精品欧美久久| 欧美国产精品中文字幕| 国产精品影视天天线| 亚洲欧美三级在线| 亚洲欧美影音先锋| 国语自产精品视频在线看| 久久精品视频免费播放| 久久久久综合网| 亚洲日本视频| 一区二区三区色| 国产精品五月天| 葵司免费一区二区三区四区五区| 久久蜜桃精品| 亚洲天堂第二页| 亚洲男女自偷自拍| 亚洲高清免费视频| 一区二区三区久久| 伊人久久亚洲影院| 日韩一级精品| 国内激情久久| 日韩视频中文字幕| 欧美国产精品日韩| 欧美午夜精品久久久久久人妖| 欧美一区二区| 免费h精品视频在线播放| 亚洲一区在线直播| 久热精品视频在线观看| 亚洲欧美成人| 欧美激情第9页| 久久精品在线观看| 欧美日韩色一区| 欧美gay视频| 国产毛片一区二区| 亚洲精品久久在线| 国产亚洲a∨片在线观看| 亚洲精品黄色| 激情偷拍久久| 亚洲欧美日韩一区| 在线综合亚洲欧美在线视频| 久久久久久黄| 欧美在线一级va免费观看| 欧美另类69精品久久久久9999| 欧美主播一区二区三区| 欧美系列精品| 亚洲人成在线播放| 在线播放日韩欧美| 欧美一级久久久| 欧美亚洲在线| 欧美色123| 亚洲免费大片| 亚洲精品黄色| 欧美国产精品专区| 欧美福利一区二区| 在线免费日韩片| 欧美影院视频| 久久久久久综合| 国产一区二区中文字幕免费看| 亚洲一区二区精品在线| 亚洲欧美美女| 国产精品美女一区二区| 在线视频日韩| 亚洲欧美综合| 国产日韩精品入口| 欧美一区二区日韩| 久久国产免费| 黑丝一区二区| 久久综合色一综合色88| 欧美国产精品va在线观看| 亚洲高清不卡在线| 欧美电影在线观看| 亚洲国产综合视频在线观看| 91久久午夜| 欧美日韩成人免费| 一本大道久久a久久综合婷婷| 一区二区不卡在线视频 午夜欧美不卡在 | 亚洲国产精品va在看黑人| 亚洲大片免费看| 免费不卡中文字幕视频| 亚洲国产精品久久久久婷婷老年| 亚洲美女色禁图| 欧美日韩国产综合一区二区| 一区二区三区免费网站| 欧美一区二区成人| 久久福利影视| 国产亚洲网站| 欧美国产亚洲精品久久久8v| 亚洲精品综合| 欧美在线免费观看亚洲| 伊人春色精品| 欧美日韩精品一二三区| 午夜精品一区二区三区在线视| 久久久久www| 亚洲精品一区二区三区蜜桃久| 欧美另类专区| 亚洲在线观看视频| 欧美激情国产日韩| 亚洲欧美变态国产另类| 亚洲国产91精品在线观看| 欧美日韩中文字幕在线视频| 一区二区三区在线免费播放| 欧美美女bbbb| 久久精品国产精品| 亚洲美女av在线播放| 久久久精品tv| 亚洲一区精品电影| 在线观看国产成人av片| 国产精品二区二区三区| 久久亚洲视频| 亚洲欧美久久久| 亚洲久久视频| 欧美高清视频一区二区三区在线观看| 中文亚洲字幕| 亚洲黄色毛片| 国产在线精品二区| 欧美三级电影网| 欧美凹凸一区二区三区视频| 欧美一区二区三区在线播放| 亚洲免费观看在线视频| 欧美凹凸一区二区三区视频| 欧美影院在线| 亚洲一区二区三区午夜| 91久久亚洲| 在线免费观看欧美| 国产日产亚洲精品| 欧美亚洲第一页| 欧美日韩免费视频| 欧美福利视频| 欧美xx69| 欧美www视频| 欧美不卡视频一区发布| 久久婷婷亚洲| 久久久久久有精品国产| 久久99伊人| 欧美一区午夜视频在线观看| 亚洲欧美久久久| 亚洲嫩草精品久久| 亚洲欧美www| 亚洲欧美韩国| 欧美在线免费播放| 久久成人免费视频| 久久精品国产亚洲一区二区| 欧美专区在线观看| 久久先锋资源| 蜜臀av国产精品久久久久| 免费的成人av| 欧美另类久久久品 | 一区二区三区精密机械公司| 亚洲看片网站| 亚洲午夜电影| 午夜激情一区| 久久久999精品视频| 美女国产一区| 欧美欧美午夜aⅴ在线观看| 欧美日韩国产高清视频| 欧美三区在线观看| 国产欧美91| 在线观看欧美亚洲| 亚洲精品日本| 亚洲欧美中文另类| 久久国产精彩视频| 欧美91视频| 亚洲剧情一区二区| 午夜激情综合网| 猛干欧美女孩| 国产精品久久久久99| 国产专区综合网| 亚洲麻豆av| 午夜精品久久久久久| 可以免费看不卡的av网站| 亚洲电影免费观看高清完整版在线| 亚洲国产成人tv| 亚洲一区二区精品在线观看| 久久人人97超碰精品888| 欧美精品激情| 国产一区二三区| 亚洲婷婷综合久久一本伊一区| 久久se精品一区精品二区| 欧美成人黑人xx视频免费观看| 99国产精品久久久久久久久久| 午夜日韩在线| 欧美日本视频在线| 激情婷婷欧美| 午夜精品在线| 亚洲欧洲在线一区| 欧美一级午夜免费电影| 欧美激情视频一区二区三区不卡| 国产美女一区| 一本色道**综合亚洲精品蜜桃冫 | 亚洲欧美国产高清| 欧美国产日韩亚洲一区| 国产综合在线看| 亚洲欧美春色| 亚洲人成艺术| 久久免费99精品久久久久久| 国产精品久久久久永久免费观看| 亚洲韩国日本中文字幕| 久久精品人人做人人爽| 99精品99| 欧美日本一区二区高清播放视频| 影音先锋欧美精品|