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_20614172_12695.cpp:12:6: error: 'ans' does not name a type
      ans;        memset(vis,0,sizeof vis);        int maxin,p,flag=1;        while(flag)        {            flag=0,maxin=-1,p=0;            for(i=1;i<=n;i++)            {                if(!vis[i]&&maxin<in[i])                {                    flag=1;                    maxin=in[i];                    p=i;                }            }            if(flag)            {                vis[p]=1;                ans.push_back(p);                for(i=1;i<=n;i++)                {                    if(i==p) continue;                    if(s[p][i]=='1') in[i]--;                }            }        }        printf("%d",ans[ans.size()-1]);        for(i=ans.size()-2;i>=0;i--)            printf(" %d",ans[i]);        puts("");    }    return 0;}
      ^
0_0_20614172_12695.cpp:12:24: error: expected constructor, destructor, or type conversion before '(' token
      ans;        memset(vis,0,sizeof vis);        int maxin,p,flag=1;        while(flag)        {            flag=0,maxin=-1,p=0;            for(i=1;i<=n;i++)            {                if(!vis[i]&&maxin<in[i])                {                    flag=1;                    maxin=in[i];                    p=i;                }            }            if(flag)            {                vis[p]=1;                ans.push_back(p);                for(i=1;i<=n;i++)                {                    if(i==p) continue;                    if(s[p][i]=='1') in[i]--;                }            }        }        printf("%d",ans[ans.size()-1]);        for(i=ans.size()-2;i>=0;i--)            printf(" %d",ans[i]);        puts("");    }    return 0;}
                        ^
0_0_20614172_12695.cpp:12:78: error: expected unqualified-id before 'while'
      ans;        memset(vis,0,sizeof vis);        int maxin,p,flag=1;        while(flag)        {            flag=0,maxin=-1,p=0;            for(i=1;i<=n;i++)            {                if(!vis[i]&&maxin<in[i])                {                    flag=1;                    maxin=in[i];                    p=i;                }            }            if(flag)            {                vis[p]=1;                ans.push_back(p);                for(i=1;i<=n;i++)                {                    if(i==p) continue;                    if(s[p][i]=='1') in[i]--;                }            }        }        printf("%d",ans[ans.size()-1]);        for(i=ans.size()-2;i>=0;i--)            printf(" %d",ans[i]);        puts("");    }    return 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 09:51:02, Gzip enabled