답안 #639850

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
639850 2022-09-12T11:49:06 Z maomao90 IOI 바이러스 (JOI21_fever) C++17
100 / 100
3893 ms 144220 KB
// Hallelujah, praise the one who set me free
// Hallelujah, death has lost its grip on me
// You have broken every chain, There's salvation in your name
// Jesus Christ, my living hope
#include <bits/stdc++.h>
using namespace std;
 
#define REP(i, s, e) for (int i = (s); i < (e); i++)
#define RREP(i, s, e) for (int i = (s); i >= (e); i--)
template <class T>
inline bool mnto(T& a, T b) {return a > b ? a = b, 1 : 0;}
template <class T>
inline bool mxto(T& a, T b) {return a < b ? a = b, 1: 0;}
typedef long long ll;
typedef long double ld;
#define FI first
#define SE second
typedef pair<int, int> ii;
typedef pair<ll, ll> pll;
typedef tuple<int, int, int> iii;
typedef tuple<int, int, int, int> iiii;
#define ALL(_a) _a.begin(), _a.end()
#define SZ(_a) (int) _a.size()
#define pb push_back
typedef vector<int> vi;
typedef vector<ll> vll;
typedef vector<ii> vii;
typedef vector<iii> viii;
 
#ifndef DEBUG
#define cerr if (0) cerr
#endif
 
const int INF = 2000000005;
const ll LINF = 1000000000000000005ll;
const int MAXN = 100005;

int n;
ii xy[MAXN];
int rnk[8][MAXN];
vector<iiii> man[8];
int ans;

struct SegTree {
    pll mn[MAXN * 4], mnb[MAXN * 4];
    ll lz[MAXN * 4];
    SegTree() {
	REP (i, 0, MAXN * 4) {
	    lz[i] = 4 * LINF;
	}
    }
#define MLR int mid = lo + hi >> 1, lc = u << 1, rc = u << 1 ^ 1
    void propo(int u, int lo, int hi) {
	if (lo == hi || lz[u] == 4 * LINF) {
	    return;
	}
	MLR;
	if (mnto(mn[lc].FI, mnb[lc].FI + lz[u])) {
	    mn[lc].SE = mnb[lc].SE;
	}
	if (mnto(mn[rc].FI, mnb[rc].FI + lz[u])) {
	    mn[rc].SE = mnb[rc].SE;
	}
	mnto(lz[lc], lz[u]);
	mnto(lz[rc], lz[u]);
	lz[u] = 4 * LINF;
    }
    void upd(int p, pll v, int u = 1, int lo = 0, int hi = n - 1) {
	if (lo == hi) {
	    mn[u] = {v.FI + v.SE, lo};
	    mnb[u] = {v.SE, lo};
	    return;
	}
	propo(u, lo, hi);
	MLR;
	if (p <= mid) {
	    upd(p, v, lc, lo, mid);
	} else {
	    upd(p, v, rc, mid + 1, hi);
	}
	mn[u] = min(mn[lc], mn[rc]);
	mnb[u] = min(mnb[lc], mnb[rc]);
    }
    void rmn(int s, int e, ll v, int u = 1, int lo = 0, int hi = n - 1) {
	if (lo >= s && hi <= e) {
	    if (mnto(mn[u].FI, mnb[u].FI + v)) {
		mn[u].SE = mnb[u].SE;
	    }
	    mnto(lz[u], v);
	    return;
	}
	propo(u, lo, hi);
	MLR;
	if (s <= mid) {
	    rmn(s, e, v, lc, lo, mid);
	}
	if (e > mid) {
	    rmn(s, e, v, rc, mid + 1, hi);
	}
	mn[u] = min(mn[lc], mn[rc]);
	mnb[u] = min(mnb[lc], mnb[rc]);
    }
} segs[8];

int main() {
#ifndef DEBUG
    ios::sync_with_stdio(0), cin.tie(0);
#endif
    cin >> n;
    REP (i, 0, n) {
	cin >> xy[i].FI >> xy[i].SE;
    }
    auto [tx, ty] = xy[0];
    RREP (i, n - 1, 0) {
	xy[i].FI -= tx;
	xy[i].SE -= ty;
    }
    REP (z, 0, 4) {
	REP (k, 0, 8) {
	    man[k].clear();
	    REP (i, 0, 4 * MAXN) {
		segs[k].lz[i] = 4 * LINF;
	    }
	}
	REP (i, 0, n) {
	    auto [x, y] = xy[i];
	    int nx = x - y, ny = x + y;
	    int d = -1;
	    if (ny > 0 && nx > 0) {
		// move towards WEST
		d = 2;
	    } else if (nx <= 0 && ny <= 0) {
		// move towards EAST
		d = 0;
	    } else if (nx <= 0 && ny > 0) {
		// move towards SOUTH
		d = 3;
	    } else if (ny <= 0 && nx > 0) {
		// move towards NORTH
		d = 1;
	    }
	    assert(d != -1);
	    man[0].pb({d, y, x, i});
	    man[1].pb({d, x, y, i});
	    man[2].pb({d, ny, nx, i});
	    man[3].pb({d, nx, ny, i});
	    man[4].pb({d, y, -x, i});
	    man[5].pb({d, x, -y, i});
	    man[6].pb({d, ny, -nx, i});
	    man[7].pb({d, nx, -ny, i});
	}
	REP (k, 0, 8) {
	    sort(ALL(man[k]));
	    REP (i, 0, n) {
		auto [d, h, p, id] = man[k][i];
		rnk[k][id] = i;
	    }
	}
	REP (k, 0, 8) {
	    REP (i, 0, n) {
		segs[k].upd(i, {4 * LINF, get<2>(man[k][i])});
	    }
	}
	segs[0].rmn(rnk[0][0], rnk[0][0], 0);
	int res = 0;
	while (1) {
	    pll mn = {LINF, LINF};
	    REP (k, 0, 8) {
		if (mnto(mn, segs[k].mn[1])) {
		    mn.SE = get<3>(man[k][mn.SE]);
		}
	    }
	    if (mn.FI == LINF) {
		break;
	    }
	    cerr << mn.FI << ' ' << mn.SE << ' ' << xy[mn.SE].FI << ' ' << xy[mn.SE].SE << '\n';
	    res++;
	    REP (k, 0, 8) {
		segs[k].upd(rnk[k][mn.SE], {4 * LINF, 4 * LINF});
	    }
	    auto doUpd = [&] (int ax, int d) {
		auto [_, h, p, __] = man[ax][rnk[ax][mn.SE]];
		int s = lower_bound(ALL(man[ax]), iiii(d, h, p + mn.FI, -INF)) -
		    man[ax].begin();
		int e = upper_bound(ALL(man[ax]), iiii(d, h, INF, INF)) -
		    man[ax].begin() - 1;
		cerr << ' ' << ax << ' ' << d << ' ' << s << ' ' << e << '\n';
		if (s <= e) {
		    segs[ax].rmn(s, e, -p);
		}
	    };
	    int d = get<0>(man[0][rnk[0][mn.SE]]);
	    if (d == 0) {
		doUpd(2, 1);
		doUpd(0, 2);
		doUpd(3, 3);
	    } else if (d == 1) {
		doUpd(3, 2);
		doUpd(1, 3);
		doUpd(6, 0);
	    } else if (d == 2) {
		doUpd(6, 3);
		doUpd(4, 0);
		doUpd(7, 1);
	    } else if (d == 3) {
		doUpd(7, 0);
		doUpd(5, 1);
		doUpd(2, 2);
	    } else {
		assert(0);
	    }
	}
	mxto(ans, res);
	REP (i, 0, n) {
	    auto [x, y] = xy[i];
	    xy[i].FI = -y;
	    xy[i].SE = x;
	}
    }
    cout << ans << '\n';
    return 0;
}

Compilation message

fever.cpp: In member function 'void SegTree::propo(int, int, int)':
fever.cpp:52:26: warning: suggest parentheses around '+' inside '>>' [-Wparentheses]
   52 | #define MLR int mid = lo + hi >> 1, lc = u << 1, rc = u << 1 ^ 1
      |                       ~~~^~~~
fever.cpp:57:2: note: in expansion of macro 'MLR'
   57 |  MLR;
      |  ^~~
fever.cpp:52:17: warning: unused variable 'mid' [-Wunused-variable]
   52 | #define MLR int mid = lo + hi >> 1, lc = u << 1, rc = u << 1 ^ 1
      |                 ^~~
fever.cpp:57:2: note: in expansion of macro 'MLR'
   57 |  MLR;
      |  ^~~
fever.cpp: In member function 'void SegTree::upd(int, pll, int, int, int)':
fever.cpp:52:26: warning: suggest parentheses around '+' inside '>>' [-Wparentheses]
   52 | #define MLR int mid = lo + hi >> 1, lc = u << 1, rc = u << 1 ^ 1
      |                       ~~~^~~~
fever.cpp:75:2: note: in expansion of macro 'MLR'
   75 |  MLR;
      |  ^~~
fever.cpp: In member function 'void SegTree::rmn(int, int, ll, int, int, int)':
fever.cpp:52:26: warning: suggest parentheses around '+' inside '>>' [-Wparentheses]
   52 | #define MLR int mid = lo + hi >> 1, lc = u << 1, rc = u << 1 ^ 1
      |                       ~~~^~~~
fever.cpp:93:2: note: in expansion of macro 'MLR'
   93 |  MLR;
      |  ^~~
# 결과 실행 시간 메모리 Grader output
1 Correct 61 ms 125540 KB Output is correct
2 Correct 60 ms 125596 KB Output is correct
3 Correct 72 ms 125572 KB Output is correct
4 Correct 61 ms 125472 KB Output is correct
5 Correct 61 ms 125484 KB Output is correct
6 Correct 63 ms 125524 KB Output is correct
7 Correct 61 ms 125596 KB Output is correct
8 Correct 65 ms 125476 KB Output is correct
9 Correct 63 ms 125528 KB Output is correct
10 Correct 62 ms 125592 KB Output is correct
11 Correct 60 ms 125516 KB Output is correct
12 Correct 60 ms 125516 KB Output is correct
13 Correct 66 ms 125524 KB Output is correct
14 Correct 63 ms 125484 KB Output is correct
15 Correct 63 ms 125484 KB Output is correct
16 Correct 61 ms 125584 KB Output is correct
17 Correct 61 ms 125564 KB Output is correct
18 Correct 60 ms 125468 KB Output is correct
19 Correct 62 ms 125516 KB Output is correct
20 Correct 65 ms 125484 KB Output is correct
21 Correct 63 ms 125492 KB Output is correct
22 Correct 61 ms 125540 KB Output is correct
23 Correct 69 ms 125516 KB Output is correct
24 Correct 63 ms 125684 KB Output is correct
25 Correct 70 ms 125740 KB Output is correct
26 Correct 65 ms 125560 KB Output is correct
27 Correct 60 ms 125552 KB Output is correct
28 Correct 65 ms 125516 KB Output is correct
29 Correct 60 ms 125564 KB Output is correct
30 Correct 60 ms 125592 KB Output is correct
31 Correct 64 ms 125504 KB Output is correct
32 Correct 63 ms 125564 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 61 ms 125540 KB Output is correct
2 Correct 60 ms 125596 KB Output is correct
3 Correct 72 ms 125572 KB Output is correct
4 Correct 61 ms 125472 KB Output is correct
5 Correct 61 ms 125484 KB Output is correct
6 Correct 63 ms 125524 KB Output is correct
7 Correct 61 ms 125596 KB Output is correct
8 Correct 65 ms 125476 KB Output is correct
9 Correct 63 ms 125528 KB Output is correct
10 Correct 62 ms 125592 KB Output is correct
11 Correct 60 ms 125516 KB Output is correct
12 Correct 60 ms 125516 KB Output is correct
13 Correct 66 ms 125524 KB Output is correct
14 Correct 63 ms 125484 KB Output is correct
15 Correct 63 ms 125484 KB Output is correct
16 Correct 61 ms 125584 KB Output is correct
17 Correct 61 ms 125564 KB Output is correct
18 Correct 60 ms 125468 KB Output is correct
19 Correct 62 ms 125516 KB Output is correct
20 Correct 65 ms 125484 KB Output is correct
21 Correct 63 ms 125492 KB Output is correct
22 Correct 61 ms 125540 KB Output is correct
23 Correct 69 ms 125516 KB Output is correct
24 Correct 63 ms 125684 KB Output is correct
25 Correct 70 ms 125740 KB Output is correct
26 Correct 65 ms 125560 KB Output is correct
27 Correct 60 ms 125552 KB Output is correct
28 Correct 65 ms 125516 KB Output is correct
29 Correct 60 ms 125564 KB Output is correct
30 Correct 60 ms 125592 KB Output is correct
31 Correct 64 ms 125504 KB Output is correct
32 Correct 63 ms 125564 KB Output is correct
33 Correct 65 ms 125524 KB Output is correct
34 Correct 65 ms 125576 KB Output is correct
35 Correct 67 ms 125596 KB Output is correct
36 Correct 62 ms 125576 KB Output is correct
37 Correct 63 ms 125588 KB Output is correct
38 Correct 67 ms 125560 KB Output is correct
39 Correct 77 ms 125512 KB Output is correct
40 Correct 69 ms 125512 KB Output is correct
41 Correct 64 ms 125516 KB Output is correct
42 Correct 69 ms 125500 KB Output is correct
43 Correct 72 ms 125472 KB Output is correct
44 Correct 68 ms 125488 KB Output is correct
45 Correct 65 ms 125528 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 64 ms 125520 KB Output is correct
2 Correct 65 ms 125564 KB Output is correct
3 Correct 70 ms 125640 KB Output is correct
4 Correct 69 ms 125560 KB Output is correct
5 Correct 62 ms 125556 KB Output is correct
6 Correct 60 ms 125632 KB Output is correct
7 Correct 65 ms 125516 KB Output is correct
8 Correct 61 ms 125560 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 61 ms 125540 KB Output is correct
2 Correct 60 ms 125596 KB Output is correct
3 Correct 72 ms 125572 KB Output is correct
4 Correct 61 ms 125472 KB Output is correct
5 Correct 61 ms 125484 KB Output is correct
6 Correct 63 ms 125524 KB Output is correct
7 Correct 61 ms 125596 KB Output is correct
8 Correct 65 ms 125476 KB Output is correct
9 Correct 63 ms 125528 KB Output is correct
10 Correct 62 ms 125592 KB Output is correct
11 Correct 60 ms 125516 KB Output is correct
12 Correct 60 ms 125516 KB Output is correct
13 Correct 66 ms 125524 KB Output is correct
14 Correct 63 ms 125484 KB Output is correct
15 Correct 63 ms 125484 KB Output is correct
16 Correct 61 ms 125584 KB Output is correct
17 Correct 61 ms 125564 KB Output is correct
18 Correct 60 ms 125468 KB Output is correct
19 Correct 62 ms 125516 KB Output is correct
20 Correct 65 ms 125484 KB Output is correct
21 Correct 63 ms 125492 KB Output is correct
22 Correct 61 ms 125540 KB Output is correct
23 Correct 69 ms 125516 KB Output is correct
24 Correct 63 ms 125684 KB Output is correct
25 Correct 70 ms 125740 KB Output is correct
26 Correct 65 ms 125560 KB Output is correct
27 Correct 60 ms 125552 KB Output is correct
28 Correct 65 ms 125516 KB Output is correct
29 Correct 60 ms 125564 KB Output is correct
30 Correct 60 ms 125592 KB Output is correct
31 Correct 64 ms 125504 KB Output is correct
32 Correct 63 ms 125564 KB Output is correct
33 Correct 65 ms 125524 KB Output is correct
34 Correct 65 ms 125576 KB Output is correct
35 Correct 67 ms 125596 KB Output is correct
36 Correct 62 ms 125576 KB Output is correct
37 Correct 63 ms 125588 KB Output is correct
38 Correct 67 ms 125560 KB Output is correct
39 Correct 77 ms 125512 KB Output is correct
40 Correct 69 ms 125512 KB Output is correct
41 Correct 64 ms 125516 KB Output is correct
42 Correct 69 ms 125500 KB Output is correct
43 Correct 72 ms 125472 KB Output is correct
44 Correct 68 ms 125488 KB Output is correct
45 Correct 65 ms 125528 KB Output is correct
46 Correct 64 ms 125520 KB Output is correct
47 Correct 65 ms 125564 KB Output is correct
48 Correct 70 ms 125640 KB Output is correct
49 Correct 69 ms 125560 KB Output is correct
50 Correct 62 ms 125556 KB Output is correct
51 Correct 60 ms 125632 KB Output is correct
52 Correct 65 ms 125516 KB Output is correct
53 Correct 61 ms 125560 KB Output is correct
54 Correct 63 ms 125632 KB Output is correct
55 Correct 72 ms 125752 KB Output is correct
56 Correct 62 ms 125620 KB Output is correct
57 Correct 60 ms 125528 KB Output is correct
58 Correct 62 ms 125612 KB Output is correct
59 Correct 66 ms 125540 KB Output is correct
60 Correct 64 ms 125520 KB Output is correct
61 Correct 67 ms 125516 KB Output is correct
62 Correct 62 ms 125576 KB Output is correct
63 Correct 62 ms 125556 KB Output is correct
64 Correct 67 ms 125564 KB Output is correct
65 Correct 62 ms 125540 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 61 ms 125540 KB Output is correct
2 Correct 60 ms 125596 KB Output is correct
3 Correct 72 ms 125572 KB Output is correct
4 Correct 61 ms 125472 KB Output is correct
5 Correct 61 ms 125484 KB Output is correct
6 Correct 63 ms 125524 KB Output is correct
7 Correct 61 ms 125596 KB Output is correct
8 Correct 65 ms 125476 KB Output is correct
9 Correct 63 ms 125528 KB Output is correct
10 Correct 62 ms 125592 KB Output is correct
11 Correct 60 ms 125516 KB Output is correct
12 Correct 60 ms 125516 KB Output is correct
13 Correct 66 ms 125524 KB Output is correct
14 Correct 63 ms 125484 KB Output is correct
15 Correct 63 ms 125484 KB Output is correct
16 Correct 61 ms 125584 KB Output is correct
17 Correct 61 ms 125564 KB Output is correct
18 Correct 60 ms 125468 KB Output is correct
19 Correct 62 ms 125516 KB Output is correct
20 Correct 65 ms 125484 KB Output is correct
21 Correct 63 ms 125492 KB Output is correct
22 Correct 61 ms 125540 KB Output is correct
23 Correct 69 ms 125516 KB Output is correct
24 Correct 63 ms 125684 KB Output is correct
25 Correct 70 ms 125740 KB Output is correct
26 Correct 65 ms 125560 KB Output is correct
27 Correct 60 ms 125552 KB Output is correct
28 Correct 65 ms 125516 KB Output is correct
29 Correct 60 ms 125564 KB Output is correct
30 Correct 60 ms 125592 KB Output is correct
31 Correct 64 ms 125504 KB Output is correct
32 Correct 63 ms 125564 KB Output is correct
33 Correct 65 ms 125524 KB Output is correct
34 Correct 65 ms 125576 KB Output is correct
35 Correct 67 ms 125596 KB Output is correct
36 Correct 62 ms 125576 KB Output is correct
37 Correct 63 ms 125588 KB Output is correct
38 Correct 67 ms 125560 KB Output is correct
39 Correct 77 ms 125512 KB Output is correct
40 Correct 69 ms 125512 KB Output is correct
41 Correct 64 ms 125516 KB Output is correct
42 Correct 69 ms 125500 KB Output is correct
43 Correct 72 ms 125472 KB Output is correct
44 Correct 68 ms 125488 KB Output is correct
45 Correct 65 ms 125528 KB Output is correct
46 Correct 64 ms 125520 KB Output is correct
47 Correct 65 ms 125564 KB Output is correct
48 Correct 70 ms 125640 KB Output is correct
49 Correct 69 ms 125560 KB Output is correct
50 Correct 62 ms 125556 KB Output is correct
51 Correct 60 ms 125632 KB Output is correct
52 Correct 65 ms 125516 KB Output is correct
53 Correct 61 ms 125560 KB Output is correct
54 Correct 63 ms 125632 KB Output is correct
55 Correct 72 ms 125752 KB Output is correct
56 Correct 62 ms 125620 KB Output is correct
57 Correct 60 ms 125528 KB Output is correct
58 Correct 62 ms 125612 KB Output is correct
59 Correct 66 ms 125540 KB Output is correct
60 Correct 64 ms 125520 KB Output is correct
61 Correct 67 ms 125516 KB Output is correct
62 Correct 62 ms 125576 KB Output is correct
63 Correct 62 ms 125556 KB Output is correct
64 Correct 67 ms 125564 KB Output is correct
65 Correct 62 ms 125540 KB Output is correct
66 Correct 87 ms 126268 KB Output is correct
67 Correct 81 ms 126336 KB Output is correct
68 Correct 82 ms 126304 KB Output is correct
69 Correct 134 ms 126320 KB Output is correct
70 Correct 97 ms 126332 KB Output is correct
71 Correct 103 ms 126212 KB Output is correct
72 Correct 84 ms 126272 KB Output is correct
73 Correct 88 ms 126248 KB Output is correct
74 Correct 98 ms 126204 KB Output is correct
75 Correct 113 ms 126288 KB Output is correct
76 Correct 100 ms 126268 KB Output is correct
77 Correct 87 ms 126256 KB Output is correct
78 Correct 115 ms 126348 KB Output is correct
79 Correct 112 ms 126284 KB Output is correct
80 Correct 123 ms 126268 KB Output is correct
81 Correct 93 ms 126264 KB Output is correct
82 Correct 116 ms 126360 KB Output is correct
83 Correct 95 ms 126344 KB Output is correct
84 Correct 92 ms 126348 KB Output is correct
85 Correct 87 ms 126336 KB Output is correct
86 Correct 89 ms 126284 KB Output is correct
87 Correct 95 ms 126268 KB Output is correct
88 Correct 104 ms 126332 KB Output is correct
89 Correct 106 ms 126336 KB Output is correct
90 Correct 102 ms 126372 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 61 ms 125540 KB Output is correct
2 Correct 60 ms 125596 KB Output is correct
3 Correct 72 ms 125572 KB Output is correct
4 Correct 61 ms 125472 KB Output is correct
5 Correct 61 ms 125484 KB Output is correct
6 Correct 63 ms 125524 KB Output is correct
7 Correct 61 ms 125596 KB Output is correct
8 Correct 65 ms 125476 KB Output is correct
9 Correct 63 ms 125528 KB Output is correct
10 Correct 62 ms 125592 KB Output is correct
11 Correct 60 ms 125516 KB Output is correct
12 Correct 60 ms 125516 KB Output is correct
13 Correct 66 ms 125524 KB Output is correct
14 Correct 63 ms 125484 KB Output is correct
15 Correct 63 ms 125484 KB Output is correct
16 Correct 61 ms 125584 KB Output is correct
17 Correct 61 ms 125564 KB Output is correct
18 Correct 60 ms 125468 KB Output is correct
19 Correct 62 ms 125516 KB Output is correct
20 Correct 65 ms 125484 KB Output is correct
21 Correct 63 ms 125492 KB Output is correct
22 Correct 61 ms 125540 KB Output is correct
23 Correct 69 ms 125516 KB Output is correct
24 Correct 63 ms 125684 KB Output is correct
25 Correct 70 ms 125740 KB Output is correct
26 Correct 65 ms 125560 KB Output is correct
27 Correct 60 ms 125552 KB Output is correct
28 Correct 65 ms 125516 KB Output is correct
29 Correct 60 ms 125564 KB Output is correct
30 Correct 60 ms 125592 KB Output is correct
31 Correct 64 ms 125504 KB Output is correct
32 Correct 63 ms 125564 KB Output is correct
33 Correct 65 ms 125524 KB Output is correct
34 Correct 65 ms 125576 KB Output is correct
35 Correct 67 ms 125596 KB Output is correct
36 Correct 62 ms 125576 KB Output is correct
37 Correct 63 ms 125588 KB Output is correct
38 Correct 67 ms 125560 KB Output is correct
39 Correct 77 ms 125512 KB Output is correct
40 Correct 69 ms 125512 KB Output is correct
41 Correct 64 ms 125516 KB Output is correct
42 Correct 69 ms 125500 KB Output is correct
43 Correct 72 ms 125472 KB Output is correct
44 Correct 68 ms 125488 KB Output is correct
45 Correct 65 ms 125528 KB Output is correct
46 Correct 64 ms 125520 KB Output is correct
47 Correct 65 ms 125564 KB Output is correct
48 Correct 70 ms 125640 KB Output is correct
49 Correct 69 ms 125560 KB Output is correct
50 Correct 62 ms 125556 KB Output is correct
51 Correct 60 ms 125632 KB Output is correct
52 Correct 65 ms 125516 KB Output is correct
53 Correct 61 ms 125560 KB Output is correct
54 Correct 63 ms 125632 KB Output is correct
55 Correct 72 ms 125752 KB Output is correct
56 Correct 62 ms 125620 KB Output is correct
57 Correct 60 ms 125528 KB Output is correct
58 Correct 62 ms 125612 KB Output is correct
59 Correct 66 ms 125540 KB Output is correct
60 Correct 64 ms 125520 KB Output is correct
61 Correct 67 ms 125516 KB Output is correct
62 Correct 62 ms 125576 KB Output is correct
63 Correct 62 ms 125556 KB Output is correct
64 Correct 67 ms 125564 KB Output is correct
65 Correct 62 ms 125540 KB Output is correct
66 Correct 879 ms 139848 KB Output is correct
67 Correct 1076 ms 143324 KB Output is correct
68 Correct 1064 ms 144092 KB Output is correct
69 Correct 1621 ms 143380 KB Output is correct
70 Correct 2112 ms 144132 KB Output is correct
71 Correct 1084 ms 144084 KB Output is correct
72 Correct 1085 ms 143700 KB Output is correct
73 Correct 1226 ms 144132 KB Output is correct
74 Correct 1049 ms 144088 KB Output is correct
75 Correct 1108 ms 144096 KB Output is correct
76 Correct 1344 ms 144120 KB Output is correct
77 Correct 1098 ms 144128 KB Output is correct
78 Correct 1423 ms 144136 KB Output is correct
79 Correct 1396 ms 144128 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 61 ms 125540 KB Output is correct
2 Correct 60 ms 125596 KB Output is correct
3 Correct 72 ms 125572 KB Output is correct
4 Correct 61 ms 125472 KB Output is correct
5 Correct 61 ms 125484 KB Output is correct
6 Correct 63 ms 125524 KB Output is correct
7 Correct 61 ms 125596 KB Output is correct
8 Correct 65 ms 125476 KB Output is correct
9 Correct 63 ms 125528 KB Output is correct
10 Correct 62 ms 125592 KB Output is correct
11 Correct 60 ms 125516 KB Output is correct
12 Correct 60 ms 125516 KB Output is correct
13 Correct 66 ms 125524 KB Output is correct
14 Correct 63 ms 125484 KB Output is correct
15 Correct 63 ms 125484 KB Output is correct
16 Correct 61 ms 125584 KB Output is correct
17 Correct 61 ms 125564 KB Output is correct
18 Correct 60 ms 125468 KB Output is correct
19 Correct 62 ms 125516 KB Output is correct
20 Correct 65 ms 125484 KB Output is correct
21 Correct 63 ms 125492 KB Output is correct
22 Correct 61 ms 125540 KB Output is correct
23 Correct 69 ms 125516 KB Output is correct
24 Correct 63 ms 125684 KB Output is correct
25 Correct 70 ms 125740 KB Output is correct
26 Correct 65 ms 125560 KB Output is correct
27 Correct 60 ms 125552 KB Output is correct
28 Correct 65 ms 125516 KB Output is correct
29 Correct 60 ms 125564 KB Output is correct
30 Correct 60 ms 125592 KB Output is correct
31 Correct 64 ms 125504 KB Output is correct
32 Correct 63 ms 125564 KB Output is correct
33 Correct 65 ms 125524 KB Output is correct
34 Correct 65 ms 125576 KB Output is correct
35 Correct 67 ms 125596 KB Output is correct
36 Correct 62 ms 125576 KB Output is correct
37 Correct 63 ms 125588 KB Output is correct
38 Correct 67 ms 125560 KB Output is correct
39 Correct 77 ms 125512 KB Output is correct
40 Correct 69 ms 125512 KB Output is correct
41 Correct 64 ms 125516 KB Output is correct
42 Correct 69 ms 125500 KB Output is correct
43 Correct 72 ms 125472 KB Output is correct
44 Correct 68 ms 125488 KB Output is correct
45 Correct 65 ms 125528 KB Output is correct
46 Correct 64 ms 125520 KB Output is correct
47 Correct 65 ms 125564 KB Output is correct
48 Correct 70 ms 125640 KB Output is correct
49 Correct 69 ms 125560 KB Output is correct
50 Correct 62 ms 125556 KB Output is correct
51 Correct 60 ms 125632 KB Output is correct
52 Correct 65 ms 125516 KB Output is correct
53 Correct 61 ms 125560 KB Output is correct
54 Correct 63 ms 125632 KB Output is correct
55 Correct 72 ms 125752 KB Output is correct
56 Correct 62 ms 125620 KB Output is correct
57 Correct 60 ms 125528 KB Output is correct
58 Correct 62 ms 125612 KB Output is correct
59 Correct 66 ms 125540 KB Output is correct
60 Correct 64 ms 125520 KB Output is correct
61 Correct 67 ms 125516 KB Output is correct
62 Correct 62 ms 125576 KB Output is correct
63 Correct 62 ms 125556 KB Output is correct
64 Correct 67 ms 125564 KB Output is correct
65 Correct 62 ms 125540 KB Output is correct
66 Correct 87 ms 126268 KB Output is correct
67 Correct 81 ms 126336 KB Output is correct
68 Correct 82 ms 126304 KB Output is correct
69 Correct 134 ms 126320 KB Output is correct
70 Correct 97 ms 126332 KB Output is correct
71 Correct 103 ms 126212 KB Output is correct
72 Correct 84 ms 126272 KB Output is correct
73 Correct 88 ms 126248 KB Output is correct
74 Correct 98 ms 126204 KB Output is correct
75 Correct 113 ms 126288 KB Output is correct
76 Correct 100 ms 126268 KB Output is correct
77 Correct 87 ms 126256 KB Output is correct
78 Correct 115 ms 126348 KB Output is correct
79 Correct 112 ms 126284 KB Output is correct
80 Correct 123 ms 126268 KB Output is correct
81 Correct 93 ms 126264 KB Output is correct
82 Correct 116 ms 126360 KB Output is correct
83 Correct 95 ms 126344 KB Output is correct
84 Correct 92 ms 126348 KB Output is correct
85 Correct 87 ms 126336 KB Output is correct
86 Correct 89 ms 126284 KB Output is correct
87 Correct 95 ms 126268 KB Output is correct
88 Correct 104 ms 126332 KB Output is correct
89 Correct 106 ms 126336 KB Output is correct
90 Correct 102 ms 126372 KB Output is correct
91 Correct 879 ms 139848 KB Output is correct
92 Correct 1076 ms 143324 KB Output is correct
93 Correct 1064 ms 144092 KB Output is correct
94 Correct 1621 ms 143380 KB Output is correct
95 Correct 2112 ms 144132 KB Output is correct
96 Correct 1084 ms 144084 KB Output is correct
97 Correct 1085 ms 143700 KB Output is correct
98 Correct 1226 ms 144132 KB Output is correct
99 Correct 1049 ms 144088 KB Output is correct
100 Correct 1108 ms 144096 KB Output is correct
101 Correct 1344 ms 144120 KB Output is correct
102 Correct 1098 ms 144128 KB Output is correct
103 Correct 1423 ms 144136 KB Output is correct
104 Correct 1396 ms 144128 KB Output is correct
105 Correct 2323 ms 139508 KB Output is correct
106 Correct 2835 ms 142900 KB Output is correct
107 Correct 3893 ms 142924 KB Output is correct
108 Correct 3160 ms 143016 KB Output is correct
109 Correct 1000 ms 143168 KB Output is correct
110 Correct 979 ms 143324 KB Output is correct
111 Correct 936 ms 144084 KB Output is correct
112 Correct 966 ms 143568 KB Output is correct
113 Correct 989 ms 143436 KB Output is correct
114 Correct 2491 ms 143644 KB Output is correct
115 Correct 1084 ms 144128 KB Output is correct
116 Correct 961 ms 143496 KB Output is correct
117 Correct 1004 ms 143504 KB Output is correct
118 Correct 1884 ms 143572 KB Output is correct
119 Correct 1480 ms 144152 KB Output is correct
120 Correct 957 ms 143600 KB Output is correct
121 Correct 1037 ms 144220 KB Output is correct
122 Correct 1213 ms 144100 KB Output is correct
123 Correct 1312 ms 143532 KB Output is correct
124 Correct 1321 ms 144124 KB Output is correct
125 Correct 873 ms 143464 KB Output is correct
126 Correct 894 ms 143704 KB Output is correct
127 Correct 1010 ms 144012 KB Output is correct
128 Correct 870 ms 143888 KB Output is correct
129 Correct 892 ms 143544 KB Output is correct