#include <bits/stdc++.h>
#define ll long long
#define fi first
#define se second
#define endl '\n'
#define MASK(i) (1LL << (i))
#define ull unsigned long long
#define ld long double
#define pb push_back
#define all(x) (x).begin() , (x).end()
#define BIT(x , i) ((x >> (i)) & 1)
#define TASK "task"
#define sz(s) (int) (s).size()
using namespace std;
const int mxN = 1e6 + 227;
const int inf = 1e9 + 277;
const int mod = 1e6 + 3;
const ll infll = 1e18 + 7;
const int base = 307;
const int LOG = 20;
template <typename T1, typename T2> bool minimize(T1 &a, T2 b) {
if (a > b) {a = b; return true;} return false;
}
template <typename T1, typename T2> bool maximize(T1 &a, T2 b) {
if (a < b) {a = b; return true;} return false;
}
struct Segtree{
int n;
vector<int> t;
Segtree(){}
Segtree(int _n) {
n = _n;
int offset = 1;
while(offset <= n) offset *= 2;
t.resize(offset * 2 + 7, inf);
}
void update(int v, int tl, int tr, int pos, int val) {
if(tl == tr) {
t[v] = val;
}
else {
int tm = (tl + tr) / 2;
if(pos <= tm) update(v * 2, tl, tm, pos, val);
else update(v * 2 + 1, tm + 1, tr, pos, val);
t[v] = min(t[v * 2], t[v * 2 + 1]);
}
}
int getmin(int v, int tl, int tr, int l, int r) {
if(l > r) return inf;
if(tl == l && tr == r) return t[v];
int tm = (tl + tr) / 2;
int m1 = getmin(v * 2, tl, tm, l, min(r, tm));
int m2 = getmin(v * 2 + 1, tm + 1, tr, max(l, tm + 1), r);
return min(m1, m2);
}
void update(int pos, int val) {
update(1, 1, n, pos, val);
}
int getmin(int l, int r) {
return getmin(1, 1, n, l, r);
}
} seg;
int n;
int a[mxN];
int b[mxN];
int getsum(int l, int r) {
if(l > r) return 0;
return (1LL * (r + l) * (r - l + 1) / 2) % mod;
}
void add(int &a, int b) {
a += b;
if(a >= mod)
a -= mod;
}
void solve()
{
cin >> n;
for(int i = 1; i <= n; i++) cin >> a[i];
vector<pair<int, int>> order;
for(int i = 1; i <= n; i++) order.pb({a[i], i});
sort(all(order));
int mx = *max_element(a + 1, a + n + 1);
int p = -1;
for(int i = 1; i <= n; i++) if(a[i] == mx) p = i;
int curmax = -1;
for(int i = 1; i <= p; i++) {
maximize(curmax, a[i]);
b[i] = curmax;
}
curmax = -1;
for(int i = n; i >= p; i--) {
maximize(curmax, a[i]);
b[i] = curmax;
}
vector<pair<int, int>> order2;
for(int i = 1; i <= n; i++) if(a[i] != b[i]) {
order2.pb({b[i], i});
}
sort(all(order2));
seg = Segtree(n);
for(int i = 1; i <= n; i++) seg.update(i, a[i]);
int res = 0;
int j = 0;
p = 0;
set<int> s;
while(p < sz(order)) {
int nxt = p;
while(nxt < sz(order) && order[p].fi == order[nxt].fi) {
seg.update(order[nxt].se, inf);
if(a[order[nxt].se] != b[order[nxt].se]) s.insert(order[nxt].se);
++nxt;
}
int curval = order[p].fi;
p = nxt;
// for(auto it : s) cout << it << ' ';
// cout << endl;
while(j < sz(order2) && order2[j].fi == curval) {
s.erase(s.find(order2[j].se));
++j;
}
if(sz(s) == 0) continue;
if(sz(s) > 1) {
int p1 = *s.begin();
int p2 = *--s.end();
int l1 = seg.getmin(1, p1 - 1);
int r1 = seg.getmin(p1 + 1, n);
int l2 = seg.getmin(1, p2 - 1);
int r2 = seg.getmin(p2 + 1, n);
// cout << l1 << ' ' << r1 << ' ' << l2 << ' ' << r2 << endl;
int minval = min({l1, r1, l2, r2});
if(r1 <= l2) {
add(res, getsum(curval, minval - 1));
add(res, 1LL * l1 * (minval - curval) % mod);
add(res, 1LL * r1 * (minval - curval) % mod);
add(res, getsum(curval, minval - 1));
add(res, getsum(curval + 1, minval));
add(res, 1LL * r2 * (minval - curval) % mod);
}
else {
add(res, getsum(curval, minval - 1));
add(res, 1LL * l2 * (minval - curval) % mod);
add(res, 1LL * r2 * (minval - curval) % mod);
// cout << res << endl;
add(res, getsum(curval, minval - 1));
add(res, 1LL * l1 * (minval - curval) % mod);
add(res, getsum(curval + 1, minval));
}
add(res, 2LL * getsum(curval + 1, minval) % mod * (sz(s) - 2) % mod);
add(res, 1LL * (sz(s) - 2) * getsum(curval, minval - 1) % mod);
}
else {
int p1 = *s.begin();
int l1 = seg.getmin(1, p1 - 1);
int r1 = seg.getmin(p1 + 1, n);
// cout << l1 << ' ' << r1 << endl;
int minval = min(l1, r1);
add(res, getsum(curval, minval - 1));
add(res, 1LL * l1 * (minval - curval) % mod);
add(res, 1LL * r1 * (minval - curval) % mod);
}
}
cout << res;
}
int main()
{
ios_base::sync_with_stdio(false);
cin.tie(nullptr);
int tc = 1;
//cin >> tc;
while(tc--) {
solve();
}
return 0;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
344 KB |
Output is correct |
2 |
Correct |
1 ms |
344 KB |
Output is correct |
3 |
Correct |
0 ms |
348 KB |
Output is correct |
4 |
Correct |
2 ms |
860 KB |
Output is correct |
5 |
Correct |
1 ms |
604 KB |
Output is correct |
6 |
Correct |
2 ms |
604 KB |
Output is correct |
7 |
Correct |
1 ms |
616 KB |
Output is correct |
8 |
Correct |
2 ms |
856 KB |
Output is correct |
9 |
Correct |
2 ms |
604 KB |
Output is correct |
10 |
Correct |
1 ms |
604 KB |
Output is correct |
11 |
Correct |
2 ms |
860 KB |
Output is correct |
12 |
Correct |
2 ms |
860 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
344 KB |
Output is correct |
2 |
Correct |
1 ms |
344 KB |
Output is correct |
3 |
Correct |
0 ms |
348 KB |
Output is correct |
4 |
Correct |
2 ms |
860 KB |
Output is correct |
5 |
Correct |
1 ms |
604 KB |
Output is correct |
6 |
Correct |
2 ms |
604 KB |
Output is correct |
7 |
Correct |
1 ms |
616 KB |
Output is correct |
8 |
Correct |
2 ms |
856 KB |
Output is correct |
9 |
Correct |
2 ms |
604 KB |
Output is correct |
10 |
Correct |
1 ms |
604 KB |
Output is correct |
11 |
Correct |
2 ms |
860 KB |
Output is correct |
12 |
Correct |
2 ms |
860 KB |
Output is correct |
13 |
Correct |
3 ms |
860 KB |
Output is correct |
14 |
Correct |
0 ms |
348 KB |
Output is correct |
15 |
Correct |
0 ms |
348 KB |
Output is correct |
16 |
Correct |
3 ms |
860 KB |
Output is correct |
17 |
Correct |
3 ms |
856 KB |
Output is correct |
18 |
Correct |
3 ms |
860 KB |
Output is correct |
19 |
Correct |
3 ms |
896 KB |
Output is correct |
20 |
Correct |
2 ms |
860 KB |
Output is correct |
21 |
Correct |
2 ms |
872 KB |
Output is correct |
22 |
Correct |
3 ms |
860 KB |
Output is correct |
23 |
Correct |
2 ms |
860 KB |
Output is correct |
24 |
Correct |
2 ms |
860 KB |
Output is correct |
25 |
Correct |
2 ms |
860 KB |
Output is correct |
26 |
Correct |
2 ms |
860 KB |
Output is correct |
27 |
Correct |
4 ms |
860 KB |
Output is correct |
28 |
Correct |
2 ms |
860 KB |
Output is correct |
29 |
Correct |
0 ms |
352 KB |
Output is correct |
30 |
Correct |
0 ms |
348 KB |
Output is correct |
31 |
Correct |
0 ms |
348 KB |
Output is correct |
32 |
Correct |
0 ms |
348 KB |
Output is correct |
33 |
Correct |
0 ms |
348 KB |
Output is correct |
34 |
Correct |
0 ms |
464 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
344 KB |
Output is correct |
2 |
Correct |
1 ms |
344 KB |
Output is correct |
3 |
Correct |
0 ms |
348 KB |
Output is correct |
4 |
Correct |
2 ms |
860 KB |
Output is correct |
5 |
Correct |
1 ms |
604 KB |
Output is correct |
6 |
Correct |
2 ms |
604 KB |
Output is correct |
7 |
Correct |
1 ms |
616 KB |
Output is correct |
8 |
Correct |
2 ms |
856 KB |
Output is correct |
9 |
Correct |
2 ms |
604 KB |
Output is correct |
10 |
Correct |
1 ms |
604 KB |
Output is correct |
11 |
Correct |
2 ms |
860 KB |
Output is correct |
12 |
Correct |
2 ms |
860 KB |
Output is correct |
13 |
Correct |
3 ms |
860 KB |
Output is correct |
14 |
Correct |
0 ms |
348 KB |
Output is correct |
15 |
Correct |
0 ms |
348 KB |
Output is correct |
16 |
Correct |
3 ms |
860 KB |
Output is correct |
17 |
Correct |
3 ms |
856 KB |
Output is correct |
18 |
Correct |
3 ms |
860 KB |
Output is correct |
19 |
Correct |
3 ms |
896 KB |
Output is correct |
20 |
Correct |
2 ms |
860 KB |
Output is correct |
21 |
Correct |
2 ms |
872 KB |
Output is correct |
22 |
Correct |
3 ms |
860 KB |
Output is correct |
23 |
Correct |
2 ms |
860 KB |
Output is correct |
24 |
Correct |
2 ms |
860 KB |
Output is correct |
25 |
Correct |
2 ms |
860 KB |
Output is correct |
26 |
Correct |
2 ms |
860 KB |
Output is correct |
27 |
Correct |
4 ms |
860 KB |
Output is correct |
28 |
Correct |
2 ms |
860 KB |
Output is correct |
29 |
Correct |
0 ms |
352 KB |
Output is correct |
30 |
Correct |
0 ms |
348 KB |
Output is correct |
31 |
Correct |
0 ms |
348 KB |
Output is correct |
32 |
Correct |
0 ms |
348 KB |
Output is correct |
33 |
Correct |
0 ms |
348 KB |
Output is correct |
34 |
Correct |
0 ms |
464 KB |
Output is correct |
35 |
Correct |
6 ms |
860 KB |
Output is correct |
36 |
Correct |
4 ms |
856 KB |
Output is correct |
37 |
Correct |
4 ms |
860 KB |
Output is correct |
38 |
Correct |
3 ms |
860 KB |
Output is correct |
39 |
Correct |
4 ms |
860 KB |
Output is correct |
40 |
Correct |
3 ms |
764 KB |
Output is correct |
41 |
Correct |
2 ms |
860 KB |
Output is correct |
42 |
Correct |
2 ms |
740 KB |
Output is correct |
43 |
Correct |
3 ms |
860 KB |
Output is correct |
44 |
Correct |
3 ms |
860 KB |
Output is correct |
45 |
Correct |
5 ms |
744 KB |
Output is correct |
46 |
Correct |
4 ms |
860 KB |
Output is correct |
47 |
Correct |
3 ms |
860 KB |
Output is correct |
48 |
Correct |
3 ms |
860 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
344 KB |
Output is correct |
2 |
Correct |
1 ms |
344 KB |
Output is correct |
3 |
Correct |
0 ms |
348 KB |
Output is correct |
4 |
Correct |
2 ms |
860 KB |
Output is correct |
5 |
Correct |
1 ms |
604 KB |
Output is correct |
6 |
Correct |
2 ms |
604 KB |
Output is correct |
7 |
Correct |
1 ms |
616 KB |
Output is correct |
8 |
Correct |
2 ms |
856 KB |
Output is correct |
9 |
Correct |
2 ms |
604 KB |
Output is correct |
10 |
Correct |
1 ms |
604 KB |
Output is correct |
11 |
Correct |
2 ms |
860 KB |
Output is correct |
12 |
Correct |
2 ms |
860 KB |
Output is correct |
13 |
Correct |
3 ms |
860 KB |
Output is correct |
14 |
Correct |
0 ms |
348 KB |
Output is correct |
15 |
Correct |
0 ms |
348 KB |
Output is correct |
16 |
Correct |
3 ms |
860 KB |
Output is correct |
17 |
Correct |
3 ms |
856 KB |
Output is correct |
18 |
Correct |
3 ms |
860 KB |
Output is correct |
19 |
Correct |
3 ms |
896 KB |
Output is correct |
20 |
Correct |
2 ms |
860 KB |
Output is correct |
21 |
Correct |
2 ms |
872 KB |
Output is correct |
22 |
Correct |
3 ms |
860 KB |
Output is correct |
23 |
Correct |
2 ms |
860 KB |
Output is correct |
24 |
Correct |
2 ms |
860 KB |
Output is correct |
25 |
Correct |
2 ms |
860 KB |
Output is correct |
26 |
Correct |
2 ms |
860 KB |
Output is correct |
27 |
Correct |
4 ms |
860 KB |
Output is correct |
28 |
Correct |
2 ms |
860 KB |
Output is correct |
29 |
Correct |
0 ms |
352 KB |
Output is correct |
30 |
Correct |
0 ms |
348 KB |
Output is correct |
31 |
Correct |
0 ms |
348 KB |
Output is correct |
32 |
Correct |
0 ms |
348 KB |
Output is correct |
33 |
Correct |
0 ms |
348 KB |
Output is correct |
34 |
Correct |
0 ms |
464 KB |
Output is correct |
35 |
Correct |
6 ms |
860 KB |
Output is correct |
36 |
Correct |
4 ms |
856 KB |
Output is correct |
37 |
Correct |
4 ms |
860 KB |
Output is correct |
38 |
Correct |
3 ms |
860 KB |
Output is correct |
39 |
Correct |
4 ms |
860 KB |
Output is correct |
40 |
Correct |
3 ms |
764 KB |
Output is correct |
41 |
Correct |
2 ms |
860 KB |
Output is correct |
42 |
Correct |
2 ms |
740 KB |
Output is correct |
43 |
Correct |
3 ms |
860 KB |
Output is correct |
44 |
Correct |
3 ms |
860 KB |
Output is correct |
45 |
Correct |
5 ms |
744 KB |
Output is correct |
46 |
Correct |
4 ms |
860 KB |
Output is correct |
47 |
Correct |
3 ms |
860 KB |
Output is correct |
48 |
Correct |
3 ms |
860 KB |
Output is correct |
49 |
Correct |
4 ms |
740 KB |
Output is correct |
50 |
Correct |
4 ms |
860 KB |
Output is correct |
51 |
Correct |
4 ms |
860 KB |
Output is correct |
52 |
Correct |
4 ms |
860 KB |
Output is correct |
53 |
Correct |
4 ms |
860 KB |
Output is correct |
54 |
Correct |
2 ms |
860 KB |
Output is correct |
55 |
Correct |
2 ms |
860 KB |
Output is correct |
56 |
Correct |
2 ms |
728 KB |
Output is correct |
57 |
Correct |
4 ms |
736 KB |
Output is correct |
58 |
Correct |
4 ms |
860 KB |
Output is correct |
59 |
Correct |
3 ms |
860 KB |
Output is correct |
60 |
Correct |
3 ms |
860 KB |
Output is correct |
61 |
Correct |
3 ms |
860 KB |
Output is correct |
62 |
Correct |
4 ms |
856 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
344 KB |
Output is correct |
2 |
Correct |
1 ms |
344 KB |
Output is correct |
3 |
Correct |
0 ms |
348 KB |
Output is correct |
4 |
Correct |
2 ms |
860 KB |
Output is correct |
5 |
Correct |
1 ms |
604 KB |
Output is correct |
6 |
Correct |
2 ms |
604 KB |
Output is correct |
7 |
Correct |
1 ms |
616 KB |
Output is correct |
8 |
Correct |
2 ms |
856 KB |
Output is correct |
9 |
Correct |
2 ms |
604 KB |
Output is correct |
10 |
Correct |
1 ms |
604 KB |
Output is correct |
11 |
Correct |
2 ms |
860 KB |
Output is correct |
12 |
Correct |
2 ms |
860 KB |
Output is correct |
13 |
Correct |
3 ms |
860 KB |
Output is correct |
14 |
Correct |
0 ms |
348 KB |
Output is correct |
15 |
Correct |
0 ms |
348 KB |
Output is correct |
16 |
Correct |
3 ms |
860 KB |
Output is correct |
17 |
Correct |
3 ms |
856 KB |
Output is correct |
18 |
Correct |
3 ms |
860 KB |
Output is correct |
19 |
Correct |
3 ms |
896 KB |
Output is correct |
20 |
Correct |
2 ms |
860 KB |
Output is correct |
21 |
Correct |
2 ms |
872 KB |
Output is correct |
22 |
Correct |
3 ms |
860 KB |
Output is correct |
23 |
Correct |
2 ms |
860 KB |
Output is correct |
24 |
Correct |
2 ms |
860 KB |
Output is correct |
25 |
Correct |
2 ms |
860 KB |
Output is correct |
26 |
Correct |
2 ms |
860 KB |
Output is correct |
27 |
Correct |
4 ms |
860 KB |
Output is correct |
28 |
Correct |
2 ms |
860 KB |
Output is correct |
29 |
Correct |
0 ms |
352 KB |
Output is correct |
30 |
Correct |
0 ms |
348 KB |
Output is correct |
31 |
Correct |
0 ms |
348 KB |
Output is correct |
32 |
Correct |
0 ms |
348 KB |
Output is correct |
33 |
Correct |
0 ms |
348 KB |
Output is correct |
34 |
Correct |
0 ms |
464 KB |
Output is correct |
35 |
Correct |
801 ms |
81344 KB |
Output is correct |
36 |
Correct |
768 ms |
81440 KB |
Output is correct |
37 |
Correct |
802 ms |
81376 KB |
Output is correct |
38 |
Correct |
782 ms |
81280 KB |
Output is correct |
39 |
Correct |
822 ms |
81340 KB |
Output is correct |
40 |
Correct |
1 ms |
348 KB |
Output is correct |
41 |
Correct |
0 ms |
348 KB |
Output is correct |
42 |
Correct |
531 ms |
81400 KB |
Output is correct |
43 |
Correct |
531 ms |
80932 KB |
Output is correct |
44 |
Correct |
501 ms |
80932 KB |
Output is correct |
45 |
Correct |
411 ms |
81192 KB |
Output is correct |
46 |
Correct |
407 ms |
81312 KB |
Output is correct |
47 |
Correct |
421 ms |
81188 KB |
Output is correct |
48 |
Correct |
512 ms |
81212 KB |
Output is correct |
49 |
Correct |
543 ms |
81304 KB |
Output is correct |
50 |
Correct |
549 ms |
81192 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
344 KB |
Output is correct |
2 |
Correct |
1 ms |
344 KB |
Output is correct |
3 |
Correct |
0 ms |
348 KB |
Output is correct |
4 |
Correct |
2 ms |
860 KB |
Output is correct |
5 |
Correct |
1 ms |
604 KB |
Output is correct |
6 |
Correct |
2 ms |
604 KB |
Output is correct |
7 |
Correct |
1 ms |
616 KB |
Output is correct |
8 |
Correct |
2 ms |
856 KB |
Output is correct |
9 |
Correct |
2 ms |
604 KB |
Output is correct |
10 |
Correct |
1 ms |
604 KB |
Output is correct |
11 |
Correct |
2 ms |
860 KB |
Output is correct |
12 |
Correct |
2 ms |
860 KB |
Output is correct |
13 |
Correct |
3 ms |
860 KB |
Output is correct |
14 |
Correct |
0 ms |
348 KB |
Output is correct |
15 |
Correct |
0 ms |
348 KB |
Output is correct |
16 |
Correct |
3 ms |
860 KB |
Output is correct |
17 |
Correct |
3 ms |
856 KB |
Output is correct |
18 |
Correct |
3 ms |
860 KB |
Output is correct |
19 |
Correct |
3 ms |
896 KB |
Output is correct |
20 |
Correct |
2 ms |
860 KB |
Output is correct |
21 |
Correct |
2 ms |
872 KB |
Output is correct |
22 |
Correct |
3 ms |
860 KB |
Output is correct |
23 |
Correct |
2 ms |
860 KB |
Output is correct |
24 |
Correct |
2 ms |
860 KB |
Output is correct |
25 |
Correct |
2 ms |
860 KB |
Output is correct |
26 |
Correct |
2 ms |
860 KB |
Output is correct |
27 |
Correct |
4 ms |
860 KB |
Output is correct |
28 |
Correct |
2 ms |
860 KB |
Output is correct |
29 |
Correct |
0 ms |
352 KB |
Output is correct |
30 |
Correct |
0 ms |
348 KB |
Output is correct |
31 |
Correct |
0 ms |
348 KB |
Output is correct |
32 |
Correct |
0 ms |
348 KB |
Output is correct |
33 |
Correct |
0 ms |
348 KB |
Output is correct |
34 |
Correct |
0 ms |
464 KB |
Output is correct |
35 |
Correct |
6 ms |
860 KB |
Output is correct |
36 |
Correct |
4 ms |
856 KB |
Output is correct |
37 |
Correct |
4 ms |
860 KB |
Output is correct |
38 |
Correct |
3 ms |
860 KB |
Output is correct |
39 |
Correct |
4 ms |
860 KB |
Output is correct |
40 |
Correct |
3 ms |
764 KB |
Output is correct |
41 |
Correct |
2 ms |
860 KB |
Output is correct |
42 |
Correct |
2 ms |
740 KB |
Output is correct |
43 |
Correct |
3 ms |
860 KB |
Output is correct |
44 |
Correct |
3 ms |
860 KB |
Output is correct |
45 |
Correct |
5 ms |
744 KB |
Output is correct |
46 |
Correct |
4 ms |
860 KB |
Output is correct |
47 |
Correct |
3 ms |
860 KB |
Output is correct |
48 |
Correct |
3 ms |
860 KB |
Output is correct |
49 |
Correct |
801 ms |
81344 KB |
Output is correct |
50 |
Correct |
768 ms |
81440 KB |
Output is correct |
51 |
Correct |
802 ms |
81376 KB |
Output is correct |
52 |
Correct |
782 ms |
81280 KB |
Output is correct |
53 |
Correct |
822 ms |
81340 KB |
Output is correct |
54 |
Correct |
1 ms |
348 KB |
Output is correct |
55 |
Correct |
0 ms |
348 KB |
Output is correct |
56 |
Correct |
531 ms |
81400 KB |
Output is correct |
57 |
Correct |
531 ms |
80932 KB |
Output is correct |
58 |
Correct |
501 ms |
80932 KB |
Output is correct |
59 |
Correct |
411 ms |
81192 KB |
Output is correct |
60 |
Correct |
407 ms |
81312 KB |
Output is correct |
61 |
Correct |
421 ms |
81188 KB |
Output is correct |
62 |
Correct |
512 ms |
81212 KB |
Output is correct |
63 |
Correct |
543 ms |
81304 KB |
Output is correct |
64 |
Correct |
549 ms |
81192 KB |
Output is correct |
65 |
Correct |
1281 ms |
85728 KB |
Output is correct |
66 |
Correct |
1281 ms |
85472 KB |
Output is correct |
67 |
Correct |
1228 ms |
85532 KB |
Output is correct |
68 |
Correct |
1261 ms |
85544 KB |
Output is correct |
69 |
Correct |
1220 ms |
85800 KB |
Output is correct |
70 |
Correct |
470 ms |
80932 KB |
Output is correct |
71 |
Correct |
486 ms |
81068 KB |
Output is correct |
72 |
Correct |
473 ms |
80936 KB |
Output is correct |
73 |
Correct |
667 ms |
85792 KB |
Output is correct |
74 |
Correct |
681 ms |
85796 KB |
Output is correct |
75 |
Correct |
684 ms |
85800 KB |
Output is correct |
76 |
Correct |
824 ms |
85540 KB |
Output is correct |
77 |
Correct |
808 ms |
85576 KB |
Output is correct |
78 |
Correct |
762 ms |
85288 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
344 KB |
Output is correct |
2 |
Correct |
1 ms |
344 KB |
Output is correct |
3 |
Correct |
0 ms |
348 KB |
Output is correct |
4 |
Correct |
2 ms |
860 KB |
Output is correct |
5 |
Correct |
1 ms |
604 KB |
Output is correct |
6 |
Correct |
2 ms |
604 KB |
Output is correct |
7 |
Correct |
1 ms |
616 KB |
Output is correct |
8 |
Correct |
2 ms |
856 KB |
Output is correct |
9 |
Correct |
2 ms |
604 KB |
Output is correct |
10 |
Correct |
1 ms |
604 KB |
Output is correct |
11 |
Correct |
2 ms |
860 KB |
Output is correct |
12 |
Correct |
2 ms |
860 KB |
Output is correct |
13 |
Correct |
3 ms |
860 KB |
Output is correct |
14 |
Correct |
0 ms |
348 KB |
Output is correct |
15 |
Correct |
0 ms |
348 KB |
Output is correct |
16 |
Correct |
3 ms |
860 KB |
Output is correct |
17 |
Correct |
3 ms |
856 KB |
Output is correct |
18 |
Correct |
3 ms |
860 KB |
Output is correct |
19 |
Correct |
3 ms |
896 KB |
Output is correct |
20 |
Correct |
2 ms |
860 KB |
Output is correct |
21 |
Correct |
2 ms |
872 KB |
Output is correct |
22 |
Correct |
3 ms |
860 KB |
Output is correct |
23 |
Correct |
2 ms |
860 KB |
Output is correct |
24 |
Correct |
2 ms |
860 KB |
Output is correct |
25 |
Correct |
2 ms |
860 KB |
Output is correct |
26 |
Correct |
2 ms |
860 KB |
Output is correct |
27 |
Correct |
4 ms |
860 KB |
Output is correct |
28 |
Correct |
2 ms |
860 KB |
Output is correct |
29 |
Correct |
0 ms |
352 KB |
Output is correct |
30 |
Correct |
0 ms |
348 KB |
Output is correct |
31 |
Correct |
0 ms |
348 KB |
Output is correct |
32 |
Correct |
0 ms |
348 KB |
Output is correct |
33 |
Correct |
0 ms |
348 KB |
Output is correct |
34 |
Correct |
0 ms |
464 KB |
Output is correct |
35 |
Correct |
6 ms |
860 KB |
Output is correct |
36 |
Correct |
4 ms |
856 KB |
Output is correct |
37 |
Correct |
4 ms |
860 KB |
Output is correct |
38 |
Correct |
3 ms |
860 KB |
Output is correct |
39 |
Correct |
4 ms |
860 KB |
Output is correct |
40 |
Correct |
3 ms |
764 KB |
Output is correct |
41 |
Correct |
2 ms |
860 KB |
Output is correct |
42 |
Correct |
2 ms |
740 KB |
Output is correct |
43 |
Correct |
3 ms |
860 KB |
Output is correct |
44 |
Correct |
3 ms |
860 KB |
Output is correct |
45 |
Correct |
5 ms |
744 KB |
Output is correct |
46 |
Correct |
4 ms |
860 KB |
Output is correct |
47 |
Correct |
3 ms |
860 KB |
Output is correct |
48 |
Correct |
3 ms |
860 KB |
Output is correct |
49 |
Correct |
4 ms |
740 KB |
Output is correct |
50 |
Correct |
4 ms |
860 KB |
Output is correct |
51 |
Correct |
4 ms |
860 KB |
Output is correct |
52 |
Correct |
4 ms |
860 KB |
Output is correct |
53 |
Correct |
4 ms |
860 KB |
Output is correct |
54 |
Correct |
2 ms |
860 KB |
Output is correct |
55 |
Correct |
2 ms |
860 KB |
Output is correct |
56 |
Correct |
2 ms |
728 KB |
Output is correct |
57 |
Correct |
4 ms |
736 KB |
Output is correct |
58 |
Correct |
4 ms |
860 KB |
Output is correct |
59 |
Correct |
3 ms |
860 KB |
Output is correct |
60 |
Correct |
3 ms |
860 KB |
Output is correct |
61 |
Correct |
3 ms |
860 KB |
Output is correct |
62 |
Correct |
4 ms |
856 KB |
Output is correct |
63 |
Correct |
801 ms |
81344 KB |
Output is correct |
64 |
Correct |
768 ms |
81440 KB |
Output is correct |
65 |
Correct |
802 ms |
81376 KB |
Output is correct |
66 |
Correct |
782 ms |
81280 KB |
Output is correct |
67 |
Correct |
822 ms |
81340 KB |
Output is correct |
68 |
Correct |
1 ms |
348 KB |
Output is correct |
69 |
Correct |
0 ms |
348 KB |
Output is correct |
70 |
Correct |
531 ms |
81400 KB |
Output is correct |
71 |
Correct |
531 ms |
80932 KB |
Output is correct |
72 |
Correct |
501 ms |
80932 KB |
Output is correct |
73 |
Correct |
411 ms |
81192 KB |
Output is correct |
74 |
Correct |
407 ms |
81312 KB |
Output is correct |
75 |
Correct |
421 ms |
81188 KB |
Output is correct |
76 |
Correct |
512 ms |
81212 KB |
Output is correct |
77 |
Correct |
543 ms |
81304 KB |
Output is correct |
78 |
Correct |
549 ms |
81192 KB |
Output is correct |
79 |
Correct |
1281 ms |
85728 KB |
Output is correct |
80 |
Correct |
1281 ms |
85472 KB |
Output is correct |
81 |
Correct |
1228 ms |
85532 KB |
Output is correct |
82 |
Correct |
1261 ms |
85544 KB |
Output is correct |
83 |
Correct |
1220 ms |
85800 KB |
Output is correct |
84 |
Correct |
470 ms |
80932 KB |
Output is correct |
85 |
Correct |
486 ms |
81068 KB |
Output is correct |
86 |
Correct |
473 ms |
80936 KB |
Output is correct |
87 |
Correct |
667 ms |
85792 KB |
Output is correct |
88 |
Correct |
681 ms |
85796 KB |
Output is correct |
89 |
Correct |
684 ms |
85800 KB |
Output is correct |
90 |
Correct |
824 ms |
85540 KB |
Output is correct |
91 |
Correct |
808 ms |
85576 KB |
Output is correct |
92 |
Correct |
762 ms |
85288 KB |
Output is correct |
93 |
Correct |
474 ms |
80972 KB |
Output is correct |
94 |
Correct |
784 ms |
88580 KB |
Output is correct |
95 |
Correct |
788 ms |
88560 KB |
Output is correct |
96 |
Correct |
800 ms |
88676 KB |
Output is correct |
97 |
Correct |
896 ms |
88108 KB |
Output is correct |
98 |
Correct |
947 ms |
88616 KB |
Output is correct |
99 |
Correct |
966 ms |
88292 KB |
Output is correct |
100 |
Correct |
1373 ms |
88568 KB |
Output is correct |
101 |
Correct |
1331 ms |
88556 KB |
Output is correct |
102 |
Correct |
1400 ms |
88664 KB |
Output is correct |
103 |
Correct |
1328 ms |
88592 KB |
Output is correct |
104 |
Correct |
1322 ms |
88612 KB |
Output is correct |
105 |
Correct |
453 ms |
81068 KB |
Output is correct |
106 |
Correct |
475 ms |
80928 KB |
Output is correct |