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_20613219_18234.cpp:8:6: error: 'ans' does not name a type
      ans;int main(){    int t, n, x, A, B;    scanf("%d", &t);    while(t--)    {        memset(num, 0, sizeof(num));        ans.clear();        scanf("%d", &n);        for(int i = 0; i < n; ++ i)        {            scanf("%d",&x);            num[x]++;        }        scanf("%d%d", &A, &B);        for(int i = 1; i <= n; ++ i)        {            for(int j = 0; j <= A; ++ j)            {                int lie = n-num[i];                if(i-j >= 0 && lie-j >= 0 && (n-(i-j+lie) >= 0 && n-(i-j+lie) <= B))                {                    ans.push_back(i);                    break;                }            }        }        if((int)ans.size() == 0)            printf("impossible\n");        else        {            int len = ans.size();            for(int i = 0; i < len-1; ++ i)                printf("%d ", ans[i]);            printf("%d\n", ans[len-1]);        }    }    return 0;}
      ^
0_0_20613219_18234.cpp: In function 'int main()':
0_0_20613219_18234.cpp:8:97: error: 'num' was not declared in this scope
      ans;int main(){    int t, n, x, A, B;    scanf("%d", &t);    while(t--)    {        memset(num, 0, sizeof(num));        ans.clear();        scanf("%d", &n);        for(int i = 0; i < n; ++ i)        {            scanf("%d",&x);            num[x]++;        }        scanf("%d%d", &A, &B);        for(int i = 1; i <= n; ++ i)        {            for(int j = 0; j <= A; ++ j)            {                int lie = n-num[i];                if(i-j >= 0 && lie-j >= 0 && (n-(i-j+lie) >= 0 && n-(i-j+lie) <= B))                {                    ans.push_back(i);                    break;                }            }        }        if((int)ans.size() == 0)            printf("impossible\n");        else        {            int len = ans.size();            for(int i = 0; i < len-1; ++ i)                printf("%d ", ans[i]);            printf("%d\n", ans[len-1]);        }    }    return 0;}
                                                                                                 ^
0_0_20613219_18234.cpp:8:126: error: 'ans' was not declared in this scope
      ans;int main(){    int t, n, x, A, B;    scanf("%d", &t);    while(t--)    {        memset(num, 0, sizeof(num));        ans.clear();        scanf("%d", &n);        for(int i = 0; i < n; ++ i)        {            scanf("%d",&x);            num[x]++;        }        scanf("%d%d", &A, &B);        for(int i = 1; i <= n; ++ i)        {            for(int j = 0; j <= A; ++ j)            {                int lie = n-num[i];                if(i-j >= 0 && lie-j >= 0 && (n-(i-j+lie) >= 0 && n-(i-j+lie) <= B))                {                    ans.push_back(i);                    break;                }            }        }        if((int)ans.size() == 0)            printf("impossible\n");        else        {            int len = ans.size();            for(int i = 0; i < len-1; ++ i)                printf("%d ", ans[i]);            printf("%d\n", ans[len-1]);        }    }    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-30 03:23:06, Gzip enabled