Online JudgeProblem SetAuthorsOnline ContestsUser
Web Board
Home Page
F.A.Qs
Statistical Charts
Problems
Submit Problem
Online Status
Prob.ID:
Register
Update your info
Authors ranklist
Current Contest
Past Contests
Scheduled Contests
Award Contest
User ID:
Password:
  Register

Re:我靠!我也TLE了

Posted by hushuoqiu at 2005-09-18 23:16:38 on Problem 1163
In Reply To:Re:我靠!我也TLE了 Posted by:ykt at 2005-09-14 21:24:30
#include <iostream>
//#include <stdlib.h>
#include <vector>
using namespace std;

int main(int argc, char *argv[])
{
  int N,i,t,j;
  cin>>N;
  vector<int> tri;
  tri.push_back(N);
  for(i=1;i<=(1+N)*N/2;i++) {cin>>t;tri.push_back(t);}
  for(i=N-1;i>=1;i--)
      for(j=1;j<=i;j++)
      {
          tri[(i-1+1)*(i-1)/2+j]+=tri[(1+i)*i/2+j]>tri[(1+i)*i/2+j+1]?tri[(1+i)*i/2+j]:tri[(1+i)*i/2+j+1];
      }
  cout<<tri[1];
  //system("PAUSE");	
  return 0;
}
我的思路和你得相当不同
能不能详细讲一下你的意思?

Followed by:

Post your reply here:
User ID:
Password:
Title:

Content:

Home Page   Go Back  To top


All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator