2019年4月26日 星期五

test

test 

<script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
<script>
  (adsbygoogle = window.adsbygoogle || []).push({
    google_ad_client: "ca-pub-6030336172098402",
    enable_page_level_ads: true
  });
</script>

2012年6月4日 星期一

網站


字典
http://dict.dreye.com/ews/dict.php
http://tw.dictionary.yahoo.com/
http://www.thefreedictionary.com/

http://www.iciba.com/
http://www.jukuu.com/index.php

諺語字典
http://www.wisegeek.com/

翻譯軟體
http://www.lingoes.cn/


查專有名詞的字典
http://inogolo.com/


國語字典
http://dict.revised.moe.edu.tw/index.html


英文名字
http://yingwenmingzi.haha8.org/popular/popular.htm


空英
http://www.studioclassroom.com/default.php

中英對照新聞

http://news.hkheadline.com/dailynews/headlinenews_columnist.asp?kw=126
http://cn.nytimes.com/

文章
http://www.businessweek.com/articles/2012-03-23/when-can-you-make-personal-calls-at-work
http://www.businessweek.com/articles/2012-05-11/does-your-office-have-a-clique

英語對話,問題集
http://leedsmayi.pixnet.net/blog/post/34405451
http://iteslj.org/questions/


語英英文
http://www.bbc.co.uk/worldservice/learningenglish/general/sixminute/
http://www.bbc.co.uk/ukchina/simp/elt/
http://www.51voa.com/VOA_Standard_1.html
http://www.eslpod.com/website/show_all.php

fb news
CNN大練功
http://www.facebook.com/cnn?ref=ts&fref=ts
http://www.facebook.com/TheEconomist

台灣英文新聞
http://www.etaiwannews.com/etn/index_en.php
http://www.taipeitimes.com/
http://www.chinapost.com.tw/

news
http://www.nytimes.com/most-popular-emailed
http://www.bbc.co.uk/news/
http://www.thefreedictionary.com/
http://edition.cnn.com/
http://www.economist.com/
http://www.ecocn.org/portal.php  economist中文版
http://www.foreignpolicy.com/
http://www.ft.com/home/asia
http://asia.wsj.com/home-page
http://www.aol.com/


business magazine
http://www.forbes.com/



讀者文摘
http://www.rd.com/
http://www.readersdigest.co.in/
bloomberg
http://www.bloomberg.com/
http://www.businessweek.com


PTT-qqivanw (中英翻譯)
http://wondroustranslation.wordpress.com/



聽力
http://www.eslpod.com/website/index_new.html
http://www.breakingnewsenglish.com/
http://app.hujiang.com/listen/


英語演講
http://www.toastmasters.org.tw/d67web/ch/clubs/club-english.htm
http://www.toastmasters.org/

旋元佑英文文法書
http://www.mediafire.com/?372ww3u7ldxeubx

小說下載  電子書
http://ishare.iask.sina.com.cn/c/1825.html
http://www.qcenglish.com/

別人讀書會的文章
http://www.happyforum.org/happy/viewforum.php?f=33&sid=1c51b7702b4cf39ec114f3f5514662a6

https://docs.google.com/spreadsheet/ccc?key=0Ahg0Mxbg3mr6dFVTdFc2YmZ4c1Z3eC1Lc1o1aFEtWGc#gid=0

雙語英文
http://iservice.libertytimes.com.tw/Service/english/
http://www.taipeitimes.com/News/lang

TED
http://www.ted.com/talks?lang=en&event=&duration=&sort=mostviewed&tag=
http://www.universalsubtitles.org/zh-tw/videos/watch/


美國影集
http://www.hulu.com/


影劇
http://www.tw116.com
http://www.natnatvip.org/
字幕
http://shooter.cn


BT
http://isohunt.com/

http://www.btscene.eu/



艾爾斯
http://leedsmayi.pixnet.net/blog/post/34405451


語言交換
http://www.englishbaby.com/
http://www.italki.com/
http://www.sharedtalk.com/

http://www.tealit.com/


ACM problem
http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=3


anobii
http://www.anobii.com/books/The_Hunger_Games/9780439023481/01ead4244abc7f91e4/#

動物
http://animal.discovery.com/
http://animals.nationalgeographic.com/animals/?source=NavAniBlog

宇宙
http://www.nasa.gov/topics/universe/index.html
http://www.cuyoo.com/html/xiaoshuo/index.html
http://www.bbc.co.uk/worldservice/learningenglish/language/wordsinthenews/2012/05/120521_witn_changing_america.shtml


科學類
http://earthsky.org/


英語學習
http://www.about.com/#!/editors-picks/
http://www.sparknotes.com/lit/catcher/

簡單的英文文章
http://www.englishdaily626.com/

空英下載
http://www.fileserve.com/file-manager.php
帳號: bjk543
密碼: scarecrow
空英radio program

http://www.studioclassroom.com/sc/Sc-rD.php
http://news.cnet.com/
http://news.nationalgeographic.com/newsadvanced

http://goo.gl/azVjg
綠野仙蹤  http://db.tt/OqQRZrP1

http://www.idownloadblog.com/tag/siri/
bulletin board
http://www.ivillage.com/challenges

lol介紹
http://leaguecraft.com/guide/master-yi-build-guide.xhtml
http://bikini.com/allstars

笑話
http://www.superlaugh.com/funpages/the-service.php
http://www.onlyfunnystories.com/Catch_Rabbit.asp

桌遊
http://zh.boardgamearena.com/?s=4374903#!gamepanel?game=saboteur
http://pc357308.no-ip.org:443/main.html
http://board-games.pogo.com/

專有名詞

犯罪心理學

http://tw.myblog.yahoo.com/jw!.x_u7YyWHxDmYDxhik2q1rI-/

台灣偶像劇,英文字幕
http://www.mysoju.com
dramacrazy.net   
vikiv.com
epdrama.com


yahoo
http://uk.lifestyle.yahoo.com/
http://shine.yahoo.com/
http://www.cosmopolitan.com/
http://www.redonline.co.uk/beauty/beauty-trends
http://www.realbuzz.com/articles/
http://www.autosport.com/
http://leagueoflegends.wikia.com/wiki/League_of_Legends_Wiki
http://lifehacker.com/
http://www.couchsurfing.org/
http://shine.yahoo.com/




trival
http://www.tripadvisor.com.tw/
http://www.expedia.com.tw
http://travel.network.com.tw/tourguide/point/showpage/191.html
http://easy.sina.com.tw/scenic/article_contentid-1274.html


展覽
http://www.mocataipei.org.tw/blog
http://citytalk.tw/cata/57/
http://tw.travel.yahoo.com/


網站
http://pewinternet.org/
http://uutw.com.tw/Newpage.asp
http://www.mademan.com/

演奏
http://dadongcenter.khcc.gov.tw/activityshow.aspx?cid=443
http://www.ntch.edu.tw/program/schedulelist?lang=zh
http://www.dac.tw/Performance.html
http://www.ntch.edu.tw/front/index?lang=zh
http://www.artistvillage.org/Activity
富邦演講
http://www.fubonart.org.tw/ugC_LectureHis.asp
景點
http://sitetag.us/
http://okgo.tw/buty/hsinchu.html


http://gohiking.myweb.hinet.net/hike_hist1.htm
http://club.ntu.edu.tw/~mtclub/database/high.htm

http://goo.gl/vWTcT
[綠活郊山] 陳綺貞廣告美景 雲森瀑布
http://www.tonyhuang39.com/tony0271.html
http://goo.gl/kfei0

台北步道100選-004 水管路步道、翠峰步道
http://sssa1234.pixnet.net/blog/category/1416864



, prevalent , engaged , constituted , snatched , lash , conscience ,

evacuated , gratitude , promptly , emerging  , detection bias ,  ,  ,

,  ,  quaint town , arches  , get in good , phobia  , anxiety  ,

persevered  , come up with  , patients  ,  empathy
, pajamas  , rational , logical , is a breeze , murky area ,  ,  ,  ,

,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,

, sane , label , communist , questioning , comfort , proof , wink ,

secret , mattress , Take heart , wrecked , twitches , filthy , goalie ,

saumensch , mincemeat , assessment , engage , stunning , athletic ,

awesome , interfere , accent ,  emerge
, restrain , From time to time , solemn ,  ,  ,  ,  ,  ,  ,  ,  ,  ,  ,

 ,  ,  ,  ,  ,  ,  ,  ,  ,  ,


2012年3月4日 星期日

作品

darkchess.avi
在創易通-手機遊戲公司時作的
http://www.youtube.com/watch?v=6Dr6rOd8X_w

電腦(先手,控制白色軍種)
玩家(後手,控制黑色軍種)

電腦:翻出黑車
玩家:翻出白炮
電腦:翻出白仕
玩家:控制黑車吃掉白炮
電腦:控制白仕吃掉黑車
玩家:翻出黑馬
電腦:控制白仕右移
玩家:翻出白傌
電腦:翻出白炮
玩家:翻出黑車
電腦:控制白炮吃掉黑馬
玩家:控制黑車吃掉白炮
電腦:翻出白兵
玩家:翻出黑卒

2010年10月21日 星期四

101



#include <stdio.h>
#include <stdlib.h>
#include <string.h>
typedef enum __bool {
    false = 0,
    true = 1,
} bool;

bool debug=false;
bool debug_searchNode=false;
struct Node{
    int  n;
    struct Node *next;
};

struct Node **input_array;

struct Node *createNode(int n){
    struct Node *temp = (struct Node*)malloc(sizeof(struct Node));
    temp->n=n;
    temp->next=NULL;
    return temp;
}

void initial(int n){
    int i;
    for(i=0;i<n;i++){
        input_array[i] = createNode(-1);
        input_array[i]->next = createNode(i);
    }
}

void printArray(int n){
    int i=0;
    for(i=0;i<n;i++){
        struct Node *temp;
        temp = input_array[i]->next;
        printf("%d:",i);
        while(temp!=NULL){
            printf(" %d",temp->n);
            temp = temp->next;
        };
        printf("\n");
    }
}

void returns(struct Node* p){
    if(debug) {
        printf("returns ");
        if(p)printf(" %d\n",p->n);
    }
    /*printf("returns");*/  
    struct Node *temp = p->next;  
    p->next=NULL;
    p=temp;
      
    while(p!=NULL){
        int n = p->n;
        if(debug)printf("p->n %d\n",p->n);
        temp = p->next;
        if(debug)if(input_array[n]==NULL)printf("input_array[n]==NULL");
        p->next = input_array[n]->next;
        input_array[n]->next = p;
        if(debug)if(p->next)printf("p->next->n %d\n",p->next->n);
        p=temp;
    }
    if(debug) {
        printf("returns end");
    }
}
/*
search the node which value is n
total_n: array size
int n  : the value for search
int an : where it is position at input_array
return : the node before the value node
*/
struct Node* searchNode(int total_n,int n,int *an){
    if(debug) printf("searchNode begin\n");
    if(debug) printf("the value for search %d\n",n);
    int i;
    for(i=0;i<total_n;i++){
        struct Node *temp,*temp_before;
        temp_before = temp = input_array[i];
        /*if(debug)printf("i = %d temp->n = %d\n",i,temp->n);*/
        *an=i;  
        while(temp!=NULL){
            if(temp->n==n){              
                if(debug)printf("target = %d,position %d\n",n,*an);
                if(debug)printf("searchNode end\n");
                return temp_before;
            }
            temp_before = temp;
            temp = temp->next;          
        };      
    }
    if(debug) printf("searchNode return NULL \n");
    return NULL;
}

/*
when move comment,remove node from original position
return : the target node to move
*/
struct Node* removeByMove(struct Node* p){
    if(debug) printf("removeByMove begin\n");
    if(p==NULL){
        printf("p==NULL");
        return NULL;
    }
    struct Node *target = p->next;
  
    if(target==NULL)printf("target==NULL");
    p->next = target->next;
    if(debug) printf("removeByMove end\n");
    return target;
}

/*
when pile comment,remove node from original position
return : the target node to move
*/
struct Node* removeByPile(struct Node* p){
    if(p==NULL)if(debug)printf("p==NULL");
    struct Node *target = p->next;
  
    if(target==NULL)if(debug)printf("target==NULL");
    p->next = NULL;
    return target;
}

/*
move onto comment
*/
void moveOnto(struct Node* a,struct Node* b){

    /*after returning any blocks that are stacked on top of blocks a and b to their initial positions.*/
    /*
    struct Node* temp = a->next;
    while(temp!=NULL && temp->next!=NULL) temp=temp->next;
    returns(temp);
  
    temp = b->next;
    while(temp!=NULL && temp->next!=NULL) temp=temp->next;
    returns(temp);*/
  
  
    a->next = b->next;
    b->next = a;
}

/*
move over comment
*/
void moveOver(struct Node* a,struct Node* b){
    /*printf("a->n %d, b->n %d",a->n,b->n);*/
    /*
    struct Node* temp = a->next;
    while(temp!=NULL && temp->next!=NULL) temp=temp->next;
    returns(temp);*/
  
  
  
    while(b->next!=NULL){
        b=b->next;
    };
    b->next = a;
}

/*
pile onto comment
*/
void pileOnto(struct Node* a,struct Node* b){
    if(debug) printf("pileOnto begin\n");
    struct Node* b_next=b->next;
    b->next = a;
    while(a->next!=NULL) a=a->next;
    a->next=b_next;
    if(debug) printf("pileOnto end\n");
}

/*
pile over comment
*/
void pileOver(struct Node* a,struct Node* b){  
    if(debug) printf("pileOver begin\n");
    if(debug) printf("a:%d,b:%d\n",a->n,b->n);
    while(b->next!=NULL) {
        b=b->next;
        if(debug)    printf("b:%d",b->n);
    }
    b->next = a;
    if(debug) printf("pileOver end\n");
}

void freeArray(int n){
    if(debug) printf("freeArray begin\n");
    int i=0;
    for(i=0;i<n;i++){
        if(debug)printf("i %d\n",i);
        struct Node *temp,*tempFree;
        temp = input_array[i]->next;
        if(debug)printf("input_array[i] %d\n",input_array[i]->n);
        free(input_array[i]);
        if(debug)printf("free input_array %d\n",i);
        while(temp!=NULL){
            if(debug)printf("temp!=NULL\n");
            tempFree = temp;    
            if(debug)printf("tempFree = temp\n");  
            temp = temp->next;          
            if(debug)printf("temp = temp->next\n");
            free(tempFree);
            if(debug)printf("free(tempFree)\n");
        };      
    }
    free(input_array);
    if(debug) printf("freeArray end\n");
}
/*
void analizyComment(char *comment, char *comment_,int *a,int *b){

    char temp1[5],temp2[5];
    int ia,ib;
    sscanf (comment,"%s %d %s %d",temp1,a,temp2,b);

    strcat(temp1,temp2);
    strcpy(comment_,temp1);//死在這一行
    printf("%s %d %s %d\n",temp1,*a,temp2,*b);
}*/
int main(int argc, char *argv[])
{
    int input_n;
    scanf("%d",&input_n);
    /*char readc = getchar();/*read newline of scanf*/
    /*input_array = (struct Node**)malloc(sizeof(struct Node*));*/
    input_array = (struct Node**)malloc(sizeof(struct Node*)*input_n);
    initial(input_n);
    /*printArray(input_n);*/
    char input_c[25];
    /*fgets ( input_c, 25, stdin );*/
    int aa,bb,nna,nnb;
    char comment_[9],temp2[5];
    /*analizyComment(input_c,comment_,&aa,&bb);*/
    /*char quit[5]="quit";
  
    //do{*/
  
  
    while(scanf("%s",comment_))
    /*while(scanf("%s", comment_) && comment_[0] != 'q')*/
    /*while(cin>>comment_)*/
    {
        if(comment_[0] == 'q') break;
        scanf("%d %s %d",&aa,temp2,&bb);
        /*
        if(comment_=="quit") break;
        cin>>aa>>temp2>>bb;*/

        /*
        scanf("%d", &aa);
        scanf("%s", temp2);
        scanf("%d", &bb);*/
         /*//fscanf("%s",input_c);          
         //gets(input_c);        
         */
        
         if(debug)printf("debug:%s %d %s %d\n",comment_,aa,temp2,bb);
         struct Node *aNode,*bNode;
         /*//analizyComment(input_c,comment_,aa,bb);
         //sscanf (input_c,"%s %d %s %d",comment_,&aa,temp2,&bb);
         //strcat(comment_,temp2);*/
         aNode = searchNode(input_n,aa,&nna);              
         bNode = searchNode(input_n,bb,&nnb);
         /*//printf("nna %d,nnb %d",nna,nnb);*/
         if(nna==nnb){
            continue;
         }
         if(strcmp(comment_,"move")==0){
            returns(aNode->next);
            aNode = removeByMove(aNode);
            if(strcmp(temp2,"over")==0){
                                              
                moveOver(aNode,bNode->next);
            }else if(strcmp(temp2,"onto")==0){
                returns(bNode->next);
                moveOnto(aNode,bNode->next);
            }
         }else if(strcmp(comment_,"pile")==0){
            aNode = removeByPile(aNode);
            if(strcmp(temp2,"over")==0){  
                                          
                pileOver(aNode,bNode->next);
            }else if(strcmp(temp2,"onto")==0){
                returns(bNode->next);
                pileOnto(aNode,bNode->next);
            }
         }
         /*printArray(input_n);      
         /*fgets ( input_c, 25, stdin );*/
         /*sleep(2000);*/
         /*printf("%s %d\n",input_c,strcmp(input_c,"quit"));*/
    };
    /*//while(strcmp(input_c,quit)!=0);*/
        
    /*//printf("%d,%s",input_n,input_c);*/
    printArray(input_n);  
    freeArray(input_n);
    /*system("PAUSE");*/
 
    return 0;
}

102

#include <stdio.h>
#include <stdlib.h>
#include <string.h>

int b1,b2,b3,g1,g2,g3,c1,c2,c3;
int ans[6];
/*  
return b1+b2+b3+g1+g2+g3+c1+c2+c3;
printf("%d %d %d %d %d %d %d",
    b1,b2,b3,g1,g2,g3,c1,c2,c3);
*/
enum GGG{
    _BCG,_BGC,_CBG,_CGB,_GBC,_GCB
};
int BGC(){
    return b2+b3+g1+g3+c2+c1;
}
int BCG(){
    return b2+b3+g1+g2+c3+c1;
}
int GBC(){
    return b1+b3+g2+g3+c2+c1;
}
int GCB(){
    return b2+b1+g2+g3+c3+c1;
}
int CBG(){
    return b1+b3+g1+g2+c2+c3;
}
int CGB(){
    return b2+b1+g1+g3+c2+c3;
}
void myprint(){
    int i;
    printf("_BCG,_BGC,_CBG,_CGB,_GBC,_GCB\n");
    for(i=0;i<6;i++){      
        printf("%4d",ans[i]);
    }
}
int main()
{
  
    char *type[6]={"BCG","BGC","CBG","CGB","GBC","GCB"};
    while(scanf("%d %d %d %d %d %d %d %d %d",
    &b1,&g1,&c1,&b2,&g2,&c2,&b3,&g3,&c3)!=EOF){
      
        ans[_BGC]=BGC();
        ans[_BCG]=BCG();
        ans[_GBC]=GBC();      
        ans[_GCB]=GCB();
        ans[_CBG]=CBG();
        ans[_CGB]=CGB();
        int i=0;
        int _min=0;
        int min=ans[0];
        for(i=1;i<6;i++){
            if(ans[i]<ans[_min]){
                _min=i;
                min=ans[_min];
            }
        }
        printf("%s %d\n",type[_min],ans[_min]);
        /*myprint();*/
    }
  
    system("PAUSE");
 
    return 0;
}

103 DP 2dArray fgets sscanf

/*
http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=3&page=show_problem&problem=39
*/
#include <stdio.h>
#include <stdlib.h>
/*#include <string.h>*/
typedef enum __bool{  
    false=0,
    true=1,
}bool;

void print2d(int** a,int m,int n);
void al2d(int*** a,int m,int n);
void f2d(void*** a,int m);
void sort(int **a,int n){
    /*printf("sort %d ",n);*/
    int i,j,max;
    for(i=0;i<n-1;i++){
        max=i;
        /*printf("i = %d %d %d,",i,(*a)[i],&(*a)[i]);*/
        for(j=i+1;j<n;j++){
            /*printf("j = %d %d %d,",j,(*a)[j],&(*a)[j]);*/
            if((*a)[j]>(*a)[max]){
                max=j;              
            }
        }
        /*printf("max = %d %d,",max,(*a)[max]);*/
        if(max!=i){
            int t=(*a)[i];
            (*a)[i] = (*a)[max];
            (*a)[max] = t;
        }
        /*printf("\n");*/
    }
}

void atoi_n(int** input,char *c,int n){
    int i=0;
    /*c[strlen(c)-1]='1';*/
    int tn=n;
    while(n>0){
        int cc = atoi(c);
        /*printf("c %s\n",c);
        printf("cc %d\n",cc);*/
        (*input)[i] = cc;
        cc++;
        /*printf("%s",c);*/
        while((*c)!='\n' && (*c)!=' ' && (*c)!='\0'){
             /*printf("*c = %c %d,\n",*c,&c);*/
             c++;
             /*system("PAUSE");*/
        }
        c++;
        i++;
        n--;
    }
    sort(&(*input),tn);  
}

int AnetsB(int* A,int *B,int n){
    int i;
    for(i=0;i<n;i++){
        if((A)[i]<=(B)[i]){
            return 0;
        }
    }
    return 1;
}

void _AnetsB(int*** net,int **input,int m,int n){
    int i,j;
    for(i=0;i<m;i++){      
        for(j=0;j<m;j++){
            if(i==j){
                (*net)[i][j]=0;
                continue;
            }
            (*net)[i][j] = AnetsB(input[i],input[j],n);
        }
    }
}
void** creat2D(int m,int n){
    void** a;
    a = malloc(m*sizeof(int*));  
    int i,j;
    for(i=0;i<m;i++){
        a[i]= malloc(n*sizeof(int));      
    }
    return a;
}
int getMax(int *a,int n,int *c){
    int max=0;
    int i;
    for(i=0;i<n;i++){
        if(a[max]<a[i])
        {
            max=i;
        }
    }
    *c = max;
    return a[max];
}
void addDP(int ***a,int n){
    bool debug=true;
    int i=0,j,k;
    for(i=2;i<n;i++){
        for(j=0;j<n;j++){
            int count=0;          
            for(k=0;k<n;k++){
                if((*a)[j][k]>0){
                    count++;
                }
            }
            if(count==i){
                for(k=0;k<n;k++){
                    if((*a)[j][k]>0){
                        int t;
                        (*a)[j][k] += getMax((*a)[k],n,&t);
                    }
                }
            }
        }
    }

}

void printAns(int **a,int n){
    bool debug=false;
    int i,j;
    int max=0,maxLine;
    /*for(i=n-1;i>=0;i--){*/
    for(i=0;i<n;i++){
        for(j=0;j<n;j++){
            if(a[i][j]>max){
                max=a[i][j];
                maxLine=i;
            }
        }
    }
    printf("%d\n",max+1);
    /*printf("%d ",maxLine+1);*/
    int *ansS = malloc(max* sizeof(int));
    int top=0;
    ansS[top++] = maxLine+1;
    for(i=max;i>0;i--){  
        /*for(j=n-1;j>=0;j--){*/
        int column;
        if(debug)printf("ansS[top-1] %d ",ansS[top-1]);
        getMax(a[ansS[top-1]-1],n,&column);
        if(debug)printf("column %d \n",column+1);
        /*ansS[top++] = getMax(a[j],n);/*printf("%d ",j+1);*/
        ansS[top++] = column+1;
      
    }
    /*print1
    printf("%d",ansS[top-1]);
    for(j=top-2;j>=0;j--){
        printf(" %d",ansS[j]);
    }*/

    /*print2*/      
    for(j=top-1;j>0;j--){
        printf("%d ",ansS[j]);
    }
    printf("%d",ansS[0]);
  
    printf("\n");
    free(ansS);
}
int main()
{
    /*int *input1d;
    al1d(&input1d,5);
    print1d(input1d,5);*/
    bool debug=false;
    int **input;
    int **nets;
    int m,n;
    char line[512];
    /*while(scanf("%d %d",&m,&n)!=EOF){*/
    while(fgets(line,512,stdin)!= NULL){
        /*printf("\n%s",line);*/
        sscanf(line,"%d %d",&m,&n);
        /*printf("%d %d\n",m,n);*/
        if(m==0){
            printf("0\n\n");
            continue;
        }
        /*al2d(&input,m,n);*/
        input = (int**)creat2D(m,n);
/*        nets = (bool**)malloc(m*sizeof(bool*)+m*n*sizeof(bool));*/
        nets = (int**)creat2D(m,m);

        int co_line=0;
        while(co_line<m){
            fgets(line,512,stdin);
            /*putc('\0',line);*/
            /*printf("\n%s",line);*/
            atoi_n(&input[co_line],line,n);
            /*print2d(input,m,n);        */
            co_line++;          
        }
        int i,j;      

        if(debug)print2d(input,m,n);
        _AnetsB(&nets,input,m,n);
        if(debug)print2d(nets,m,m);
        addDP(&nets,m);
        if(debug)print2d(nets,m,m);
        if(m==1){
            printf("0\n\n");
        }
        else{
            printAns(nets,m);
        }
        f2d(&input,m);
        f2d(&nets,m);      
    }  
    if(debug)system("PAUSE");
    return 0;
}

void print2d(int** a,int m,int n){
    int i,j;
    printf("\n");
    for(i=0;i<m;i++){
        for(j=0;j<n;j++){
            printf("%d ",a[i][j]);
        }
        printf("\n");
    }
  
}
 
void print1d(int* pa,int m){
    int i;
    for(i=0;i<m;i++){
        printf("%d",pa[i]);
    }
}          
void al1d(int **pa,int m){
  
    *pa = malloc(sizeof(int)*m);
    int i;
    for(i=0;i<m;i++){
        (*pa)[i]=1;
        /*printf("%d",(pa[i]));*/
    }
    print1d(*pa,m);
}
void al2d(int*** a,int m,int n){
    *a = malloc(m*sizeof(int*));
  
    int i,j;
    for(i=0;i<m;i++){
        (*a)[i]= malloc(n*sizeof(int));
        for(j=0;j<n;j++){
            (*a)[i][j]= 0;
            /*printf("%d ",(*a)[i][j]);*/
        }
        /*printf("\n");*/
    }
    /*print2d(*a,m,n);*/
}
void f2d(void*** a,int m){
  
  
    int i,j;
    for(i=0;i<m;i++){
        free((*a)[i]);
    }
    free(*a);
}