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_28916981_9277.cpp: In function 'int main()':
0_0_28916981_9277.cpp:4:146: error: expected '}' at end of input
 int main(void){        int T;cin>>T;        while(T--)        {            int n;            cin>>n;               for(int i=0;i<n;i++) cin>>b[i];            //n = unique(b,b+n) - b;// È¥ÖØÓÅÐã²Ù×÷             sort(b,b+n);             int sum=0;            int flag=1;            for(int i=1;i<n-1;i++)              {                sum+=(b[n-1]-b[i]);                   if(sum>=b[0]) {flag=0;break;}              }            sum+=b[n-1]-b[0];            if(!flag) cout<<"-1"<<endl;            else cout<<sum<<endl;        }}
                                                                                                                                                  ^
0_0_28916981_9277.cpp:4:146: error: expected '}' at end of input


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-02 05:08:34, Gzip enabled