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

網(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) | 評論 (0)編輯 收藏

連堆都不會用

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

旋轉(zhuǎn)卡殼

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

終于明白了凸包

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

pku1032關(guān)于數(shù)論的一個結(jié)論

把自然數(shù)N分解成若干個互不相同的正整數(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) | 評論 (0)編輯 收藏

itoa

功 能: 把一整數(shù)轉(zhuǎn)換為字符串
用 法: char *itoa(int value, char *string, int radix);
詳細(xì)解釋:itoa是英文integer to string a(將整形數(shù)轉(zhuǎn)化為一個字符串,并將值保存在a中)
的縮寫.其中value為要轉(zhuǎn)化的整數(shù), radix是基數(shù)的意思,即先將value轉(zhuǎn)化為幾進制的數(shù),之后在保存在a 中.
作用:實現(xiàn)數(shù)制之間的轉(zhuǎn)化
比較:ltoa,其中l(wèi)是long integer(長整形數(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) | 評論 (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 閱讀(316) | 評論 (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 閱讀(608) | 評論 (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 閱讀(502) | 評論 (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) | 評論 (1)編輯 收藏
僅列出標(biāo)題
共2頁: 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>
            久久一区二区三区国产精品| 国产精品专区第二| 亚洲激情一区二区| 欧美激情一区二区三区在线视频观看 | 欧美美女视频| 亚洲性色视频| 亚洲主播在线观看| 一区在线影院| 亚洲二区在线视频| 欧美三级第一页| 欧美一区二区三区精品| 久久av资源网| 日韩午夜三级在线| 亚洲伊人久久综合| 伊人久久亚洲热| 亚洲美女在线视频| 国产伦精品一区二区三区视频黑人 | 亚洲欧美中文字幕| 久久蜜桃精品| 亚洲网站在线播放| 欧美在线综合| 正在播放亚洲一区| 久久精品国产99国产精品| 亚洲毛片视频| 欧美一区二区成人6969| 99xxxx成人网| 欧美一级视频精品观看| 一区二区高清在线观看| 久久精品综合一区| 一区二区日韩免费看| 久久久久久久久久看片| 亚洲无线视频| 欧美成人情趣视频| 久久久久久亚洲精品中文字幕| 欧美国产综合| 美女啪啪无遮挡免费久久网站| 欧美三区在线| 91久久久精品| 亚洲成人原创| 羞羞色国产精品| 亚洲一区精品视频| 欧美高清在线观看| 欧美成人免费小视频| 国产精品一区免费在线观看| 亚洲精品乱码久久久久久按摩观| 精品av久久707| 亚洲永久免费精品| 亚洲天堂男人| 欧美精品一区二区三区四区| 欧美成年网站| 又紧又大又爽精品一区二区| 校园春色综合网| 香蕉成人啪国产精品视频综合网| 欧美精品激情| 亚洲激情网站免费观看| 亚洲国产日韩综合一区| 久久久综合免费视频| 久久久久五月天| 国产一区二区三区黄| 先锋影音国产精品| 久久国产免费| 一区二区三区在线视频观看 | 麻豆国产va免费精品高清在线| 国产乱码精品一区二区三区av| 国产精品99久久99久久久二8| 一本一本久久a久久精品牛牛影视| 免费欧美在线视频| 亚洲国产婷婷| 一本久久综合亚洲鲁鲁五月天| 欧美大片91| 99精品福利视频| 午夜久久tv| 国产女主播一区二区| 欧美亚洲免费高清在线观看| 久久久91精品国产一区二区三区| 国产欧美日韩综合精品二区| 欧美一级播放| 久久综合影音| 亚洲免费av观看| 欧美无乱码久久久免费午夜一区| 亚洲午夜视频在线| 久热国产精品视频| 亚洲三级影片| 欧美偷拍另类| 久久国产黑丝| 91久久精品国产91性色tv| 亚洲一区二区三区免费视频| 国产日韩欧美精品| 免费一级欧美在线大片| 亚洲美女av黄| 久久五月激情| 亚洲免费观看高清在线观看| 国产精品av一区二区| 久久精品亚洲精品国产欧美kt∨| 亚洲高清一区二| 午夜精品久久久久久久99樱桃| 国产一区二区三区在线观看视频| 免费欧美网站| 亚洲欧美日韩国产综合在线| 欧美高清视频在线播放| 亚洲欧美日韩人成在线播放| 激情久久久久久久| 欧美婷婷在线| 鲁大师影院一区二区三区| 一区二区三区欧美在线观看| 美国十次成人| 午夜在线精品偷拍| 日韩视频在线观看一区二区| 国产视频精品网| 欧美日韩精品一区二区三区四区 | 欧美一区中文字幕| 亚洲人成网站色ww在线| 久久精品青青大伊人av| 亚洲精品国产视频| 国产一区二区三区在线播放免费观看 | 另类综合日韩欧美亚洲| 亚洲一区欧美激情| 最新国产拍偷乱拍精品| 国产一区久久| 国产精品久久久久久久久久免费 | 久久九九99| 亚洲一区二区精品| 亚洲精品国产精品乱码不99| 国产亚洲精品自拍| 国产精品乱码一区二区三区| 欧美激情精品久久久久久变态| 欧美在线啊v| 亚洲在线观看视频网站| 亚洲美女毛片| 亚洲日本无吗高清不卡| 欧美电影打屁股sp| 免费观看欧美在线视频的网站| 欧美在线三级| 香蕉久久夜色精品国产使用方法 | 国产亚洲人成网站在线观看| 欧美午夜精品| 欧美日韩一区三区| 欧美理论大片| 欧美女主播在线| 欧美精品自拍| 欧美欧美天天天天操| 欧美日韩mp4| 欧美日韩国产精品一区二区亚洲| 欧美好骚综合网| 欧美日韩国产不卡| 欧美日韩一级大片网址| 欧美日韩一本到| 国产精品vvv| 国产精品人人做人人爽人人添| 欧美午夜三级| 国产伦精品一区二区三| 国产婷婷色一区二区三区在线| 国产一区二区日韩精品| 好吊妞这里只有精品| 亚洲国产一区二区三区高清| 亚洲精品美女久久久久| 在线亚洲一区观看| 欧美一级播放| 久久亚洲国产精品一区二区 | 欧美在线国产| 久久久噜噜噜久噜久久| 欧美va天堂va视频va在线| 亚洲国产二区| 亚洲伊人网站| 久久久久综合网| 欧美精品一区在线播放| 国产精品午夜在线| 在线免费观看成人网| 日韩一本二本av| 欧美一区二区大片| 欧美激情91| 亚洲自拍啪啪| 女同一区二区| 国产精品久久久久av| 雨宫琴音一区二区在线| 一区二区三区四区五区视频| 午夜一区二区三区在线观看| 美女黄网久久| 国产精品99久久久久久久vr| 久久国产精品一区二区三区四区| 男人的天堂成人在线| 国产精品免费网站| 亚洲精品女人| 久久久午夜电影| 亚洲最新色图| 免费成人黄色| 国产亚洲在线观看| 夜夜嗨av一区二区三区四季av| 久久久久一区二区三区| 一本色道久久综合亚洲精品高清| 久久精品一区二区三区不卡| 欧美三级不卡| 亚洲精品乱码久久久久久黑人 | 老司机精品福利视频| 99这里只有精品| 欧美成人嫩草网站| 亚洲电影第1页| 久久精品中文字幕免费mv| 一区二区欧美激情| 欧美精品一区三区在线观看|