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_20614013_9914.cpp:12:21: error: '#' is not followed by a macro parameter
     #define lowbit(x) (x & (-x))#define mp(a,b) make_pair (a , b)#pragma comment(linker, "/STACK:1024000000,1024000000")    using namespace std;typedef long long LL;const int N = 100005;typedef pair<int , int>
                     ^
0_0_20614013_9914.cpp:13:6: error: 'pii' does not name a type
      pii;struct Node {    int x , y , z , id;    void input () {        scanf ("%d %d %d" , &x , &y, &z);    }    bool operator < (const Node &n) const {        return x != n.x ? x < n.x : (y != n.y ? y < n.y : z < n.z);    }}a[N] , b[N];int x[N] , m , n;pii dp[N] , bit[N];void update (pii &a , pii b) {    if (b.first > a.first) a = b;    else if (b.first == a.first) a.second += b.second;}void init () {    for (int i = 1 ; i <= m ; i ++)        bit[i] = mp(0 , 0);}void add (int idx , pii val) {    for (int i = idx ; i <= m ; i += lowbit (i))        update (bit[i] , val);}pii ask (int idx) {    pii ans = mp (0 , 0);    for (int i = idx ; i > 0 ; i -= lowbit (i))        update (ans , bit[i]);    return ans;}void clear (int idx) {    for (int i = idx ; i <= m ; i += lowbit (i))        bit[i] = mp (0 , 0);}void gao (int l , int r) {    if (l == r) return ;    int mid = (l + r) >> 1;    gao (l , mid);    int cnt = 0;    for (int i = l ; i <= r ; i ++) {        b[cnt ++] = a[i];        b[cnt - 1].x = 0;    }    sort (b , b + cnt);    for (int i = 0 ; i < cnt ; i ++) {        if (b[i].id <= mid) {            add (b[i].z , dp[b[i].id]);        }        else {            pii t = ask (b[i].z);            t.first ++;            update (dp[b[i].id] , t);        }    }    for (int i = 0 ; i < cnt ; i ++)        if (b[i].id <= mid)            clear (b[i].z);    gao (mid + 1 , r);}int main () {    int t ;    scanf ("%d" , &t);    while (t --) {        scanf ("%d" , &n);        for (int i = 0 ; i < n ; i ++) {            a[i].input ();            x[i] = a[i].z;            dp[i] = mp (1 , 1);        }        sort (x , x + n);        m = unique (x , x + n) - x;        for (int i = 0 ; i < n ; i ++)            a[i].z = lower_bound (x , x + m , a[i].z) - x + 1;        sort (a , a + n);        for (int i = 0 ; i < n ; i ++)            a[i].id = i;        init ();        gao (0 , n - 1);        pii ans = mp (0 , 0);        for (int i = 0 ; i < n ; i ++) {            update (ans , dp[i]);        }        printf ("%d %d\n" , ans.first , ans.second);    }    return 0;}
      ^
0_0_20614013_9914.cpp:13:229: error: 'N' was not declared in this scope
      pii;struct Node {    int x , y , z , id;    void input () {        scanf ("%d %d %d" , &x , &y, &z);    }    bool operator < (const Node &n) const {        return x != n.x ? x < n.x : (y != n.y ? y < n.y : z < n.z);    }}a[N] , b[N];int x[N] , m , n;pii dp[N] , bit[N];void update (pii &a , pii b) {    if (b.first > a.first) a = b;    else if (b.first == a.first) a.second += b.second;}void init () {    for (int i = 1 ; i <= m ; i ++)        bit[i] = mp(0 , 0);}void add (int idx , pii val) {    for (int i = idx ; i <= m ; i += lowbit (i))        update (bit[i] , val);}pii ask (int idx) {    pii ans = mp (0 , 0);    for (int i = idx ; i > 0 ; i -= lowbit (i))        update (ans , bit[i]);    return ans;}void clear (int idx) {    for (int i = idx ; i <= m ; i += lowbit (i))        bit[i] = mp (0 , 0);}void gao (int l , int r) {    if (l == r) return ;    int mid = (l + r) >> 1;    gao (l , mid);    int cnt = 0;    for (int i = l ; i <= r ; i ++) {        b[cnt ++] = a[i];        b[cnt - 1].x = 0;    }    sort (b , b + cnt);    for (int i = 0 ; i < cnt ; i ++) {        if (b[i].id <= mid) {            add (b[i].z , dp[b[i].id]);        }        else {            pii t = ask (b[i].z);            t.first ++;            update (dp[b[i].id] , t);        }    }    for (int i = 0 ; i < cnt ; i ++)        if (b[i].id <= mid)            clear (b[i].z);    gao (mid + 1 , r);}int main () {    int t ;    scanf ("%d" , &t);    while (t --) {        scanf ("%d" , &n);        for (int i = 0 ; i < n ; i ++) {            a[i].input ();            x[i] = a[i].z;            dp[i] = mp (1 , 1);        }        sort (x , x + n);        m = unique (x , x + n) - x;        for (int i = 0 ; i < n ; i ++)            a[i].z = lower_bound (x , x + m , a[i].z) - x + 1;        sort (a , a + n);        for (int i = 0 ; i < n ; i ++)            a[i].id = i;        init ();        gao (0 , n - 1);        pii ans = mp (0 , 0);        for (int i = 0 ; i < n ; i ++) {            update (ans , dp[i]);        }        printf ("%d %d\n" , ans.first , ans.second);    }    return 0;}
                                                                                                                                                                                                                                     ^
0_0_20614013_9914.cpp:13:236: error: 'N' was not declared in this scope
      pii;struct Node {    int x , y , z , id;    void input () {        scanf ("%d %d %d" , &x , &y, &z);    }    bool operator < (const Node &n) const {        return x != n.x ? x < n.x : (y != n.y ? y < n.y : z < n.z);    }}a[N] , b[N];int x[N] , m , n;pii dp[N] , bit[N];void update (pii &a , pii b) {    if (b.first > a.first) a = b;    else if (b.first == a.first) a.second += b.second;}void init () {    for (int i = 1 ; i <= m ; i ++)        bit[i] = mp(0 , 0);}void add (int idx , pii val) {    for (int i = idx ; i <= m ; i += lowbit (i))        update (bit[i] , val);}pii ask (int idx) {    pii ans = mp (0 , 0);    for (int i = idx ; i > 0 ; i -= lowbit (i))        update (ans , bit[i]);    return ans;}void clear (int idx) {    for (int i = idx ; i <= m ; i += lowbit (i))        bit[i] = mp (0 , 0);}void gao (int l , int r) {    if (l == r) return ;    int mid = (l + r) >> 1;    gao (l , mid);    int cnt = 0;    for (int i = l ; i <= r ; i ++) {        b[cnt ++] = a[i];        b[cnt - 1].x = 0;    }    sort (b , b + cnt);    for (int i = 0 ; i < cnt ; i ++) {        if (b[i].id <= mid) {            add (b[i].z , dp[b[i].id]);        }        else {            pii t = ask (b[i].z);            t.first ++;            update (dp[b[i].id] , t);        }    }    for (int i = 0 ; i < cnt ; i ++)        if (b[i].id <= mid)            clear (b[i].z);    gao (mid + 1 , r);}int main () {    int t ;    scanf ("%d" , &t);    while (t --) {        scanf ("%d" , &n);        for (int i = 0 ; i < n ; i ++) {            a[i].input ();            x[i] = a[i].z;            dp[i] = mp (1 , 1);        }        sort (x , x + n);        m = unique (x , x + n) - x;        for (int i = 0 ; i < n ; i ++)            a[i].z = lower_bound (x , x + m , a[i].z) - x + 1;        sort (a , a + n);        for (int i = 0 ; i < n ; i ++)            a[i].id = i;        init ();        gao (0 , n - 1);        pii ans = mp (0 , 0);        for (int i = 0 ; i < n ; i ++) {            update (ans , dp[i]);        }        printf ("%d %d\n" , ans.first , ans.second);    }    return 0;}
                                                                                                                                                                                                                                            ^
0_0_20614013_9914.cpp:13:245: error: 'N' was not declared in this scope
      pii;struct Node {    int x , y , z , id;    void input () {        scanf ("%d %d %d" , &x , &y, &z);    }    bool operator < (const Node &n) const {        return x != n.x ? x < n.x : (y != n.y ? y < n.y : z < n.z);    }}a[N] , b[N];int x[N] , m , n;pii dp[N] , bit[N];void update (pii &a , pii b) {    if (b.first > a.first) a = b;    else if (b.first == a.first) a.second += b.second;}void init () {    for (int i = 1 ; i <= m ; i ++)        bit[i] = mp(0 , 0);}void add (int idx , pii val) {    for (int i = idx ; i <= m ; i += lowbit (i))        update (bit[i] , val);}pii ask (int idx) {    pii ans = mp (0 , 0);    for (int i = idx ; i > 0 ; i -= lowbit (i))        update (ans , bit[i]);    return ans;}void clear (int idx) {    for (int i = idx ; i <= m ; i += lowbit (i))        bit[i] = mp (0 , 0);}void gao (int l , int r) {    if (l == r) return ;    int mid = (l + r) >> 1;    gao (l , mid);    int cnt = 0;    for (int i = l ; i <= r ; i ++) {        b[cnt ++] = a[i];        b[cnt - 1].x = 0;    }    sort (b , b + cnt);    for (int i = 0 ; i < cnt ; i ++) {        if (b[i].id <= mid) {            add (b[i].z , dp[b[i].id]);        }        else {            pii t = ask (b[i].z);            t.first ++;            update (dp[b[i].id] , t);        }    }    for (int i = 0 ; i < cnt ; i ++)        if (b[i].id <= mid)            clear (b[i].z);    gao (mid + 1 , r);}int main () {    int t ;    scanf ("%d" , &t);    while (t --) {        scanf ("%d" , &n);        for (int i = 0 ; i < n ; i ++) {            a[i].input ();            x[i] = a[i].z;            dp[i] = mp (1 , 1);        }        sort (x , x + n);        m = unique (x , x + n) - x;        for (int i = 0 ; i < n ; i ++)            a[i].z = lower_bound (x , x + m , a[i].z) - x + 1;        sort (a , a + n);        for (int i = 0 ; i < n ; i ++)            a[i].id = i;        init ();        gao (0 , n - 1);        pii ans = mp (0 , 0);        for (int i = 0 ; i < n ; i ++) {            update (ans , dp[i]);        }        printf ("%d %d\n" , ans.first , ans.second);    }    return 0;}
                                                                                                                                                                                                                                                     ^
0_0_20614013_9914.cpp:13:256: error: 'pii' does not name a type
      pii;struct Node {    int x , y , z , id;    void input () {        scanf ("%d %d %d" , &x , &y, &z);    }    bool operator < (const Node &n) const {        return x != n.x ? x < n.x : (y != n.y ? y < n.y : z < n.z);    }}a[N] , b[N];int x[N] , m , n;pii dp[N] , bit[N];void update (pii &a , pii b) {    if (b.first > a.first) a = b;    else if (b.first == a.first) a.second += b.second;}void init () {    for (int i = 1 ; i <= m ; i ++)        bit[i] = mp(0 , 0);}v


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-01 04:58:44, Gzip enabled