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_13805730_11868.cpp:3:77: error: 'priority_queue' does not name a type
     const bool operator<(struct ss b) const {        return a > b.a;    };};priority_queue<ss>s[705];int a[101];
                                                                             ^
0_0_13805730_11868.cpp: In function 'int main()':
0_0_13805730_11868.cpp:5:55: error: 's' was not declared in this scope
         for (i = 1; i <= 700; i++)            while (!s[i].empty())s[i].pop();        for (i = 0; i < n; i++)scanf("%d", &a[i]);        for (i = 1; i <= m; i++)            scanf("%d %d", &x, &h.a), s[x].push(h);        sort(a, a + n);        t = 1;        die = live = 0;        while (die + live < m) {            i = 0;            while (i < n && s[t].size() > 0) {                h = s[t].top();                if (h.a >= a[i]) {                    die++;                    i++;                }                else if (h.a - 1 >= a[0]) {                    h.a -= 1;                    s[t + 1].push(h);                }                else    live++;                s[t].pop();            }            while (s[t].size() > 0) {                h = s[t].top(), s[t].pop();                if (h.a - 1 >= a[0]) {                    h.a -= 1;                    s[t + 1].push(h);                } else live++;            }            t++;        }        printf("%d\n", die);    }    return 0;}
                                                       ^
0_0_13805730_11868.cpp:5:199: error: 's' was not declared in this scope
         for (i = 1; i <= 700; i++)            while (!s[i].empty())s[i].pop();        for (i = 0; i < n; i++)scanf("%d", &a[i]);        for (i = 1; i <= m; i++)            scanf("%d %d", &x, &h.a), s[x].push(h);        sort(a, a + n);        t = 1;        die = live = 0;        while (die + live < m) {            i = 0;            while (i < n && s[t].size() > 0) {                h = s[t].top();                if (h.a >= a[i]) {                    die++;                    i++;                }                else if (h.a - 1 >= a[0]) {                    h.a -= 1;                    s[t + 1].push(h);                }                else    live++;                s[t].pop();            }            while (s[t].size() > 0) {                h = s[t].top(), s[t].pop();                if (h.a - 1 >= a[0]) {                    h.a -= 1;                    s[t + 1].push(h);                } else live++;            }            t++;        }        printf("%d\n", die);    }    return 0;}
                                                                                                                                                                                                       ^
0_0_13805730_11868.cpp:5:233: error: 'sort' was not declared in this scope
         for (i = 1; i <= 700; i++)            while (!s[i].empty())s[i].pop();        for (i = 0; i < n; i++)scanf("%d", &a[i]);        for (i = 1; i <= m; i++)            scanf("%d %d", &x, &h.a), s[x].push(h);        sort(a, a + n);        t = 1;        die = live = 0;        while (die + live < m) {            i = 0;            while (i < n && s[t].size() > 0) {                h = s[t].top();                if (h.a >= a[i]) {                    die++;                    i++;                }                else if (h.a - 1 >= a[0]) {                    h.a -= 1;                    s[t + 1].push(h);                }                else    live++;                s[t].pop();            }            while (s[t].size() > 0) {                h = s[t].top(), s[t].pop();                if (h.a - 1 >= a[0]) {                    h.a -= 1;                    s[t + 1].push(h);                } else live++;            }            t++;        }        printf("%d\n", die);    }    return 0;}
                                                                                                                                                                                                                                         ^
0_0_13805730_11868.cpp:5:350: error: 's' was not declared in this scope
         for (i = 1; i <= 700; i++)            while (!s[i].empty())s[i].pop();        for (i = 0; i < n; i++)scanf("%d", &a[i]);        for (i = 1; i <= m; i++)            scanf("%d %d", &x, &h.a), s[x].push(h);        sort(a, a + n);        t = 1;        die = live = 0;        while (die + live < m) {            i = 0;            while (i < n && s[t].size() > 0) {                h = s[t].top();                if (h.a >= a[i]) {                    die++;                    i++;                }                else if (h.a - 1 >= a[0]) {                    h.a -= 1;                    s[t + 1].push(h);                }                else    live++;                s[t].pop();            }            while (s[t].size() > 0) {                h = s[t].top(), s[t].pop();                if (h.a - 1 >= a[0]) {                    h.a -= 1;                    s[t + 1].push(h);                } else live++;            }            t++;        }        printf("%d\n", die);    }    return 0;}
                                                                                                                                                                                                                                                                                                                                                              ^
0_0_13805730_11868.cpp:5:716: error: 's' was not declared in this scope
         for (i = 1; i <= 700; i++)            while (!s[i].empty())s[i].pop();        for (i = 0; i < n; i++)scanf("%d", &a[i]);        for (i = 1; i <= m; i++)            scanf("%d %d", &x, &h.a), s[x].push(h);        sort(a, a + n);        t = 1;        die = live = 0;        while (die + live < m) {            i = 0;            while (i < n && s[t].size() > 0) {                h = s[t].top();                if (h.a >= a[i]) {                    die++;                    i++;                }                else if (h.a - 1 >= a[0]) {                    h.a -= 1;                    s[t + 1].push(h);                }                else    live++;                s[t].pop();            }            while (s[t].size() > 0) {                h = s[t].top(), s[t].pop();                if (h.a - 1 >= a[0]) {                    h.a -= 1;                    s[t + 1].push(h);                } else live++;            }            t++;        }        printf("%d\n", die);    }    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-02 09:46:28, Gzip enabled