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

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 閱讀(354) | 評論 (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 閱讀(486) | 評論 (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 閱讀(1154) | 評論 (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 閱讀(315) | 評論 (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 閱讀(607) | 評論 (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 閱讀(501) | 評論 (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 閱讀(1110) | 評論 (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>
            欧美性jizz18性欧美| 亚洲国产精品久久人人爱蜜臀| 亚洲一区二区三区影院| 亚洲电影免费观看高清完整版| 男女av一区三区二区色多| 牛牛国产精品| 香蕉免费一区二区三区在线观看| 欧美在线播放| 卡一卡二国产精品| 欧美激情综合色综合啪啪| 国产精品久久久久久久久久尿| 国产精品久久久久久久久久免费 | 欧美性生交xxxxx久久久| 亚洲日本中文字幕免费在线不卡| 亚洲毛片在线看| 午夜在线视频一区二区区别| 久久三级福利| 亚洲欧洲精品一区二区三区不卡 | 国产精品毛片一区二区三区 | 在线不卡a资源高清| 99精品久久久| 久久久久国色av免费看影院| 亚洲精品一二区| 久久riav二区三区| 国产色爱av资源综合区| 亚洲美女色禁图| 亚洲国产成人精品久久| 欧美gay视频| 国产一区三区三区| 在线天堂一区av电影| 久久久久久久波多野高潮日日| 欧美亚洲一区二区在线观看| 欧美日韩www| 黄色资源网久久资源365| 一区二区三区黄色| 99riav国产精品| 欧美3dxxxxhd| 一区二区欧美在线| 99热这里只有精品8| 国产欧美高清| 亚洲欧美日韩精品久久久久| 91久久久在线| 国产精品夫妻自拍| 久久资源在线| 欧美亚洲视频一区二区| 黑丝一区二区| 久久国产精品色婷婷| 一区二区av在线| 欧美涩涩网站| 正在播放欧美一区| 美脚丝袜一区二区三区在线观看 | 一区二区三区国产| 亚洲女优在线| 国产精品色婷婷久久58| 亚洲一级在线| 亚洲免费成人| 欧美精品高清视频| 欧美自拍偷拍午夜视频| 亚洲永久视频| 亚洲国产一成人久久精品| 久久综合给合| 欧美日韩一区二区在线| 国产精品99久久99久久久二8 | 久久久久久久波多野高潮日日| 欧美片网站免费| 亚洲一区在线播放| 亚洲一区二区三区午夜| 亚洲欧洲精品天堂一级| 欧美电影在线观看完整版| 久久亚洲欧美国产精品乐播| 一区二区在线看| 亚洲免费视频在线观看| 一区二区三区 在线观看视频| 乱码第一页成人| 在线一区亚洲| 免费不卡在线观看| 久久久另类综合| 欧美午夜精品理论片a级按摩| 欧美成人a视频| 国产亚洲欧美一区| 91久久极品少妇xxxxⅹ软件| 亚洲欧美精品| 一区二区三区高清| 毛片一区二区三区| 久久久av网站| 欧美福利精品| 亚洲二区在线| 亚洲国产日韩欧美综合久久| 欧美1区2区| 久久综合影音| 女同性一区二区三区人了人一 | 亚洲欧美日韩国产精品| 欧美日韩免费一区| 久久亚洲春色中文字幕| 国产一区二区三区直播精品电影 | 午夜欧美电影在线观看| 一区二区三区精品在线| 亚洲视屏一区| 国产欧美日韩亚洲一区二区三区| 亚洲精品欧美一区二区三区| 亚洲国产欧美在线| 久久精品一区二区三区不卡牛牛| 国产伦精品一区二区三区| 亚洲女女女同性video| 久久综合九色综合久99| 一本一本久久a久久精品综合妖精| 久久综合久久美利坚合众国| 久久先锋影音| 国产一级久久| 亚洲天堂av电影| 一区二区三区黄色| 欧美视频网站| 亚洲综合视频一区| 久久精品人人做人人爽电影蜜月| 国产伦精品一区二区| 在线视频欧美一区| 西西人体一区二区| 国产精品影音先锋| 午夜久久影院| 久久深夜福利| 亚洲第一色中文字幕| 久久女同精品一区二区| 欧美三区视频| 久久成人免费日本黄色| 亚洲激情另类| 欧美国产一区二区| 亚洲人成久久| 亚洲一区综合| 国产一区二区三区最好精华液| 欧美一区二区三区婷婷月色| 欧美激情视频在线播放| 亚洲精品在线视频| 欧美午夜一区二区| 香蕉精品999视频一区二区| 久久手机精品视频| 亚洲精品久久7777| 欧美深夜福利| 一本一道久久综合狠狠老精东影业 | 欧美中文在线字幕| 美日韩免费视频| 国产在线视频欧美一区二区三区| 久久久无码精品亚洲日韩按摩| 亚洲欧美国产精品va在线观看| 国产精品欧美在线| 久久嫩草精品久久久精品一 | 亚洲欧美精品| 欧美黄色aa电影| 亚洲午夜国产一区99re久久 | 国产精品中文在线| 美女免费视频一区| 一本大道久久精品懂色aⅴ| 久久精品久久99精品久久| 在线成人av| 国产精品普通话对白| 欧美成人午夜77777| 男同欧美伦乱| 亚洲网站在线看| 在线电影国产精品| 欧美三级特黄| 毛片av中文字幕一区二区| 中文一区字幕| 亚洲成色www久久网站| 亚洲第一精品在线| 国产精品第一区| 午夜精品久久99蜜桃的功能介绍| 欧美电影专区| 久久视频在线视频| 亚洲欧美自拍偷拍| 亚洲精品免费网站| 狠狠色丁香久久婷婷综合_中| 国产色综合天天综合网| 欧美视频成人| 欧美日本在线| 美女脱光内衣内裤视频久久影院 | 亚洲精品小视频在线观看| 尤妮丝一区二区裸体视频| 国产精品久久久久久久浪潮网站| 免费亚洲网站| 久久久久久久久久久久久女国产乱 | 亚洲伊人久久综合| 在线视频精品一区| 日韩视频在线一区二区三区| 欧美国产一区二区三区激情无套| 久久婷婷国产麻豆91天堂| 午夜精品国产精品大乳美女| 在线欧美影院| 亚洲毛片av| 日韩视频在线免费| 亚洲人体影院| 亚洲国产日韩欧美| 影音先锋日韩精品| 亚洲精品视频在线| 亚洲国产一区二区视频 | 欧美黄色成人网| 欧美成人精品一区| 免费观看成人www动漫视频| 久久夜色精品国产欧美乱| 午夜欧美不卡精品aaaaa| 久久精品夜色噜噜亚洲a∨| 久久成人资源|