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_20612785_16403.cpp:5:5: error: 'b' does not name a type
     b.pri;        return a.num>b.num;    }};int hash1[MAXN],h;priority_queue<node> Q[MAXN];int main(){    int n,x,y,r,cc;    char str[10];    while(scanf("%d",&n)==1)    {        h=0;        cc=1;        for(int i=0;i<=n;i++)            while(!Q[i].empty())                Q[i].pop();            memset(hash1,-1,sizeof(hash1));         while(n--)        {            node temp;            scanf("%s",str);            if(str[0]=='R')            {                scanf("%d %d",&x,&y);                if(hash1[x]==-1)                    hash1[x]=h++;                temp.num=cc++;                temp.pri=y;                Q[hash1[x]].push(temp);            }            else {                scanf("%d",&r);                if(hash1[r]==-1)                    hash1[r]==h++;                if(Q[hash1[r]].empty())                    printf("No one fits!\n");                else                {                    temp = Q[hash1[r]].top();                    printf("%s gets Num %d: %d %d!\n",str,temp.num,r,temp.pri);                    Q[hash1[r]].pop();                }            }        }    }    return 0;}
     ^
0_0_20612785_16403.cpp:5:19: error: expected unqualified-id before 'return'
     b.pri;        return a.num>b.num;    }};int hash1[MAXN],h;priority_queue<node> Q[MAXN];int main(){    int n,x,y,r,cc;    char str[10];    while(scanf("%d",&n)==1)    {        h=0;        cc=1;        for(int i=0;i<=n;i++)            while(!Q[i].empty())                Q[i].pop();            memset(hash1,-1,sizeof(hash1));         while(n--)        {            node temp;            scanf("%s",str);            if(str[0]=='R')            {                scanf("%d %d",&x,&y);                if(hash1[x]==-1)                    hash1[x]=h++;                temp.num=cc++;                temp.pri=y;                Q[hash1[x]].push(temp);            }            else {                scanf("%d",&r);                if(hash1[r]==-1)                    hash1[r]==h++;                if(Q[hash1[r]].empty())                    printf("No one fits!\n");                else                {                    temp = Q[hash1[r]].top();                    printf("%s gets Num %d: %d %d!\n",str,temp.num,r,temp.pri);                    Q[hash1[r]].pop();                }            }        }    }    return 0;}
                   ^
0_0_20612785_16403.cpp:5:42: error: expected declaration before '}' token
     b.pri;        return a.num>b.num;    }};int hash1[MAXN],h;priority_queue<node> Q[MAXN];int main(){    int n,x,y,r,cc;    char str[10];    while(scanf("%d",&n)==1)    {        h=0;        cc=1;        for(int i=0;i<=n;i++)            while(!Q[i].empty())                Q[i].pop();            memset(hash1,-1,sizeof(hash1));         while(n--)        {            node temp;            scanf("%s",str);            if(str[0]=='R')            {                scanf("%d %d",&x,&y);                if(hash1[x]==-1)                    hash1[x]=h++;                temp.num=cc++;                temp.pri=y;                Q[hash1[x]].push(temp);            }            else {                scanf("%d",&r);                if(hash1[r]==-1)                    hash1[r]==h++;                if(Q[hash1[r]].empty())                    printf("No one fits!\n");                else                {                    temp = Q[hash1[r]].top();                    printf("%s gets Num %d: %d %d!\n",str,temp.num,r,temp.pri);                    Q[hash1[r]].pop();                }            }        }    }    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 00:10:52, Gzip enabled