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

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

連堆都不會用

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

旋轉卡殼

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

終于明白了凸包

明天再看看具體的代碼怎么寫
posted @ 2008-07-30 02:35 zhongguoa 閱讀(347) | 評論 (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 閱讀(487) | 評論 (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 閱讀(1155) | 評論 (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) | 評論 (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 閱讀(608) | 評論 (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) | 評論 (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 閱讀(1111) | 評論 (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>
            欧美日本精品| 国产精品久久久久久久午夜片| 亚洲欧美资源在线| 欧美精品一区二区在线播放| 黄色成人av网站| 久久经典综合| 新67194成人永久网站| 国产精品拍天天在线| 亚洲影院在线观看| 一本不卡影院| 国产精品激情av在线播放| 亚洲天堂av在线免费| 日韩亚洲视频在线| 欧美日韩在线电影| 亚洲网址在线| 亚洲桃色在线一区| 国产精品综合不卡av| 亚欧成人精品| 欧美伊人精品成人久久综合97| 国产精品一区久久| 久久精品99国产精品| 久久精品成人一区二区三区| 国产一区二区三区四区hd| 久久尤物电影视频在线观看| 久久se精品一区精品二区| 国内在线观看一区二区三区| 久久久精品视频成人| 久久久久在线| 亚洲精品系列| 亚洲午夜久久久| 国产日韩欧美电影在线观看| 久久裸体视频| 欧美成人高清| 亚洲一区二区三区视频播放| 久久高清福利视频| 亚洲在线一区二区三区| 国产精品久久久一本精品| 性欧美大战久久久久久久免费观看 | 玖玖在线精品| 亚洲日本欧美天堂| 一区二区三区日韩在线观看| 国产精品一区免费在线观看| 免费精品视频| 欧美日在线观看| 久久手机精品视频| 欧美日韩精品在线| 久久久久久电影| 欧美黄色一区| 久久久国产视频91| 欧美黄色影院| 久久精品国产亚洲一区二区三区| 久久一区免费| 性色av香蕉一区二区| 久久人体大胆视频| 亚洲欧美日韩中文视频| 久久免费少妇高潮久久精品99| 亚洲视频1区| 久久精品国产精品亚洲精品| 亚洲一区二区四区| 久久夜色精品国产| 午夜日韩在线| 欧美视频一区在线| 久久久午夜精品| 欧美日韩精品免费观看| 激情久久久久久久| 一区二区日韩| 亚洲国产精品成人| 夜夜嗨av一区二区三区四区| 狠狠色噜噜狠狠色综合久| 中文欧美日韩| 亚洲国产成人精品久久久国产成人一区 | 欧美日本网站| 亚洲图片自拍偷拍| 亚洲视频专区在线| 日韩视频一区二区三区在线播放| 欧美日本韩国| 亚洲午夜成aⅴ人片| 性久久久久久久久| 亚洲精品在线看| 久久国产婷婷国产香蕉| 亚洲男人av电影| 欧美韩日精品| 欧美韩日高清| 伊人久久大香线蕉综合热线| 亚洲欧美日韩第一区| 久久久久久999| 欧美在线观看一区| 国产精品久久久久久av下载红粉| 91久久久亚洲精品| 精品96久久久久久中文字幕无| 欧美一二区视频| 国产一区二区三区在线观看免费| 牛牛影视久久网| 欧美激情bt| 国产乱码精品一区二区三| 99av国产精品欲麻豆| 亚洲欧洲午夜| 欧美国产1区2区| 欧美激情在线有限公司| 在线观看国产精品网站| 狂野欧美一区| 亚洲激情在线观看| 一本大道久久精品懂色aⅴ| 欧美精品福利在线| 日韩午夜在线观看视频| 香蕉精品999视频一区二区 | 久久天堂成人| 欧美激情成人在线视频| 亚洲精品国产系列| 欧美日韩午夜剧场| 亚洲午夜av| 久久久在线视频| 亚洲成人在线视频播放| 欧美成人免费一级人片100| 亚洲日本va午夜在线电影| 在线亚洲精品| 国产啪精品视频| 久久亚洲私人国产精品va| 亚洲激情影院| 欧美专区亚洲专区| 亚洲高清网站| 欧美日韩亚洲国产精品| 午夜精品福利视频| 欧美激情一区二区三区高清视频| 中文一区在线| 狠狠噜噜久久| 欧美日韩中文字幕精品| 欧美在线关看| 亚洲毛片一区二区| 久久久久久免费| 一本色道久久综合亚洲精品按摩| 国产欧美一级| 欧美激情一区在线观看| 亚洲欧美综合一区| 91久久香蕉国产日韩欧美9色| 午夜精品美女自拍福到在线| 亚洲国产精品久久久久| 国产精品久线观看视频| 欧美成ee人免费视频| 亚洲一区日韩在线| 亚洲电影网站| 久久尤物电影视频在线观看| 一区二区三区精密机械公司 | 欧美精品一区二区三区在线播放| 亚洲欧洲av一区二区三区久久| 亚洲黄色在线视频| 久久先锋影音av| 欧美伊人久久大香线蕉综合69| 99精品视频网| 久久国产欧美日韩精品| 亚洲精品在线观看视频| 久久一区中文字幕| 午夜精品婷婷| 一区二区三区久久精品| 在线观看三级视频欧美| 国产精品综合| 欧美视频在线一区二区三区| 农村妇女精品| 噜噜噜躁狠狠躁狠狠精品视频| 欧美一级专区免费大片| 亚洲视频一二三| 日韩一二三区视频| 欧美激情国产高清| 久久成人人人人精品欧| 亚洲欧美日韩精品久久久| 日韩图片一区| 亚洲精品国久久99热| 在线观看成人av| 精品福利电影| 一区免费视频| 伊人春色精品| 国产自产女人91一区在线观看| 国产精品制服诱惑| 国产日韩欧美综合精品| 国产欧美高清| 国产一级久久| 一区二区在线视频观看| 黑人操亚洲美女惩罚| 韩国在线视频一区| 亚洲国产精品va在看黑人| 在线观看一区二区视频| 亚洲国产日韩综合一区| 亚洲欧洲一区二区天堂久久| 亚洲精品欧美一区二区三区| 亚洲美女在线一区| 亚洲小说欧美另类婷婷| 亚洲欧美日韩一区| 欧美中文字幕精品| 久久久99爱| 亚洲成色999久久网站| 亚洲欧洲美洲综合色网| 中文在线资源观看网站视频免费不卡| 99re国产精品| 亚洲女性裸体视频| 久久蜜桃资源一区二区老牛| 欧美黄色日本| 国产精品揄拍一区二区| 一区精品在线| 亚洲一区二区三区四区视频 | 久久亚洲电影|