#include <bits/stdc++.h>
#define int long long
using namespace std;
typedef long long ll;
constexpr ll INF = 4e18;
constexpr int MOD = 1e6 + 3;
int n;
ll a[1001000], b[1001000];
vector<array<int, 2>> Ev[1001000];
struct Seg{
ll tree[2002000];
int sz;
void init(int n){
sz = n;
for (int i=sz;i<sz*2;i++) tree[i] = a[i-sz];
for (int i=sz-1;i;i--) tree[i] = min(tree[i<<1], tree[i<<1|1]);
}
void update(int p, ll x){
p += sz;
tree[p] = x;
for (p>>=1;p;p>>=1) tree[p] = min(tree[p<<1], tree[p<<1|1]);
}
ll query(int l, int r){
++r;
ll ret = INF;
for (l+=sz, r+=sz;l<r;l>>=1, r>>=1){
if (l&1) ret = min(ret, tree[l++]);
if (r&1) ret = min(ret, tree[--r]);
}
return ret;
}
}tree;
void genB(){
int idx = max_element(a+1, a+n+1) - a;
int cur = 0;
for (int i=1;i<=idx;i++){
if (cur <= a[i]){
b[i] = a[i];
cur = a[i];
}
else b[i] = cur;
}
cur = 0;
for (int i=n;i>=idx;i--){
if (cur <= a[i]){
b[i] = a[i];
cur = a[i];
}
else b[i] = cur;
}
}
ll rans;
int cnt;
void dfs(vector<int> A, ll cur){
cnt++;
if (cnt > 1e5) {rans = -1; return;}
// for (auto &x:A) printf("%d ", x);
// printf("-> %lld\n", cur);
int idx = max_element(A.begin(), A.end()) - A.begin();
bool flag = 1;
for (int i=0;i<idx;i++) if (A[i] > A[i+1]) flag = 0;
for (int i=(int)A.size()-1;i>idx;i--) if (A[i] > A[i-1]) flag = 0;
if (flag){
// printf("ok cur = %lld\n", cur);
rans = min(rans, cur);
return;
}
for (int i=0;i<(int)A.size();i++){
for (int j=i+1;j<(int)A.size();j++){
for (int k=j+1;k<(int)A.size();k++){
cnt++;
if (cnt > 1e5) {rans = -1; return;}
if (A[i] > A[j] && A[j] < A[k]){
cur += A[i] + A[j] + A[k];
A[j]++;
dfs(A, cur);
A[j]--;
cur -= A[i] + A[j] + A[k];
}
// if (i==0 && j==1 && k==6) printf("ok %d %d %d\n", A[i], A[j], A[k]);
}
}
}
}
ll naive(){
cnt = 0;
vector<int> A;
for (int i=1;i<=n;i++) A.push_back(a[i]);
rans = INF;
dfs(A, 0);
return rans;
}
ll solve(){
a[0] = INF;
int H = *max_element(a+1, a+n+1);
for (int i=1;i<=H;i++) Ev[i].clear();
// scanf("%d", &n);
// for (int i=1;i<=n;i++) scanf("%lld", a+i);
// printf("%lld\n", naive());
genB();
for (int i=1;i<=n;i++){
Ev[a[i]].push_back({0, i});
Ev[b[i]].push_back({1, i});
assert(a[i] <= b[i]);
assert(b[i] <= H);
}
multiset<int> st;
tree.init(n+1);
ll ans = 0;
for (int i=1;i<=H;i++){
sort(Ev[i].begin(), Ev[i].end());
for (auto &[typ, pos]:Ev[i]){
if (typ==0){
tree.update(pos, INF);
st.insert(pos);
}
else{
st.erase(st.find(pos));
}
}
int cnt = st.size();
if (cnt==0) continue;
int s = *st.begin(), e = *st.rbegin();
ll p0 = tree.query(1, s-1), pk = tree.query(e+1, n), p = tree.query(1, n);
// printf("\n%d -> %d:\n", i, i+1);
// for (auto &x:st) printf("%d ", x);
// printf("\n");
// printf(" ok %lld %lld %lld\n", p0, pk, p);
assert(p0 < INF && pk < INF && p < INF);
assert(p0 > i && pk > i && p > i);
if (cnt >= 2) ans += p0 + pk + p + (ll)(i+1) * (cnt*2 - 3) + (ll)i*cnt;
else ans += p0 + pk + i;
ans %= MOD;
}
return ans;
}
mt19937 seed(69);
uniform_int_distribution<int> rng(0, 2147483647);
int getrand(int l, int r){return rng(seed) % (r-l+1) + l;}
void gen(){
n = getrand(1, 7);
for (int i=1;i<=n;i++) a[i] = getrand(1, 10);
}
void stress(int tc){
// printf("--------------------------------------\n");
// printf("Stress #%d\n", tc);
gen();
// printf("Input:\n");
// printf("%d\n", n);
// for (int i=1;i<=n;i++) printf("%lld ", a[i]);
// printf("\n");
ll ans = naive();
ll out = solve();
// printf("Answer: %lld\n", ans);
// printf("Output: %lld\n", out);
if (ans!=out && ans!=-1){
printf("--------------------------------------\n");
printf("Stress #%d\n", tc);
printf("Input:\n");
printf("%d\n", n);
for (int i=1;i<=n;i++) printf("%lld ", a[i]);
printf("\n");
printf("Answer: %lld\n", ans);
printf("Output: %lld\n", out);
}
if (tc%10000==0) printf("ok %d done\n", tc);
assert(ans==out || ans==-1);
}
signed main(){
// for (int i=1;;i++) stress(i);
scanf("%lld", &n);
for (int i=1;i<=n;i++) scanf("%lld", a+i);
printf("%lld\n", solve());
}
Compilation message
Main.cpp: In function 'void stress(long long int)':
Main.cpp:206:20: warning: format '%d' expects argument of type 'int', but argument 2 has type 'long long int' [-Wformat=]
206 | printf("Stress #%d\n", tc);
| ~^ ~~
| | |
| int long long int
| %lld
Main.cpp:209:12: warning: format '%d' expects argument of type 'int', but argument 2 has type 'long long int' [-Wformat=]
209 | printf("%d\n", n);
| ~^ ~
| | |
| int long long int
| %lld
Main.cpp:217:31: warning: format '%d' expects argument of type 'int', but argument 2 has type 'long long int' [-Wformat=]
217 | if (tc%10000==0) printf("ok %d done\n", tc);
| ~^ ~~
| | |
| int long long int
| %lld
Main.cpp: In function 'int main()':
Main.cpp:225:7: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
225 | scanf("%lld", &n);
| ~~~~~^~~~~~~~~~~~
Main.cpp:226:30: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
226 | for (int i=1;i<=n;i++) scanf("%lld", a+i);
| ~~~~~^~~~~~~~~~~~~
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
11 ms |
23764 KB |
Output is correct |
2 |
Correct |
12 ms |
23764 KB |
Output is correct |
3 |
Correct |
11 ms |
23836 KB |
Output is correct |
4 |
Correct |
13 ms |
24404 KB |
Output is correct |
5 |
Correct |
14 ms |
24276 KB |
Output is correct |
6 |
Correct |
16 ms |
24404 KB |
Output is correct |
7 |
Correct |
14 ms |
24332 KB |
Output is correct |
8 |
Correct |
15 ms |
24320 KB |
Output is correct |
9 |
Correct |
15 ms |
24152 KB |
Output is correct |
10 |
Correct |
13 ms |
24148 KB |
Output is correct |
11 |
Correct |
14 ms |
24308 KB |
Output is correct |
12 |
Correct |
13 ms |
24332 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
11 ms |
23764 KB |
Output is correct |
2 |
Correct |
12 ms |
23764 KB |
Output is correct |
3 |
Correct |
11 ms |
23836 KB |
Output is correct |
4 |
Correct |
13 ms |
24404 KB |
Output is correct |
5 |
Correct |
14 ms |
24276 KB |
Output is correct |
6 |
Correct |
16 ms |
24404 KB |
Output is correct |
7 |
Correct |
14 ms |
24332 KB |
Output is correct |
8 |
Correct |
15 ms |
24320 KB |
Output is correct |
9 |
Correct |
15 ms |
24152 KB |
Output is correct |
10 |
Correct |
13 ms |
24148 KB |
Output is correct |
11 |
Correct |
14 ms |
24308 KB |
Output is correct |
12 |
Correct |
13 ms |
24332 KB |
Output is correct |
13 |
Correct |
13 ms |
24404 KB |
Output is correct |
14 |
Correct |
12 ms |
23832 KB |
Output is correct |
15 |
Correct |
11 ms |
23752 KB |
Output is correct |
16 |
Correct |
13 ms |
24340 KB |
Output is correct |
17 |
Correct |
14 ms |
24308 KB |
Output is correct |
18 |
Correct |
16 ms |
24348 KB |
Output is correct |
19 |
Correct |
13 ms |
24404 KB |
Output is correct |
20 |
Correct |
16 ms |
24396 KB |
Output is correct |
21 |
Correct |
14 ms |
24356 KB |
Output is correct |
22 |
Correct |
16 ms |
24352 KB |
Output is correct |
23 |
Correct |
14 ms |
24308 KB |
Output is correct |
24 |
Correct |
15 ms |
24332 KB |
Output is correct |
25 |
Correct |
13 ms |
24404 KB |
Output is correct |
26 |
Correct |
13 ms |
24380 KB |
Output is correct |
27 |
Correct |
13 ms |
24332 KB |
Output is correct |
28 |
Correct |
14 ms |
24304 KB |
Output is correct |
29 |
Correct |
11 ms |
23784 KB |
Output is correct |
30 |
Correct |
14 ms |
23764 KB |
Output is correct |
31 |
Correct |
12 ms |
23716 KB |
Output is correct |
32 |
Correct |
14 ms |
23752 KB |
Output is correct |
33 |
Correct |
12 ms |
23824 KB |
Output is correct |
34 |
Correct |
12 ms |
23820 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
11 ms |
23764 KB |
Output is correct |
2 |
Correct |
12 ms |
23764 KB |
Output is correct |
3 |
Correct |
11 ms |
23836 KB |
Output is correct |
4 |
Correct |
13 ms |
24404 KB |
Output is correct |
5 |
Correct |
14 ms |
24276 KB |
Output is correct |
6 |
Correct |
16 ms |
24404 KB |
Output is correct |
7 |
Correct |
14 ms |
24332 KB |
Output is correct |
8 |
Correct |
15 ms |
24320 KB |
Output is correct |
9 |
Correct |
15 ms |
24152 KB |
Output is correct |
10 |
Correct |
13 ms |
24148 KB |
Output is correct |
11 |
Correct |
14 ms |
24308 KB |
Output is correct |
12 |
Correct |
13 ms |
24332 KB |
Output is correct |
13 |
Correct |
13 ms |
24404 KB |
Output is correct |
14 |
Correct |
12 ms |
23832 KB |
Output is correct |
15 |
Correct |
11 ms |
23752 KB |
Output is correct |
16 |
Correct |
13 ms |
24340 KB |
Output is correct |
17 |
Correct |
14 ms |
24308 KB |
Output is correct |
18 |
Correct |
16 ms |
24348 KB |
Output is correct |
19 |
Correct |
13 ms |
24404 KB |
Output is correct |
20 |
Correct |
16 ms |
24396 KB |
Output is correct |
21 |
Correct |
14 ms |
24356 KB |
Output is correct |
22 |
Correct |
16 ms |
24352 KB |
Output is correct |
23 |
Correct |
14 ms |
24308 KB |
Output is correct |
24 |
Correct |
15 ms |
24332 KB |
Output is correct |
25 |
Correct |
13 ms |
24404 KB |
Output is correct |
26 |
Correct |
13 ms |
24380 KB |
Output is correct |
27 |
Correct |
13 ms |
24332 KB |
Output is correct |
28 |
Correct |
14 ms |
24304 KB |
Output is correct |
29 |
Correct |
11 ms |
23784 KB |
Output is correct |
30 |
Correct |
14 ms |
23764 KB |
Output is correct |
31 |
Correct |
12 ms |
23716 KB |
Output is correct |
32 |
Correct |
14 ms |
23752 KB |
Output is correct |
33 |
Correct |
12 ms |
23824 KB |
Output is correct |
34 |
Correct |
12 ms |
23820 KB |
Output is correct |
35 |
Correct |
42 ms |
24396 KB |
Output is correct |
36 |
Correct |
42 ms |
24352 KB |
Output is correct |
37 |
Correct |
38 ms |
24396 KB |
Output is correct |
38 |
Correct |
40 ms |
24404 KB |
Output is correct |
39 |
Correct |
39 ms |
24416 KB |
Output is correct |
40 |
Correct |
34 ms |
24328 KB |
Output is correct |
41 |
Correct |
43 ms |
24356 KB |
Output is correct |
42 |
Correct |
41 ms |
24380 KB |
Output is correct |
43 |
Correct |
62 ms |
24436 KB |
Output is correct |
44 |
Correct |
61 ms |
24396 KB |
Output is correct |
45 |
Correct |
63 ms |
24328 KB |
Output is correct |
46 |
Correct |
45 ms |
24396 KB |
Output is correct |
47 |
Correct |
50 ms |
24436 KB |
Output is correct |
48 |
Correct |
50 ms |
24428 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
11 ms |
23764 KB |
Output is correct |
2 |
Correct |
12 ms |
23764 KB |
Output is correct |
3 |
Correct |
11 ms |
23836 KB |
Output is correct |
4 |
Correct |
13 ms |
24404 KB |
Output is correct |
5 |
Correct |
14 ms |
24276 KB |
Output is correct |
6 |
Correct |
16 ms |
24404 KB |
Output is correct |
7 |
Correct |
14 ms |
24332 KB |
Output is correct |
8 |
Correct |
15 ms |
24320 KB |
Output is correct |
9 |
Correct |
15 ms |
24152 KB |
Output is correct |
10 |
Correct |
13 ms |
24148 KB |
Output is correct |
11 |
Correct |
14 ms |
24308 KB |
Output is correct |
12 |
Correct |
13 ms |
24332 KB |
Output is correct |
13 |
Correct |
13 ms |
24404 KB |
Output is correct |
14 |
Correct |
12 ms |
23832 KB |
Output is correct |
15 |
Correct |
11 ms |
23752 KB |
Output is correct |
16 |
Correct |
13 ms |
24340 KB |
Output is correct |
17 |
Correct |
14 ms |
24308 KB |
Output is correct |
18 |
Correct |
16 ms |
24348 KB |
Output is correct |
19 |
Correct |
13 ms |
24404 KB |
Output is correct |
20 |
Correct |
16 ms |
24396 KB |
Output is correct |
21 |
Correct |
14 ms |
24356 KB |
Output is correct |
22 |
Correct |
16 ms |
24352 KB |
Output is correct |
23 |
Correct |
14 ms |
24308 KB |
Output is correct |
24 |
Correct |
15 ms |
24332 KB |
Output is correct |
25 |
Correct |
13 ms |
24404 KB |
Output is correct |
26 |
Correct |
13 ms |
24380 KB |
Output is correct |
27 |
Correct |
13 ms |
24332 KB |
Output is correct |
28 |
Correct |
14 ms |
24304 KB |
Output is correct |
29 |
Correct |
11 ms |
23784 KB |
Output is correct |
30 |
Correct |
14 ms |
23764 KB |
Output is correct |
31 |
Correct |
12 ms |
23716 KB |
Output is correct |
32 |
Correct |
14 ms |
23752 KB |
Output is correct |
33 |
Correct |
12 ms |
23824 KB |
Output is correct |
34 |
Correct |
12 ms |
23820 KB |
Output is correct |
35 |
Correct |
42 ms |
24396 KB |
Output is correct |
36 |
Correct |
42 ms |
24352 KB |
Output is correct |
37 |
Correct |
38 ms |
24396 KB |
Output is correct |
38 |
Correct |
40 ms |
24404 KB |
Output is correct |
39 |
Correct |
39 ms |
24416 KB |
Output is correct |
40 |
Correct |
34 ms |
24328 KB |
Output is correct |
41 |
Correct |
43 ms |
24356 KB |
Output is correct |
42 |
Correct |
41 ms |
24380 KB |
Output is correct |
43 |
Correct |
62 ms |
24436 KB |
Output is correct |
44 |
Correct |
61 ms |
24396 KB |
Output is correct |
45 |
Correct |
63 ms |
24328 KB |
Output is correct |
46 |
Correct |
45 ms |
24396 KB |
Output is correct |
47 |
Correct |
50 ms |
24436 KB |
Output is correct |
48 |
Correct |
50 ms |
24428 KB |
Output is correct |
49 |
Runtime error |
38 ms |
48228 KB |
Execution killed with signal 11 |
50 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
11 ms |
23764 KB |
Output is correct |
2 |
Correct |
12 ms |
23764 KB |
Output is correct |
3 |
Correct |
11 ms |
23836 KB |
Output is correct |
4 |
Correct |
13 ms |
24404 KB |
Output is correct |
5 |
Correct |
14 ms |
24276 KB |
Output is correct |
6 |
Correct |
16 ms |
24404 KB |
Output is correct |
7 |
Correct |
14 ms |
24332 KB |
Output is correct |
8 |
Correct |
15 ms |
24320 KB |
Output is correct |
9 |
Correct |
15 ms |
24152 KB |
Output is correct |
10 |
Correct |
13 ms |
24148 KB |
Output is correct |
11 |
Correct |
14 ms |
24308 KB |
Output is correct |
12 |
Correct |
13 ms |
24332 KB |
Output is correct |
13 |
Correct |
13 ms |
24404 KB |
Output is correct |
14 |
Correct |
12 ms |
23832 KB |
Output is correct |
15 |
Correct |
11 ms |
23752 KB |
Output is correct |
16 |
Correct |
13 ms |
24340 KB |
Output is correct |
17 |
Correct |
14 ms |
24308 KB |
Output is correct |
18 |
Correct |
16 ms |
24348 KB |
Output is correct |
19 |
Correct |
13 ms |
24404 KB |
Output is correct |
20 |
Correct |
16 ms |
24396 KB |
Output is correct |
21 |
Correct |
14 ms |
24356 KB |
Output is correct |
22 |
Correct |
16 ms |
24352 KB |
Output is correct |
23 |
Correct |
14 ms |
24308 KB |
Output is correct |
24 |
Correct |
15 ms |
24332 KB |
Output is correct |
25 |
Correct |
13 ms |
24404 KB |
Output is correct |
26 |
Correct |
13 ms |
24380 KB |
Output is correct |
27 |
Correct |
13 ms |
24332 KB |
Output is correct |
28 |
Correct |
14 ms |
24304 KB |
Output is correct |
29 |
Correct |
11 ms |
23784 KB |
Output is correct |
30 |
Correct |
14 ms |
23764 KB |
Output is correct |
31 |
Correct |
12 ms |
23716 KB |
Output is correct |
32 |
Correct |
14 ms |
23752 KB |
Output is correct |
33 |
Correct |
12 ms |
23824 KB |
Output is correct |
34 |
Correct |
12 ms |
23820 KB |
Output is correct |
35 |
Correct |
1002 ms |
137916 KB |
Output is correct |
36 |
Correct |
962 ms |
138148 KB |
Output is correct |
37 |
Correct |
916 ms |
138228 KB |
Output is correct |
38 |
Correct |
948 ms |
138104 KB |
Output is correct |
39 |
Correct |
907 ms |
138152 KB |
Output is correct |
40 |
Correct |
12 ms |
23764 KB |
Output is correct |
41 |
Correct |
12 ms |
23776 KB |
Output is correct |
42 |
Correct |
442 ms |
135364 KB |
Output is correct |
43 |
Correct |
442 ms |
134836 KB |
Output is correct |
44 |
Correct |
458 ms |
135388 KB |
Output is correct |
45 |
Correct |
466 ms |
138452 KB |
Output is correct |
46 |
Correct |
466 ms |
138412 KB |
Output is correct |
47 |
Correct |
466 ms |
138404 KB |
Output is correct |
48 |
Correct |
549 ms |
138296 KB |
Output is correct |
49 |
Correct |
533 ms |
138152 KB |
Output is correct |
50 |
Correct |
572 ms |
138356 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
11 ms |
23764 KB |
Output is correct |
2 |
Correct |
12 ms |
23764 KB |
Output is correct |
3 |
Correct |
11 ms |
23836 KB |
Output is correct |
4 |
Correct |
13 ms |
24404 KB |
Output is correct |
5 |
Correct |
14 ms |
24276 KB |
Output is correct |
6 |
Correct |
16 ms |
24404 KB |
Output is correct |
7 |
Correct |
14 ms |
24332 KB |
Output is correct |
8 |
Correct |
15 ms |
24320 KB |
Output is correct |
9 |
Correct |
15 ms |
24152 KB |
Output is correct |
10 |
Correct |
13 ms |
24148 KB |
Output is correct |
11 |
Correct |
14 ms |
24308 KB |
Output is correct |
12 |
Correct |
13 ms |
24332 KB |
Output is correct |
13 |
Correct |
13 ms |
24404 KB |
Output is correct |
14 |
Correct |
12 ms |
23832 KB |
Output is correct |
15 |
Correct |
11 ms |
23752 KB |
Output is correct |
16 |
Correct |
13 ms |
24340 KB |
Output is correct |
17 |
Correct |
14 ms |
24308 KB |
Output is correct |
18 |
Correct |
16 ms |
24348 KB |
Output is correct |
19 |
Correct |
13 ms |
24404 KB |
Output is correct |
20 |
Correct |
16 ms |
24396 KB |
Output is correct |
21 |
Correct |
14 ms |
24356 KB |
Output is correct |
22 |
Correct |
16 ms |
24352 KB |
Output is correct |
23 |
Correct |
14 ms |
24308 KB |
Output is correct |
24 |
Correct |
15 ms |
24332 KB |
Output is correct |
25 |
Correct |
13 ms |
24404 KB |
Output is correct |
26 |
Correct |
13 ms |
24380 KB |
Output is correct |
27 |
Correct |
13 ms |
24332 KB |
Output is correct |
28 |
Correct |
14 ms |
24304 KB |
Output is correct |
29 |
Correct |
11 ms |
23784 KB |
Output is correct |
30 |
Correct |
14 ms |
23764 KB |
Output is correct |
31 |
Correct |
12 ms |
23716 KB |
Output is correct |
32 |
Correct |
14 ms |
23752 KB |
Output is correct |
33 |
Correct |
12 ms |
23824 KB |
Output is correct |
34 |
Correct |
12 ms |
23820 KB |
Output is correct |
35 |
Correct |
42 ms |
24396 KB |
Output is correct |
36 |
Correct |
42 ms |
24352 KB |
Output is correct |
37 |
Correct |
38 ms |
24396 KB |
Output is correct |
38 |
Correct |
40 ms |
24404 KB |
Output is correct |
39 |
Correct |
39 ms |
24416 KB |
Output is correct |
40 |
Correct |
34 ms |
24328 KB |
Output is correct |
41 |
Correct |
43 ms |
24356 KB |
Output is correct |
42 |
Correct |
41 ms |
24380 KB |
Output is correct |
43 |
Correct |
62 ms |
24436 KB |
Output is correct |
44 |
Correct |
61 ms |
24396 KB |
Output is correct |
45 |
Correct |
63 ms |
24328 KB |
Output is correct |
46 |
Correct |
45 ms |
24396 KB |
Output is correct |
47 |
Correct |
50 ms |
24436 KB |
Output is correct |
48 |
Correct |
50 ms |
24428 KB |
Output is correct |
49 |
Correct |
1002 ms |
137916 KB |
Output is correct |
50 |
Correct |
962 ms |
138148 KB |
Output is correct |
51 |
Correct |
916 ms |
138228 KB |
Output is correct |
52 |
Correct |
948 ms |
138104 KB |
Output is correct |
53 |
Correct |
907 ms |
138152 KB |
Output is correct |
54 |
Correct |
12 ms |
23764 KB |
Output is correct |
55 |
Correct |
12 ms |
23776 KB |
Output is correct |
56 |
Correct |
442 ms |
135364 KB |
Output is correct |
57 |
Correct |
442 ms |
134836 KB |
Output is correct |
58 |
Correct |
458 ms |
135388 KB |
Output is correct |
59 |
Correct |
466 ms |
138452 KB |
Output is correct |
60 |
Correct |
466 ms |
138412 KB |
Output is correct |
61 |
Correct |
466 ms |
138404 KB |
Output is correct |
62 |
Correct |
549 ms |
138296 KB |
Output is correct |
63 |
Correct |
533 ms |
138152 KB |
Output is correct |
64 |
Correct |
572 ms |
138356 KB |
Output is correct |
65 |
Correct |
1674 ms |
144344 KB |
Output is correct |
66 |
Correct |
1589 ms |
144348 KB |
Output is correct |
67 |
Correct |
1701 ms |
144272 KB |
Output is correct |
68 |
Correct |
1636 ms |
144396 KB |
Output is correct |
69 |
Correct |
1630 ms |
144376 KB |
Output is correct |
70 |
Correct |
485 ms |
135300 KB |
Output is correct |
71 |
Correct |
466 ms |
134856 KB |
Output is correct |
72 |
Correct |
468 ms |
135856 KB |
Output is correct |
73 |
Correct |
639 ms |
144324 KB |
Output is correct |
74 |
Correct |
580 ms |
144412 KB |
Output is correct |
75 |
Correct |
618 ms |
144392 KB |
Output is correct |
76 |
Correct |
792 ms |
144220 KB |
Output is correct |
77 |
Correct |
782 ms |
144096 KB |
Output is correct |
78 |
Correct |
864 ms |
144148 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
11 ms |
23764 KB |
Output is correct |
2 |
Correct |
12 ms |
23764 KB |
Output is correct |
3 |
Correct |
11 ms |
23836 KB |
Output is correct |
4 |
Correct |
13 ms |
24404 KB |
Output is correct |
5 |
Correct |
14 ms |
24276 KB |
Output is correct |
6 |
Correct |
16 ms |
24404 KB |
Output is correct |
7 |
Correct |
14 ms |
24332 KB |
Output is correct |
8 |
Correct |
15 ms |
24320 KB |
Output is correct |
9 |
Correct |
15 ms |
24152 KB |
Output is correct |
10 |
Correct |
13 ms |
24148 KB |
Output is correct |
11 |
Correct |
14 ms |
24308 KB |
Output is correct |
12 |
Correct |
13 ms |
24332 KB |
Output is correct |
13 |
Correct |
13 ms |
24404 KB |
Output is correct |
14 |
Correct |
12 ms |
23832 KB |
Output is correct |
15 |
Correct |
11 ms |
23752 KB |
Output is correct |
16 |
Correct |
13 ms |
24340 KB |
Output is correct |
17 |
Correct |
14 ms |
24308 KB |
Output is correct |
18 |
Correct |
16 ms |
24348 KB |
Output is correct |
19 |
Correct |
13 ms |
24404 KB |
Output is correct |
20 |
Correct |
16 ms |
24396 KB |
Output is correct |
21 |
Correct |
14 ms |
24356 KB |
Output is correct |
22 |
Correct |
16 ms |
24352 KB |
Output is correct |
23 |
Correct |
14 ms |
24308 KB |
Output is correct |
24 |
Correct |
15 ms |
24332 KB |
Output is correct |
25 |
Correct |
13 ms |
24404 KB |
Output is correct |
26 |
Correct |
13 ms |
24380 KB |
Output is correct |
27 |
Correct |
13 ms |
24332 KB |
Output is correct |
28 |
Correct |
14 ms |
24304 KB |
Output is correct |
29 |
Correct |
11 ms |
23784 KB |
Output is correct |
30 |
Correct |
14 ms |
23764 KB |
Output is correct |
31 |
Correct |
12 ms |
23716 KB |
Output is correct |
32 |
Correct |
14 ms |
23752 KB |
Output is correct |
33 |
Correct |
12 ms |
23824 KB |
Output is correct |
34 |
Correct |
12 ms |
23820 KB |
Output is correct |
35 |
Correct |
42 ms |
24396 KB |
Output is correct |
36 |
Correct |
42 ms |
24352 KB |
Output is correct |
37 |
Correct |
38 ms |
24396 KB |
Output is correct |
38 |
Correct |
40 ms |
24404 KB |
Output is correct |
39 |
Correct |
39 ms |
24416 KB |
Output is correct |
40 |
Correct |
34 ms |
24328 KB |
Output is correct |
41 |
Correct |
43 ms |
24356 KB |
Output is correct |
42 |
Correct |
41 ms |
24380 KB |
Output is correct |
43 |
Correct |
62 ms |
24436 KB |
Output is correct |
44 |
Correct |
61 ms |
24396 KB |
Output is correct |
45 |
Correct |
63 ms |
24328 KB |
Output is correct |
46 |
Correct |
45 ms |
24396 KB |
Output is correct |
47 |
Correct |
50 ms |
24436 KB |
Output is correct |
48 |
Correct |
50 ms |
24428 KB |
Output is correct |
49 |
Runtime error |
38 ms |
48228 KB |
Execution killed with signal 11 |
50 |
Halted |
0 ms |
0 KB |
- |