F.A.Q
Hand In Hand
Online Acmers
Problem Archive
Realtime Judge Status
Authors Ranklist
 
     C/C++/Java Exams     
ACM Steps
Go to Job
Contest LiveCast
ICPC@China
Best Coder beta
VIP | STD Contests
    DIY | Web-DIY beta
Author ID 
Password 
 Register new ID

View Compilation Error

0_0_16138719_2842.cpp:1:50: error: stray '#' in program
 <li class="alt"><span><span class="preprocessor">#include <stdio.h></span><span>  </span></span></li><li class=""><span><span class="preprocessor">#include <string.h></span><span>  </span></span></li><li class="alt"><span><span class="preprocessor">#define Min(a,b) a<b?a:b;</span><span>  </span></span></li><li class=""><span><span class="datatypes">int</span><span> s[1005],ss[1005],ans[1005][1005],dp[1005];  </span></span></li><li class="alt"><span>  </span></li><li class=""><span><span class="datatypes">int</span><span> main(){  </span></span></li><li class="alt"><span>    <span class="datatypes">int</span><span> n,m,i,j,k;  </span></span></li><li class=""><span>    <span class="keyword">while</span><span>(~scanf(</span><span class="string">"%d%d"</span><span>,&n,&m),(n+m)){  </span></span></li><li class="alt"><span>        memset(dp,0,<span class="keyword">sizeof</span><span>(dp));  </span></span></li><li class=""><span>        memset(ans,0,<span class="keyword">sizeof</span><span>(ans));  </span></span></li><li class="alt"><span>        ss[0]=0;  </span></li><li class=""><span>        <span class="keyword">for</span><span>(i=0;i<n;i++){  </span></span></li><li class="alt"><span>            scanf(<span class="string">"%d"</span><span>,&s[i]);  </span></span></li><li class=""><span>            ss[i+1]=ss[i]+s[i];  </span></li><li class="alt"><span>        }  </span></li><li class=""><span>        <span class="keyword">for</span><span>(i=0;i<n;i++){  </span></span></li><li class="alt"><span>            <span class="keyword">for</span><span>(j=i+1;j<n;j++)  </span></span></li><li class=""><span>                ans[i][j]=ans[i][j-1]+s[j]*(ss[j]-ss[i]);  </span></li><li class="alt"><span>        }  </span></li><li class=""><span>        <span class="keyword">for</span><span>(i=0;i<n;i++)  </span></span></li><li class="alt"><span>            dp[i]=ans[0][i];  </span></li><li class=""><span>        <span class="keyword">for</span><span>(i=0;i<m;i++){  </span></span></li><li class="alt"><span>            <span class="keyword">for</span><span>(j=n-1;j>=0;j--){  </span></span></li><li class=""><span>                <span class="keyword">for</span><span>(k=i-1;k<j;k++)  </span></span></li><li class="alt"><span>                    dp[j]=Min(dp[j],dp[k]+ans[k+1][j]);  </span></li><li class=""><span>            }  </span></li><li class="alt"><span>        }  </span></li><li class=""><span>        printf(<span class="string">"%d\n"</span><span>,dp[n-1]);  </span></span></li><li class="alt"><span>    }  </span></li><li class=""><span>    <span class="keyword">return</span><span> 0;  </span></span></li><li class="alt"><span>}  </span></li>
                                                  ^
0_0_16138719_2842.cpp:1:163: error: stray '#' in program
 <li class="alt"><span><span class="preprocessor">#include <stdio.h></span><span>  </span></span></li><li class=""><span><span class="preprocessor">#include <string.h></span><span>  </span></span></li><li class="alt"><span><span class="preprocessor">#define Min(a,b) a<b?a:b;</span><span>  </span></span></li><li class=""><span><span class="datatypes">int</span><span> s[1005],ss[1005],ans[1005][1005],dp[1005];  </span></span></li><li class="alt"><span>  </span></li><li class=""><span><span class="datatypes">int</span><span> main(){  </span></span></li><li class="alt"><span>    <span class="datatypes">int</span><span> n,m,i,j,k;  </span></span></li><li class=""><span>    <span class="keyword">while</span><span>(~scanf(</span><span class="string">"%d%d"</span><span>,&n,&m),(n+m)){  </span></span></li><li class="alt"><span>        memset(dp,0,<span class="keyword">sizeof</span><span>(dp));  </span></span></li><li class=""><span>        memset(ans,0,<span class="keyword">sizeof</span><span>(ans));  </span></span></li><li class="alt"><span>        ss[0]=0;  </span></li><li class=""><span>        <span class="keyword">for</span><span>(i=0;i<n;i++){  </span></span></li><li class="alt"><span>            scanf(<span class="string">"%d"</span><span>,&s[i]);  </span></span></li><li class=""><span>            ss[i+1]=ss[i]+s[i];  </span></li><li class="alt"><span>        }  </span></li><li class=""><span>        <span class="keyword">for</span><span>(i=0;i<n;i++){  </span></span></li><li class="alt"><span>            <span class="keyword">for</span><span>(j=i+1;j<n;j++)  </span></span></li><li class=""><span>                ans[i][j]=ans[i][j-1]+s[j]*(ss[j]-ss[i]);  </span></li><li class="alt"><span>        }  </span></li><li class=""><span>        <span class="keyword">for</span><span>(i=0;i<n;i++)  </span></span></li><li class="alt"><span>            dp[i]=ans[0][i];  </span></li><li class=""><span>        <span class="keyword">for</span><span>(i=0;i<m;i++){  </span></span></li><li class="alt"><span>            <span class="keyword">for</span><span>(j=n-1;j>=0;j--){  </span></span></li><li class=""><span>                <span class="keyword">for</span><span>(k=i-1;k<j;k++)  </span></span></li><li class="alt"><span>                    dp[j]=Min(dp[j],dp[k]+ans[k+1][j]);  </span></li><li class=""><span>            }  </span></li><li class="alt"><span>        }  </span></li><li class=""><span>        printf(<span class="string">"%d\n"</span><span>,dp[n-1]);  </span></span></li><li class="alt"><span>    }  </span></li><li class=""><span>    <span class="keyword">return</span><span> 0;  </span></span></li><li class="alt"><span>}  </span></li>
                                                                                                                                                                   ^
0_0_16138719_2842.cpp:1:280: error: stray '#' in program
 <li class="alt"><span><span class="preprocessor">#include <stdio.h></span><span>  </span></span></li><li class=""><span><span class="preprocessor">#include <string.h></span><span>  </span></span></li><li class="alt"><span><span class="preprocessor">#define Min(a,b) a<b?a:b;</span><span>  </span></span></li><li class=""><span><span class="datatypes">int</span><span> s[1005],ss[1005],ans[1005][1005],dp[1005];  </span></span></li><li class="alt"><span>  </span></li><li class=""><span><span class="datatypes">int</span><span> main(){  </span></span></li><li class="alt"><span>    <span class="datatypes">int</span><span> n,m,i,j,k;  </span></span></li><li class=""><span>    <span class="keyword">while</span><span>(~scanf(</span><span class="string">"%d%d"</span><span>,&n,&m),(n+m)){  </span></span></li><li class="alt"><span>        memset(dp,0,<span class="keyword">sizeof</span><span>(dp));  </span></span></li><li class=""><span>        memset(ans,0,<span class="keyword">sizeof</span><span>(ans));  </span></span></li><li class="alt"><span>        ss[0]=0;  </span></li><li class=""><span>        <span class="keyword">for</span><span>(i=0;


Hangzhou Dianzi University Online Judge 3.0
Copyright © 2005-2024 HDU ACM Team. All Rights Reserved.
Designer & Developer : Wang Rongtao LinLe GaoJie GanLu
Total 0.000000(s) query 1, Server time : 2024-12-05 07:30:53, Gzip enabled