Online Judge | Problem Set | Authors | Online Contests | User | ||||||
---|---|---|---|---|---|---|---|---|---|---|
Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest |
Re:我靠!我也TLE了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: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator