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_20613416_12715.cpp:5:5: error: expected unqualified-id before '>=' token
     >=1;    }    return ret;}int main(){    scanf("%d",&t);    for(int ca = 1; ca <= t; ca ++){        scanf("%d%d",&n,&m); init();        for(int i = 1; i <= n;i ++){            scanf("%d",a + i);            if(a[i] < 0) odd_num++;        }        sort(a + 1, a + 1 + n);        if(odd_num & 1){            int j = 1;            while(a[j] < 0) j ++;   indx = -- j;            if(a[j] + m > 0) m += a[j], a[j] = 0;            else a[j] += m,m = 0;        }        if(m > 0){            for(int j = indx; j <= n && m > 0; j ++)                if(a[j] == 0) a[j] ++, m --;            for(int j = indx; j <= n && m > 0; j ++)                if(a[j] == 1) a[j] ++, m --;            for(int j = indx; j <= n && m > 0; j ++)                if(a[j] == 2) a[j] ++, m --;            for(int j = 1; j <= n; j ++)                ans = (ans * a[j]) % mod;            if(m <= 0){                printf("Case %d: %I64d\n",ca,ans);            }else{                if(m == 1){                    for(int j = 1; j <= n; j ++)                        if(Min > a[j]) Min = a[j], Minpos = j;                    ans /= a[Minpos];                    ans = (ans * (a[Minpos] + 1)) % mod;                    printf("Case %d: %I64d\n",ca,ans);                }else if(m % 3 == 0){                    ans = (ans * pow_mod(3,m/3,mod)) % mod;                    printf("Case %d: %I64d\n",ca,ans);                }else if((m - 1) % 3 == 0){                    ans = (ans * pow_mod(3,(m - 1)/3 - 1,mod)) % mod;                    ans = (ans * 4) % mod;                    printf("Case %d: %I64d\n",ca,ans);                }else if((m - 2) % 3 == 0){                    ans = (ans * pow_mod(3,(m - 2)/3,mod)) % mod;                    ans = (ans * 2) % mod;                    printf("Case %d: %I64d\n",ca,ans);                }            }        }        else{            for(int j = 1; j <= n; j ++)                ans = (ans * a[j]) % mod;            printf("Case %d: %I64d\n",ca,ans);        }    }    return 0;}
     ^
0_0_20613416_12715.cpp:5:13: error: expected declaration before '}' token
     >=1;    }    return ret;}int main(){    scanf("%d",&t);    for(int ca = 1; ca <= t; ca ++){        scanf("%d%d",&n,&m); init();        for(int i = 1; i <= n;i ++){            scanf("%d",a + i);            if(a[i] < 0) odd_num++;        }        sort(a + 1, a + 1 + n);        if(odd_num & 1){            int j = 1;            while(a[j] < 0) j ++;   indx = -- j;            if(a[j] + m > 0) m += a[j], a[j] = 0;            else a[j] += m,m = 0;        }        if(m > 0){            for(int j = indx; j <= n && m > 0; j ++)                if(a[j] == 0) a[j] ++, m --;            for(int j = indx; j <= n && m > 0; j ++)                if(a[j] == 1) a[j] ++, m --;            for(int j = indx; j <= n && m > 0; j ++)                if(a[j] == 2) a[j] ++, m --;            for(int j = 1; j <= n; j ++)                ans = (ans * a[j]) % mod;            if(m <= 0){                printf("Case %d: %I64d\n",ca,ans);            }else{                if(m == 1){                    for(int j = 1; j <= n; j ++)                        if(Min > a[j]) Min = a[j], Minpos = j;                    ans /= a[Minpos];                    ans = (ans * (a[Minpos] + 1)) % mod;                    printf("Case %d: %I64d\n",ca,ans);                }else if(m % 3 == 0){                    ans = (ans * pow_mod(3,m/3,mod)) % mod;                    printf("Case %d: %I64d\n",ca,ans);                }else if((m - 1) % 3 == 0){                    ans = (ans * pow_mod(3,(m - 1)/3 - 1,mod)) % mod;                    ans = (ans * 4) % mod;                    printf("Case %d: %I64d\n",ca,ans);                }else if((m - 2) % 3 == 0){                    ans = (ans * pow_mod(3,(m - 2)/3,mod)) % mod;                    ans = (ans * 2) % mod;                    printf("Case %d: %I64d\n",ca,ans);                }            }        }        else{            for(int j = 1; j <= n; j ++)                ans = (ans * a[j]) % mod;            printf("Case %d: %I64d\n",ca,ans);        }    }    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-11-23 02:28:52, Gzip enabled