记录 LCS

PKU 2250 http://acm.pku.edu.cn/JudgeOnline/problem?id=2250

 

没啥,,就LCS 记录

贴下代码无聊下,,,,http://acm.pku.edu.cn/JudgeOnline/problem?id=2250

void PRINT(int i,int j)
{
 string ANS[nmax];
 int len =0;
 int t=10;
 while(Max>=0)
 {
  if( col [ i ][ j ] == 0  )
  {
   ANS[len] = b[j];
   //cout<<ANS[len];
   len++;
   i--;
   j--;
   Max--;

  }
  else if( col [ i ][ j ] == 1   )
  {
   i--;

  }
  else if( col [ i ][ j ] == 2   )
  {

   j--;
  }
 }
 for ( int i1 = len-2; i1 > 0; i1 -- )
 {
  cout<<ANS[i1]<<" ";
 }
 cout<<ANS[0]<<endl;

}

posted @ 2010-04-22 13:46  吴豆豆  阅读(116)  评论(0编辑  收藏  举报