#include <bits/stdc++.h>
using namespace std;
#ifdef MIKU
string dbmc = "\033[1;38;2;57;197;187m", dbrs = "\033[0m";
#define debug(x...) cout << dbmc << "[" << #x << "]: ", dout(x)
void dout() { cout << dbrs << endl; }
template <typename T, typename ...U>
void dout(T t, U ...u) { cout << t << (sizeof...(u) ? ", " : ""); dout(u...); }
#else
#define debug(...) 39
#endif
#define fs first
#define sc second
#define mp make_pair
#define FOR(i, j, k) for (int i = j, Z = k; i < Z; i++)
using ll = long long;
typedef pair<int, int> pii;
typedef array<int, 3> p3i;
const int MXN = 1000005, mod = 1000003, INF = 2e9;
int n, a[MXN];
int tg[MXN];
ll cnt;
vector<p3i> op;
ll tri(ll l, ll r) {
return ((l + r - 1) * (r - l) / 2) % mod;
}
pii operator+(pii a, pii b) {
return mp(min(a.fs, b.fs), max(a.sc, b.sc));
}
struct SMG1 {
pii val[MXN * 2];
void init(int _n) {
fill(val, val + 2 * n, mp(INF, -INF));
}
void modify(int p, pii v) {
val[p += n] = v;
for (p >>= 1; p; p >>= 1) val[p] = val[p << 1] + val[p << 1 | 1];
}
pii query(int l, int r) {
pii ans = mp(INF, -INF);
for (l += n, r += n; l < r; l >>= 1, r >>= 1) {
if (l & 1) ans = ans + val[l++];
if (r & 1) ans = ans + val[--r];
}
return ans;
}
} S;
struct SMG2 {
int val[MXN * 2];
void init(int n, int *a) {
copy(a, a + n, val + n);
for (int i = n - 1; i; i--) val[i] = min(val[i << 1], val[i << 1 | 1]);
}
void modify(int p, int v) {
val[p += n] = v;
for (p >>= 1; p; p >>= 1) val[p] = min(val[p << 1], val[p << 1 | 1]);
}
int query(int l, int r) {
int ans = INF;
for (l += n, r += n; l < r; l >>= 1, r >>= 1) {
if (l & 1) ans = min(ans, val[l++]);
if (r & 1) ans = min(ans, val[--r]);
}
return ans;
}
} smg;
void GET_TG() {
int l = 0, r = n - 1;
int now = 0, big = *max_element(a, a + n);
while (a[l] < big) {
now = max(now, a[l]);
tg[l] = now;
l++;
}
now = 0;
while (a[r] < big) {
now = max(now, a[r]);
tg[r] = now;
r--;
}
FOR(i, l, r + 1) tg[i] = big;
}
int calc(ll t0, ll t1) {
if (cnt == 0) return 0;
if (t0 == t1) return 0;
debug("CALC", t0, t1, cnt);
if (cnt == 1) {
int x = S.query(0, n).fs;
ll A = smg.query(0, x), B = smg.query(x + 1, n);
return ((t1 - t0) * (A + B) + tri(t0, t1)) % mod;
}
auto [l, r] = S.query(0, n);
ll A = smg.query(0, l), B = smg.query(l + 1, n);
ll C = smg.query(0, r), D = smg.query(r + 1, n);
debug(A, B, C, D);
return ((t1 - t0) * (A + D + min(B, C) + 2 * cnt - 3) % mod + (3 * cnt - 3) * tri(t0, t1) % mod) % mod;
}
void miku() {
cin >> n;
FOR(i, 0, n) cin >> a[i];
GET_TG();
S.init(n);
smg.init(n, a);
FOR(i, 0, n) {
op.push_back(p3i{a[i], 1, i});
op.push_back(p3i{a[i], 2, i});
op.push_back(p3i{tg[i], 3, i});
}
sort(op.begin(), op.end());
int time = 0;
ll ans = 0;
for (auto [t, tp, id] : op) {
ans = (ans + calc(time, t)) % mod;
time = t;
debug(t);
if (tp == 1) {
debug("KICK", id);
smg.modify(id, INF);
} else if (tp == 2) {
debug("PUSH", id);
S.modify(id, mp(id, id));
cnt++;
} else {
debug("POP", id);
S.modify(id, mp(INF, -INF));
cnt--;
}
debug(ans);
}
cout << ans << '\n';
}
int32_t main() {
cin.tie(0) -> sync_with_stdio(false);
cin.exceptions(cin.failbit);
miku();
return 0;
}
Compilation message
Main.cpp: In function 'int calc(ll, ll)':
Main.cpp:11:20: warning: statement has no effect [-Wunused-value]
11 | #define debug(...) 39
| ^~
Main.cpp:95:5: note: in expansion of macro 'debug'
95 | debug("CALC", t0, t1, cnt);
| ^~~~~
Main.cpp:11:20: warning: statement has no effect [-Wunused-value]
11 | #define debug(...) 39
| ^~
Main.cpp:104:5: note: in expansion of macro 'debug'
104 | debug(A, B, C, D);
| ^~~~~
Main.cpp: In function 'void miku()':
Main.cpp:11:20: warning: statement has no effect [-Wunused-value]
11 | #define debug(...) 39
| ^~
Main.cpp:125:9: note: in expansion of macro 'debug'
125 | debug(t);
| ^~~~~
Main.cpp:11:20: warning: statement has no effect [-Wunused-value]
11 | #define debug(...) 39
| ^~
Main.cpp:127:13: note: in expansion of macro 'debug'
127 | debug("KICK", id);
| ^~~~~
Main.cpp:11:20: warning: statement has no effect [-Wunused-value]
11 | #define debug(...) 39
| ^~
Main.cpp:130:13: note: in expansion of macro 'debug'
130 | debug("PUSH", id);
| ^~~~~
Main.cpp:11:20: warning: statement has no effect [-Wunused-value]
11 | #define debug(...) 39
| ^~
Main.cpp:134:13: note: in expansion of macro 'debug'
134 | debug("POP", id);
| ^~~~~
Main.cpp:11:20: warning: statement has no effect [-Wunused-value]
11 | #define debug(...) 39
| ^~
Main.cpp:138:9: note: in expansion of macro 'debug'
138 | debug(ans);
| ^~~~~
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
6488 KB |
Output is correct |
2 |
Correct |
1 ms |
6488 KB |
Output is correct |
3 |
Correct |
1 ms |
6492 KB |
Output is correct |
4 |
Correct |
4 ms |
6940 KB |
Output is correct |
5 |
Correct |
3 ms |
7192 KB |
Output is correct |
6 |
Correct |
3 ms |
6940 KB |
Output is correct |
7 |
Correct |
3 ms |
6940 KB |
Output is correct |
8 |
Correct |
3 ms |
6936 KB |
Output is correct |
9 |
Correct |
3 ms |
6940 KB |
Output is correct |
10 |
Correct |
3 ms |
6940 KB |
Output is correct |
11 |
Correct |
3 ms |
6940 KB |
Output is correct |
12 |
Correct |
3 ms |
6940 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
6488 KB |
Output is correct |
2 |
Correct |
1 ms |
6488 KB |
Output is correct |
3 |
Correct |
1 ms |
6492 KB |
Output is correct |
4 |
Correct |
4 ms |
6940 KB |
Output is correct |
5 |
Correct |
3 ms |
7192 KB |
Output is correct |
6 |
Correct |
3 ms |
6940 KB |
Output is correct |
7 |
Correct |
3 ms |
6940 KB |
Output is correct |
8 |
Correct |
3 ms |
6936 KB |
Output is correct |
9 |
Correct |
3 ms |
6940 KB |
Output is correct |
10 |
Correct |
3 ms |
6940 KB |
Output is correct |
11 |
Correct |
3 ms |
6940 KB |
Output is correct |
12 |
Correct |
3 ms |
6940 KB |
Output is correct |
13 |
Correct |
3 ms |
6936 KB |
Output is correct |
14 |
Correct |
1 ms |
6492 KB |
Output is correct |
15 |
Correct |
1 ms |
6492 KB |
Output is correct |
16 |
Correct |
3 ms |
6940 KB |
Output is correct |
17 |
Correct |
3 ms |
6940 KB |
Output is correct |
18 |
Correct |
3 ms |
6940 KB |
Output is correct |
19 |
Correct |
4 ms |
6936 KB |
Output is correct |
20 |
Correct |
4 ms |
6940 KB |
Output is correct |
21 |
Correct |
3 ms |
6936 KB |
Output is correct |
22 |
Correct |
3 ms |
6940 KB |
Output is correct |
23 |
Correct |
3 ms |
6940 KB |
Output is correct |
24 |
Correct |
3 ms |
6940 KB |
Output is correct |
25 |
Correct |
3 ms |
6940 KB |
Output is correct |
26 |
Correct |
3 ms |
6940 KB |
Output is correct |
27 |
Correct |
4 ms |
6940 KB |
Output is correct |
28 |
Correct |
3 ms |
6940 KB |
Output is correct |
29 |
Correct |
1 ms |
6492 KB |
Output is correct |
30 |
Correct |
1 ms |
6492 KB |
Output is correct |
31 |
Correct |
1 ms |
6492 KB |
Output is correct |
32 |
Correct |
1 ms |
6492 KB |
Output is correct |
33 |
Correct |
1 ms |
6492 KB |
Output is correct |
34 |
Correct |
1 ms |
6492 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
6488 KB |
Output is correct |
2 |
Correct |
1 ms |
6488 KB |
Output is correct |
3 |
Correct |
1 ms |
6492 KB |
Output is correct |
4 |
Correct |
4 ms |
6940 KB |
Output is correct |
5 |
Correct |
3 ms |
7192 KB |
Output is correct |
6 |
Correct |
3 ms |
6940 KB |
Output is correct |
7 |
Correct |
3 ms |
6940 KB |
Output is correct |
8 |
Correct |
3 ms |
6936 KB |
Output is correct |
9 |
Correct |
3 ms |
6940 KB |
Output is correct |
10 |
Correct |
3 ms |
6940 KB |
Output is correct |
11 |
Correct |
3 ms |
6940 KB |
Output is correct |
12 |
Correct |
3 ms |
6940 KB |
Output is correct |
13 |
Correct |
3 ms |
6936 KB |
Output is correct |
14 |
Correct |
1 ms |
6492 KB |
Output is correct |
15 |
Correct |
1 ms |
6492 KB |
Output is correct |
16 |
Correct |
3 ms |
6940 KB |
Output is correct |
17 |
Correct |
3 ms |
6940 KB |
Output is correct |
18 |
Correct |
3 ms |
6940 KB |
Output is correct |
19 |
Correct |
4 ms |
6936 KB |
Output is correct |
20 |
Correct |
4 ms |
6940 KB |
Output is correct |
21 |
Correct |
3 ms |
6936 KB |
Output is correct |
22 |
Correct |
3 ms |
6940 KB |
Output is correct |
23 |
Correct |
3 ms |
6940 KB |
Output is correct |
24 |
Correct |
3 ms |
6940 KB |
Output is correct |
25 |
Correct |
3 ms |
6940 KB |
Output is correct |
26 |
Correct |
3 ms |
6940 KB |
Output is correct |
27 |
Correct |
4 ms |
6940 KB |
Output is correct |
28 |
Correct |
3 ms |
6940 KB |
Output is correct |
29 |
Correct |
1 ms |
6492 KB |
Output is correct |
30 |
Correct |
1 ms |
6492 KB |
Output is correct |
31 |
Correct |
1 ms |
6492 KB |
Output is correct |
32 |
Correct |
1 ms |
6492 KB |
Output is correct |
33 |
Correct |
1 ms |
6492 KB |
Output is correct |
34 |
Correct |
1 ms |
6492 KB |
Output is correct |
35 |
Correct |
3 ms |
6936 KB |
Output is correct |
36 |
Correct |
3 ms |
6940 KB |
Output is correct |
37 |
Correct |
4 ms |
6940 KB |
Output is correct |
38 |
Correct |
4 ms |
6940 KB |
Output is correct |
39 |
Correct |
4 ms |
6936 KB |
Output is correct |
40 |
Correct |
4 ms |
6940 KB |
Output is correct |
41 |
Correct |
3 ms |
6940 KB |
Output is correct |
42 |
Correct |
3 ms |
6940 KB |
Output is correct |
43 |
Correct |
4 ms |
6940 KB |
Output is correct |
44 |
Correct |
4 ms |
6940 KB |
Output is correct |
45 |
Correct |
4 ms |
6940 KB |
Output is correct |
46 |
Correct |
4 ms |
6936 KB |
Output is correct |
47 |
Correct |
3 ms |
6940 KB |
Output is correct |
48 |
Correct |
3 ms |
6940 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
6488 KB |
Output is correct |
2 |
Correct |
1 ms |
6488 KB |
Output is correct |
3 |
Correct |
1 ms |
6492 KB |
Output is correct |
4 |
Correct |
4 ms |
6940 KB |
Output is correct |
5 |
Correct |
3 ms |
7192 KB |
Output is correct |
6 |
Correct |
3 ms |
6940 KB |
Output is correct |
7 |
Correct |
3 ms |
6940 KB |
Output is correct |
8 |
Correct |
3 ms |
6936 KB |
Output is correct |
9 |
Correct |
3 ms |
6940 KB |
Output is correct |
10 |
Correct |
3 ms |
6940 KB |
Output is correct |
11 |
Correct |
3 ms |
6940 KB |
Output is correct |
12 |
Correct |
3 ms |
6940 KB |
Output is correct |
13 |
Correct |
3 ms |
6936 KB |
Output is correct |
14 |
Correct |
1 ms |
6492 KB |
Output is correct |
15 |
Correct |
1 ms |
6492 KB |
Output is correct |
16 |
Correct |
3 ms |
6940 KB |
Output is correct |
17 |
Correct |
3 ms |
6940 KB |
Output is correct |
18 |
Correct |
3 ms |
6940 KB |
Output is correct |
19 |
Correct |
4 ms |
6936 KB |
Output is correct |
20 |
Correct |
4 ms |
6940 KB |
Output is correct |
21 |
Correct |
3 ms |
6936 KB |
Output is correct |
22 |
Correct |
3 ms |
6940 KB |
Output is correct |
23 |
Correct |
3 ms |
6940 KB |
Output is correct |
24 |
Correct |
3 ms |
6940 KB |
Output is correct |
25 |
Correct |
3 ms |
6940 KB |
Output is correct |
26 |
Correct |
3 ms |
6940 KB |
Output is correct |
27 |
Correct |
4 ms |
6940 KB |
Output is correct |
28 |
Correct |
3 ms |
6940 KB |
Output is correct |
29 |
Correct |
1 ms |
6492 KB |
Output is correct |
30 |
Correct |
1 ms |
6492 KB |
Output is correct |
31 |
Correct |
1 ms |
6492 KB |
Output is correct |
32 |
Correct |
1 ms |
6492 KB |
Output is correct |
33 |
Correct |
1 ms |
6492 KB |
Output is correct |
34 |
Correct |
1 ms |
6492 KB |
Output is correct |
35 |
Correct |
3 ms |
6936 KB |
Output is correct |
36 |
Correct |
3 ms |
6940 KB |
Output is correct |
37 |
Correct |
4 ms |
6940 KB |
Output is correct |
38 |
Correct |
4 ms |
6940 KB |
Output is correct |
39 |
Correct |
4 ms |
6936 KB |
Output is correct |
40 |
Correct |
4 ms |
6940 KB |
Output is correct |
41 |
Correct |
3 ms |
6940 KB |
Output is correct |
42 |
Correct |
3 ms |
6940 KB |
Output is correct |
43 |
Correct |
4 ms |
6940 KB |
Output is correct |
44 |
Correct |
4 ms |
6940 KB |
Output is correct |
45 |
Correct |
4 ms |
6940 KB |
Output is correct |
46 |
Correct |
4 ms |
6936 KB |
Output is correct |
47 |
Correct |
3 ms |
6940 KB |
Output is correct |
48 |
Correct |
3 ms |
6940 KB |
Output is correct |
49 |
Correct |
3 ms |
6932 KB |
Output is correct |
50 |
Correct |
5 ms |
7004 KB |
Output is correct |
51 |
Correct |
4 ms |
7004 KB |
Output is correct |
52 |
Correct |
4 ms |
7004 KB |
Output is correct |
53 |
Correct |
4 ms |
7004 KB |
Output is correct |
54 |
Correct |
3 ms |
6940 KB |
Output is correct |
55 |
Correct |
3 ms |
6880 KB |
Output is correct |
56 |
Correct |
3 ms |
6936 KB |
Output is correct |
57 |
Correct |
4 ms |
7004 KB |
Output is correct |
58 |
Correct |
4 ms |
6880 KB |
Output is correct |
59 |
Correct |
4 ms |
7004 KB |
Output is correct |
60 |
Correct |
3 ms |
7004 KB |
Output is correct |
61 |
Correct |
4 ms |
7004 KB |
Output is correct |
62 |
Correct |
3 ms |
7004 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
6488 KB |
Output is correct |
2 |
Correct |
1 ms |
6488 KB |
Output is correct |
3 |
Correct |
1 ms |
6492 KB |
Output is correct |
4 |
Correct |
4 ms |
6940 KB |
Output is correct |
5 |
Correct |
3 ms |
7192 KB |
Output is correct |
6 |
Correct |
3 ms |
6940 KB |
Output is correct |
7 |
Correct |
3 ms |
6940 KB |
Output is correct |
8 |
Correct |
3 ms |
6936 KB |
Output is correct |
9 |
Correct |
3 ms |
6940 KB |
Output is correct |
10 |
Correct |
3 ms |
6940 KB |
Output is correct |
11 |
Correct |
3 ms |
6940 KB |
Output is correct |
12 |
Correct |
3 ms |
6940 KB |
Output is correct |
13 |
Correct |
3 ms |
6936 KB |
Output is correct |
14 |
Correct |
1 ms |
6492 KB |
Output is correct |
15 |
Correct |
1 ms |
6492 KB |
Output is correct |
16 |
Correct |
3 ms |
6940 KB |
Output is correct |
17 |
Correct |
3 ms |
6940 KB |
Output is correct |
18 |
Correct |
3 ms |
6940 KB |
Output is correct |
19 |
Correct |
4 ms |
6936 KB |
Output is correct |
20 |
Correct |
4 ms |
6940 KB |
Output is correct |
21 |
Correct |
3 ms |
6936 KB |
Output is correct |
22 |
Correct |
3 ms |
6940 KB |
Output is correct |
23 |
Correct |
3 ms |
6940 KB |
Output is correct |
24 |
Correct |
3 ms |
6940 KB |
Output is correct |
25 |
Correct |
3 ms |
6940 KB |
Output is correct |
26 |
Correct |
3 ms |
6940 KB |
Output is correct |
27 |
Correct |
4 ms |
6940 KB |
Output is correct |
28 |
Correct |
3 ms |
6940 KB |
Output is correct |
29 |
Correct |
1 ms |
6492 KB |
Output is correct |
30 |
Correct |
1 ms |
6492 KB |
Output is correct |
31 |
Correct |
1 ms |
6492 KB |
Output is correct |
32 |
Correct |
1 ms |
6492 KB |
Output is correct |
33 |
Correct |
1 ms |
6492 KB |
Output is correct |
34 |
Correct |
1 ms |
6492 KB |
Output is correct |
35 |
Correct |
799 ms |
81588 KB |
Output is correct |
36 |
Correct |
807 ms |
82868 KB |
Output is correct |
37 |
Correct |
762 ms |
81452 KB |
Output is correct |
38 |
Correct |
778 ms |
81068 KB |
Output is correct |
39 |
Correct |
788 ms |
82852 KB |
Output is correct |
40 |
Correct |
1 ms |
6488 KB |
Output is correct |
41 |
Correct |
1 ms |
6492 KB |
Output is correct |
42 |
Correct |
649 ms |
81212 KB |
Output is correct |
43 |
Correct |
638 ms |
81848 KB |
Output is correct |
44 |
Correct |
653 ms |
82608 KB |
Output is correct |
45 |
Correct |
527 ms |
81588 KB |
Output is correct |
46 |
Correct |
578 ms |
82856 KB |
Output is correct |
47 |
Correct |
580 ms |
81536 KB |
Output is correct |
48 |
Correct |
625 ms |
81712 KB |
Output is correct |
49 |
Correct |
636 ms |
81324 KB |
Output is correct |
50 |
Correct |
623 ms |
81832 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
6488 KB |
Output is correct |
2 |
Correct |
1 ms |
6488 KB |
Output is correct |
3 |
Correct |
1 ms |
6492 KB |
Output is correct |
4 |
Correct |
4 ms |
6940 KB |
Output is correct |
5 |
Correct |
3 ms |
7192 KB |
Output is correct |
6 |
Correct |
3 ms |
6940 KB |
Output is correct |
7 |
Correct |
3 ms |
6940 KB |
Output is correct |
8 |
Correct |
3 ms |
6936 KB |
Output is correct |
9 |
Correct |
3 ms |
6940 KB |
Output is correct |
10 |
Correct |
3 ms |
6940 KB |
Output is correct |
11 |
Correct |
3 ms |
6940 KB |
Output is correct |
12 |
Correct |
3 ms |
6940 KB |
Output is correct |
13 |
Correct |
3 ms |
6936 KB |
Output is correct |
14 |
Correct |
1 ms |
6492 KB |
Output is correct |
15 |
Correct |
1 ms |
6492 KB |
Output is correct |
16 |
Correct |
3 ms |
6940 KB |
Output is correct |
17 |
Correct |
3 ms |
6940 KB |
Output is correct |
18 |
Correct |
3 ms |
6940 KB |
Output is correct |
19 |
Correct |
4 ms |
6936 KB |
Output is correct |
20 |
Correct |
4 ms |
6940 KB |
Output is correct |
21 |
Correct |
3 ms |
6936 KB |
Output is correct |
22 |
Correct |
3 ms |
6940 KB |
Output is correct |
23 |
Correct |
3 ms |
6940 KB |
Output is correct |
24 |
Correct |
3 ms |
6940 KB |
Output is correct |
25 |
Correct |
3 ms |
6940 KB |
Output is correct |
26 |
Correct |
3 ms |
6940 KB |
Output is correct |
27 |
Correct |
4 ms |
6940 KB |
Output is correct |
28 |
Correct |
3 ms |
6940 KB |
Output is correct |
29 |
Correct |
1 ms |
6492 KB |
Output is correct |
30 |
Correct |
1 ms |
6492 KB |
Output is correct |
31 |
Correct |
1 ms |
6492 KB |
Output is correct |
32 |
Correct |
1 ms |
6492 KB |
Output is correct |
33 |
Correct |
1 ms |
6492 KB |
Output is correct |
34 |
Correct |
1 ms |
6492 KB |
Output is correct |
35 |
Correct |
3 ms |
6936 KB |
Output is correct |
36 |
Correct |
3 ms |
6940 KB |
Output is correct |
37 |
Correct |
4 ms |
6940 KB |
Output is correct |
38 |
Correct |
4 ms |
6940 KB |
Output is correct |
39 |
Correct |
4 ms |
6936 KB |
Output is correct |
40 |
Correct |
4 ms |
6940 KB |
Output is correct |
41 |
Correct |
3 ms |
6940 KB |
Output is correct |
42 |
Correct |
3 ms |
6940 KB |
Output is correct |
43 |
Correct |
4 ms |
6940 KB |
Output is correct |
44 |
Correct |
4 ms |
6940 KB |
Output is correct |
45 |
Correct |
4 ms |
6940 KB |
Output is correct |
46 |
Correct |
4 ms |
6936 KB |
Output is correct |
47 |
Correct |
3 ms |
6940 KB |
Output is correct |
48 |
Correct |
3 ms |
6940 KB |
Output is correct |
49 |
Correct |
799 ms |
81588 KB |
Output is correct |
50 |
Correct |
807 ms |
82868 KB |
Output is correct |
51 |
Correct |
762 ms |
81452 KB |
Output is correct |
52 |
Correct |
778 ms |
81068 KB |
Output is correct |
53 |
Correct |
788 ms |
82852 KB |
Output is correct |
54 |
Correct |
1 ms |
6488 KB |
Output is correct |
55 |
Correct |
1 ms |
6492 KB |
Output is correct |
56 |
Correct |
649 ms |
81212 KB |
Output is correct |
57 |
Correct |
638 ms |
81848 KB |
Output is correct |
58 |
Correct |
653 ms |
82608 KB |
Output is correct |
59 |
Correct |
527 ms |
81588 KB |
Output is correct |
60 |
Correct |
578 ms |
82856 KB |
Output is correct |
61 |
Correct |
580 ms |
81536 KB |
Output is correct |
62 |
Correct |
625 ms |
81712 KB |
Output is correct |
63 |
Correct |
636 ms |
81324 KB |
Output is correct |
64 |
Correct |
623 ms |
81832 KB |
Output is correct |
65 |
Correct |
883 ms |
82100 KB |
Output is correct |
66 |
Correct |
895 ms |
82852 KB |
Output is correct |
67 |
Correct |
933 ms |
86568 KB |
Output is correct |
68 |
Correct |
889 ms |
85348 KB |
Output is correct |
69 |
Correct |
871 ms |
85536 KB |
Output is correct |
70 |
Correct |
615 ms |
82872 KB |
Output is correct |
71 |
Correct |
638 ms |
82404 KB |
Output is correct |
72 |
Correct |
633 ms |
83124 KB |
Output is correct |
73 |
Correct |
740 ms |
85376 KB |
Output is correct |
74 |
Correct |
728 ms |
86172 KB |
Output is correct |
75 |
Correct |
735 ms |
85336 KB |
Output is correct |
76 |
Correct |
693 ms |
86700 KB |
Output is correct |
77 |
Correct |
676 ms |
85164 KB |
Output is correct |
78 |
Correct |
706 ms |
85428 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
6488 KB |
Output is correct |
2 |
Correct |
1 ms |
6488 KB |
Output is correct |
3 |
Correct |
1 ms |
6492 KB |
Output is correct |
4 |
Correct |
4 ms |
6940 KB |
Output is correct |
5 |
Correct |
3 ms |
7192 KB |
Output is correct |
6 |
Correct |
3 ms |
6940 KB |
Output is correct |
7 |
Correct |
3 ms |
6940 KB |
Output is correct |
8 |
Correct |
3 ms |
6936 KB |
Output is correct |
9 |
Correct |
3 ms |
6940 KB |
Output is correct |
10 |
Correct |
3 ms |
6940 KB |
Output is correct |
11 |
Correct |
3 ms |
6940 KB |
Output is correct |
12 |
Correct |
3 ms |
6940 KB |
Output is correct |
13 |
Correct |
3 ms |
6936 KB |
Output is correct |
14 |
Correct |
1 ms |
6492 KB |
Output is correct |
15 |
Correct |
1 ms |
6492 KB |
Output is correct |
16 |
Correct |
3 ms |
6940 KB |
Output is correct |
17 |
Correct |
3 ms |
6940 KB |
Output is correct |
18 |
Correct |
3 ms |
6940 KB |
Output is correct |
19 |
Correct |
4 ms |
6936 KB |
Output is correct |
20 |
Correct |
4 ms |
6940 KB |
Output is correct |
21 |
Correct |
3 ms |
6936 KB |
Output is correct |
22 |
Correct |
3 ms |
6940 KB |
Output is correct |
23 |
Correct |
3 ms |
6940 KB |
Output is correct |
24 |
Correct |
3 ms |
6940 KB |
Output is correct |
25 |
Correct |
3 ms |
6940 KB |
Output is correct |
26 |
Correct |
3 ms |
6940 KB |
Output is correct |
27 |
Correct |
4 ms |
6940 KB |
Output is correct |
28 |
Correct |
3 ms |
6940 KB |
Output is correct |
29 |
Correct |
1 ms |
6492 KB |
Output is correct |
30 |
Correct |
1 ms |
6492 KB |
Output is correct |
31 |
Correct |
1 ms |
6492 KB |
Output is correct |
32 |
Correct |
1 ms |
6492 KB |
Output is correct |
33 |
Correct |
1 ms |
6492 KB |
Output is correct |
34 |
Correct |
1 ms |
6492 KB |
Output is correct |
35 |
Correct |
3 ms |
6936 KB |
Output is correct |
36 |
Correct |
3 ms |
6940 KB |
Output is correct |
37 |
Correct |
4 ms |
6940 KB |
Output is correct |
38 |
Correct |
4 ms |
6940 KB |
Output is correct |
39 |
Correct |
4 ms |
6936 KB |
Output is correct |
40 |
Correct |
4 ms |
6940 KB |
Output is correct |
41 |
Correct |
3 ms |
6940 KB |
Output is correct |
42 |
Correct |
3 ms |
6940 KB |
Output is correct |
43 |
Correct |
4 ms |
6940 KB |
Output is correct |
44 |
Correct |
4 ms |
6940 KB |
Output is correct |
45 |
Correct |
4 ms |
6940 KB |
Output is correct |
46 |
Correct |
4 ms |
6936 KB |
Output is correct |
47 |
Correct |
3 ms |
6940 KB |
Output is correct |
48 |
Correct |
3 ms |
6940 KB |
Output is correct |
49 |
Correct |
3 ms |
6932 KB |
Output is correct |
50 |
Correct |
5 ms |
7004 KB |
Output is correct |
51 |
Correct |
4 ms |
7004 KB |
Output is correct |
52 |
Correct |
4 ms |
7004 KB |
Output is correct |
53 |
Correct |
4 ms |
7004 KB |
Output is correct |
54 |
Correct |
3 ms |
6940 KB |
Output is correct |
55 |
Correct |
3 ms |
6880 KB |
Output is correct |
56 |
Correct |
3 ms |
6936 KB |
Output is correct |
57 |
Correct |
4 ms |
7004 KB |
Output is correct |
58 |
Correct |
4 ms |
6880 KB |
Output is correct |
59 |
Correct |
4 ms |
7004 KB |
Output is correct |
60 |
Correct |
3 ms |
7004 KB |
Output is correct |
61 |
Correct |
4 ms |
7004 KB |
Output is correct |
62 |
Correct |
3 ms |
7004 KB |
Output is correct |
63 |
Correct |
799 ms |
81588 KB |
Output is correct |
64 |
Correct |
807 ms |
82868 KB |
Output is correct |
65 |
Correct |
762 ms |
81452 KB |
Output is correct |
66 |
Correct |
778 ms |
81068 KB |
Output is correct |
67 |
Correct |
788 ms |
82852 KB |
Output is correct |
68 |
Correct |
1 ms |
6488 KB |
Output is correct |
69 |
Correct |
1 ms |
6492 KB |
Output is correct |
70 |
Correct |
649 ms |
81212 KB |
Output is correct |
71 |
Correct |
638 ms |
81848 KB |
Output is correct |
72 |
Correct |
653 ms |
82608 KB |
Output is correct |
73 |
Correct |
527 ms |
81588 KB |
Output is correct |
74 |
Correct |
578 ms |
82856 KB |
Output is correct |
75 |
Correct |
580 ms |
81536 KB |
Output is correct |
76 |
Correct |
625 ms |
81712 KB |
Output is correct |
77 |
Correct |
636 ms |
81324 KB |
Output is correct |
78 |
Correct |
623 ms |
81832 KB |
Output is correct |
79 |
Correct |
883 ms |
82100 KB |
Output is correct |
80 |
Correct |
895 ms |
82852 KB |
Output is correct |
81 |
Correct |
933 ms |
86568 KB |
Output is correct |
82 |
Correct |
889 ms |
85348 KB |
Output is correct |
83 |
Correct |
871 ms |
85536 KB |
Output is correct |
84 |
Correct |
615 ms |
82872 KB |
Output is correct |
85 |
Correct |
638 ms |
82404 KB |
Output is correct |
86 |
Correct |
633 ms |
83124 KB |
Output is correct |
87 |
Correct |
740 ms |
85376 KB |
Output is correct |
88 |
Correct |
728 ms |
86172 KB |
Output is correct |
89 |
Correct |
735 ms |
85336 KB |
Output is correct |
90 |
Correct |
693 ms |
86700 KB |
Output is correct |
91 |
Correct |
676 ms |
85164 KB |
Output is correct |
92 |
Correct |
706 ms |
85428 KB |
Output is correct |
93 |
Correct |
620 ms |
84900 KB |
Output is correct |
94 |
Correct |
807 ms |
90808 KB |
Output is correct |
95 |
Correct |
785 ms |
91436 KB |
Output is correct |
96 |
Correct |
830 ms |
91816 KB |
Output is correct |
97 |
Correct |
737 ms |
90796 KB |
Output is correct |
98 |
Correct |
725 ms |
91936 KB |
Output is correct |
99 |
Correct |
750 ms |
92824 KB |
Output is correct |
100 |
Correct |
927 ms |
90808 KB |
Output is correct |
101 |
Correct |
931 ms |
91484 KB |
Output is correct |
102 |
Correct |
933 ms |
92080 KB |
Output is correct |
103 |
Correct |
906 ms |
92192 KB |
Output is correct |
104 |
Correct |
941 ms |
91176 KB |
Output is correct |
105 |
Correct |
627 ms |
84664 KB |
Output is correct |
106 |
Correct |
650 ms |
83624 KB |
Output is correct |