0_0_20612332_5077.cpp:5:5: error: expected unqualified-id before '>' token
> 1, ls = cur << 1, rs = cur << 1 | 1; cnt[cur] = dep[cur] = len[cur] = 0, ml[cur] = y - x + 1; if(x == y) return ; build(ls, x, mid), build(rs, mid + 1, y);}void init(){ int i, x1, x2, y1, y2; scanf("%d%d", &W, &H); for(i = 0; i < N; i ++) { scanf("%d%d%d%d", &x1, &y1, &x2, &y2); seg[i << 1] = Seg(x1, y1, y2, 1), seg[i << 1 | 1] = Seg(x2, y1, y2, -1); } std::sort(seg, seg + 2 * N); build(1, 1, H);}void update(int cur, int x, int y){ int ls = cur << 1, rs = cur << 1 | 1; if(dep[ls] > dep[rs]) dep[cur] = dep[ls], ml[cur] = ml[ls]; else if(dep[rs] > dep[ls]) dep[cur] = dep[rs], ml[cur] = ml[rs]; else dep[cur] = dep[ls], ml[cur] = ml[ls] + ml[rs]; dep[cur] += cnt[cur]; if(cnt[cur]) len[cur] = y - x + 1; else len[cur] = len[ls] + len[rs];}void refresh(int cur, int x, int y, int s, int t, int c){ int mid = x + y >> 1, ls = cur << 1, rs = cur << 1 | 1; if(x >= s && y <= t) { cnt[cur] += c; if(c > 0) ++ dep[cur], len[cur] = y - x + 1; else { -- dep[cur]; if(cnt[cur]) len[cur] = y - x + 1; else { if(x == y) len[cur] = 0; else len[cur] = len[ls] + len[rs]; } } return ; } if(mid >= s) refresh(ls, x, mid, s, t, c); if(mid + 1 <= t) refresh(rs, mid + 1, y, s, t, c); update(cur, x, y);}void solve(){ int i, md, ans, area; area = md = ans = 0; seg[2 * N].x = seg[2 * N - 1].x; for(i = 0; i < 2 * N; i ++) { refresh(1, 1, H, seg[i].y1 + 1, seg[i].y2, seg[i].c); area += len[1] * (seg[i + 1].x - seg[i].x); if(dep[1] > md) md = dep[1], ans = ml[1] * (seg[i + 1].x - seg[i].x); else if(dep[1] == md) ans += ml[1] * (seg[i + 1].x - seg[i].x); } printf("%d %d %d\n", W * H - area, md, ans);}int main(){ while(scanf("%d", &N), N) { init(); solve(); } return 0; }
^
0_0_20612332_5077.cpp:5:47: error: 'cnt' does not name a type
> 1, ls = cur << 1, rs = cur << 1 | 1; cnt[cur] = dep[cur] = len[cur] = 0, ml[cur] = y - x + 1; if(x == y) return ; build(ls, x, mid), build(rs, mid + 1, y);}void init(){ int i, x1, x2, y1, y2; scanf("%d%d", &W, &H); for(i = 0; i < N; i ++) { scanf("%d%d%d%d", &x1, &y1, &x2, &y2); seg[i << 1] = Seg(x1, y1, y2, 1), seg[i << 1 | 1] = Seg(x2, y1, y2, -1); } std::sort(seg, seg + 2 * N); build(1, 1, H);}void update(int cur, int x, int y){ int ls = cur << 1, rs = cur << 1 | 1; if(dep[ls] > dep[rs]) dep[cur] = dep[ls], ml[cur] = ml[ls]; else if(dep[rs] > dep[ls]) dep[cur] = dep[rs], ml[cur] = ml[rs]; else dep[cur] = dep[ls], ml[cur] = ml[ls] + ml[rs]; dep[cur] += cnt[cur]; if(cnt[cur]) len[cur] = y - x + 1; else len[cur] = len[ls] + len[rs];}void refresh(int cur, int x, int y, int s, int t, int c){ int mid = x + y >> 1, ls = cur << 1, rs = cur << 1 | 1; if(x >= s && y <= t) { cnt[cur] += c; if(c > 0) ++ dep[cur], len[cur] = y - x + 1; else { -- dep[cur]; if(cnt[cur]) len[cur] = y - x + 1; else { if(x == y) len[cur] = 0; else len[cur] = len[ls] + len[rs]; } } return ; } if(mid >= s) refresh(ls, x, mid, s, t, c); if(mid + 1 <= t) refresh(rs, mid + 1, y, s, t, c); update(cur, x, y);}void solve(){ int i, md, ans, area; area = md = ans = 0; seg[2 * N].x = seg[2 * N - 1].x; for(i = 0; i < 2 * N; i ++) { refresh(1, 1, H, seg[i].y1 + 1, seg[i].y2, seg[i].c); area += len[1] * (seg[i + 1].x - seg[i].x); if(dep[1] > md) md = dep[1], ans = ml[1] * (seg[i + 1].x - seg[i].x); else if(dep[1] == md) ans += ml[1] * (seg[i + 1].x - seg[i].x); } printf("%d %d %d\n", W * H - area, md, ans);}int main(){ while(scanf("%d", &N), N) { init(); solve(); } return 0; }
^
0_0_20612332_5077.cpp:5:107: error: expected unqualified-id before 'if'
> 1, ls = cur << 1, rs = cur << 1 | 1; cnt[cur] = dep[cur] = len[cur] = 0, ml[cur] = y - x + 1; if(x == y) return ; build(ls, x, mid), build(rs, mid + 1, y);}void init(){ int i, x1, x2, y1, y2; scanf("%d%d", &W, &H); for(i = 0; i < N; i ++) { scanf("%d%d%d%d", &x1, &y1, &x2, &y2); seg[i << 1] = Seg(x1, y1, y2, 1), seg[i << 1 | 1] = Seg(x2, y1, y2, -1); } std::sort(seg, seg + 2 * N); build(1, 1, H);}void update(int cur, int x, int y){ int ls = cur << 1, rs = cur << 1 | 1; if(dep[ls] > dep[rs]) dep[cur] = dep[ls], ml[cur] = ml[ls]; else if(dep[rs] > dep[ls]) dep[cur] = dep[rs], ml[cur] = ml[rs]; else dep[cur] = dep[ls], ml[cur] = ml[ls] + ml[rs]; dep[cur] += cnt[cur]; if(cnt[cur]) len[cur] = y - x + 1; else len[cur] = len[ls] + len[rs];}void refresh(int cur, int x, int y, int s, int t, int c){ int mid = x + y >> 1, ls = cur << 1, rs = cur << 1 | 1; if(x >= s && y <= t) { cnt[cur] += c; if(c > 0) ++ dep[cur], len[cur] = y - x + 1; else { -- dep[cur]; if(cnt[cur]) len[cur] = y - x + 1; else { if(x == y) len[cur] = 0; else len[cur] = len[ls] + len[rs]; } } return ; } if(mid >= s) refresh(ls, x, mid, s, t, c); if(mid + 1 <= t) refresh(rs, mid + 1, y, s, t, c); update(cur, x, y);}void solve(){ int i, md, ans, area; area = md = ans = 0; seg[2 * N].x = seg[2 * N - 1].x; for(i = 0; i < 2 * N; i ++) { refresh(1, 1, H, seg[i].y1 + 1, seg[i].y2, seg[i].c); area += len[1] * (seg[i + 1].x - seg[i].x); if(dep[1] > md) md = dep[1], ans = ml[1] * (seg[i + 1].x - seg[i].x); else if(dep[1] == md) ans += ml[1] * (seg[i + 1].x - seg[i].x); } printf("%d %d %d\n", W * H - area, md, ans);}int main(){ while(scanf("%d", &N), N) { init(); solve(); } return 0; }
^
0_0_20612332_5077.cpp:5:135: error: expected constructor, destructor, or type conversion before '(' token
> 1, ls = cur << 1, rs = cur << 1 | 1; cnt[cur] = dep[cur] = len[cur] = 0, ml[cur] = y - x + 1; if(x == y) return ; build(ls, x, mid), build(rs, mid + 1, y);}void init(){ int i, x1, x2, y1, y2; scanf("%d%d", &W, &H); for(i = 0; i < N; i ++) { scanf("%d%d%d%d", &x1, &y1, &x2, &y2); seg[i << 1] = Seg(x1, y1, y2, 1), seg[i << 1 | 1] = Seg(x2, y1, y2, -1); } std::sort(seg, seg + 2 * N); build(1, 1, H);}void update(int cur, int x, int y){ int ls = cur << 1, rs = cur << 1 | 1; if(dep[ls] > dep[rs]) dep[cur] = dep[ls], ml[cur] = ml[ls]; else if(dep[rs] > dep[ls]) dep[cur] = dep[rs], ml[cur] = ml[rs]; else dep[cur] = dep[ls], ml[cur] = ml[ls] + ml[rs]; dep[cur] += cnt[cur]; if(cnt[cur]) len[cur] = y - x + 1; else len[cur] = len[ls] + len[rs];}void refresh(int cur, int x, int y, int s, int t, int c){ int mid = x + y >> 1, ls = cur << 1, rs = cur << 1 | 1; if(x >= s && y <= t) { cnt[cur] += c; if(c > 0) ++ dep[cur], len[cur] = y - x + 1; else { -- dep[cur]; if(cnt[cur]) len[cur] = y - x + 1; else { if(x == y) len[cur] = 0; else len[cur] = len[ls] + len[rs]; } } return ; } if(mid >= s) refresh(ls, x, mid, s, t, c); if(mid + 1 <= t) refresh(rs, mid + 1, y, s, t, c); update(cur, x, y);}void solve(){ int i, md, ans, area; area = md = ans = 0; seg[2 * N].x = seg[2 * N - 1].x; for(i = 0; i < 2 * N; i ++) { refresh(1, 1, H, seg[i].y1 + 1, seg[i].y2, seg[i].c); area += len[1] * (seg[i + 1].x - seg[i].x); if(dep[1] > md) md = dep[1], ans = ml[1] * (seg[i + 1].x - seg[i].x); else if(dep[1] == md) ans += ml[1] * (seg[i + 1].x - seg[i].x); } printf("%d %d %d\n", W * H - area, md, ans);}int main(){ while(scanf("%d", &N), N) { init(); solve(); } return 0; }
^
0_0_20612332_5077.cpp:5:171: error: expected declaration before '}' token
> 1, ls = cur << 1, rs = cur << 1 | 1; cnt[cur] = dep[cur] = len[cur] = 0, ml[cur] = y - x + 1; if(x == y) return ; build(ls, x, mid), build(rs, mid + 1, y);}void init(){ int i, x1, x2, y1, y2; scanf("%d%d", &W, &H); for(i = 0; i < N; i ++) { scanf("%d%d%d%d", &x1, &y1, &x2, &y2); seg[i << 1] = Seg(x1, y1, y2, 1), seg[i << 1 | 1] = Seg(x2, y1, y2, -1); } std::sort(seg, seg + 2 * N); build(1, 1, H);}void update(int cur, int x, int y){ int ls = cur << 1, rs = cur << 1 | 1; if(dep[ls] > dep[rs]) dep[cur] = dep[ls], ml[cur] = ml[ls]; else if(dep[rs] > dep[ls]) dep[cur] = dep[rs], ml[cur] = ml[rs]; else dep[cur] = dep[ls], ml[cur] = ml[ls] + ml[rs]; dep[cur] += cnt[cur]; if(cnt[cur]) len[cur] = y - x + 1; else len[cur] = len[ls] + len[rs];}void refresh(int cur, int x, int y, int s, int t, int c){ int mid = x + y >> 1, ls = cur << 1, rs = cur << 1 | 1; if(x >= s && y <= t) { cnt[cur] += c; if(c > 0) ++ dep[cur], len[cur] = y - x + 1; else { -- dep[cur]; if(cnt[cur]) len[cur] = y - x + 1; else { if(x == y) len[cur] = 0; else len[cur] = len[ls] + len[rs]; } } return ; } if(mid >= s) refresh(ls, x, mid, s, t, c); if(mid + 1 <= t) refresh(rs, mid + 1, y, s, t, c); update(cur, x, y);}void solve(){ int i, md, ans, area; area = md = ans = 0; seg[2 * N].x = seg[2 * N - 1].x; for(i = 0; i < 2 * N; i ++) { refresh(1, 1, H, seg[i].y1 + 1, seg[i].y2, seg[i].c); area += len[1] * (seg[i + 1].x
|