Submission #1113228

# Submission time Handle Problem Language Result Execution time Memory
1113228 2024-11-16T06:01:08 Z VinhLuu Real Mountains (CCO23_day1problem2) C++17
25 / 25
2262 ms 213552 KB
#include <bits/stdc++.h>
#define int long long
#define ll long long
#define all(lpv) lpv.begin(), lpv.end()
#define fi first
#define se second
using namespace std;

typedef pair<int,int> pii;
const int N = 1e6 + 5;
const int oo = 1e16;
const int mod = 1e6 + 3;

int n, m, a[N], pf[N], sf[N], st[N << 1], des[N], le[N], ri[N];

void update(int i,int x){
  i += n - 1;
  st[i] = x;
  while(i > 1){
    i /= 2;
    st[i] = min(st[i << 1], st[i << 1|1]);
  }
}

int get(int l,int r){
  if(l > r) return oo;
  r++;
  int ret = oo;
  for(l += n - 1, r += n - 1; l < r; l /= 2, r /= 2){
    if(l & 1) ret = min(ret, st[l ++]);
    if(r & 1) ret = min(ret, st[-- r]);
  }
  return ret;
}

void add(int &x,int y){
  x = (x + y) % mod;
}
vector<int> open[N], close[N], rrh;
int spe;

int lt(int u,int v){
  if(!v) return 1;
  int x = u;
  int kq = 1;
  while(v){
    if(v & 1) kq = kq * x % mod;
    x = x * x % mod;
    v /= 2;
  }
  return kq;
}

int cal(int l,int r){
  return (l + r) % mod * spe % mod * (r - l + 1) % mod % mod;
}

signed main(){
  ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
  #define task "v"
  if(fopen(task ".inp","r")){
    freopen(task ".inp","r",stdin);
    freopen(task ".out","w",stdout);
  }

  cin >> n;

  spe = lt(2ll, mod - 2);

  for(int i = 1; i <= n; i ++){
    cin >> a[i];
    rrh.push_back(a[i]);
  }

  for(int i = 1; i <= n; i ++){
    le[i] = le[i - 1] + (pf[i] > a[i] ? pf[i] - a[i] : 0);
    pf[i] = max(a[i], pf[i - 1]);
    update(i, a[i]);
  }
  for(int i = n; i >= 1; i --){
    ri[i] = ri[i + 1] + (sf[i] > a[i] ? sf[i] - a[i] : 0);
    sf[i] = max(sf[i + 1], a[i]);
  }
  int pos = 1, ans = oo;
  for(int i = 1; i <= n; i ++){
    int val = max(pf[i], sf[i]) - a[i] + le[i - 1] + ri[i + 1];
    if(val < ans){
      ans = val;
      pos = i;
    }
  }
  sort(all(rrh)); rrh.resize(unique(all(rrh)) - rrh.begin());
  m = (int)rrh.size();
  for(int i = 1; i <= n; i ++) a[i] = lower_bound(all(rrh), a[i]) - rrh.begin() + 1;
  ans = 0;
  des[pos] = lower_bound(all(rrh), max(pf[pos], sf[pos])) - rrh.begin() + 1;
  for(int i = 1; i < pos; i ++) des[i] = lower_bound(all(rrh), pf[i]) - rrh.begin() + 1;
  for(int i = pos + 1; i <= n; i ++) des[i] = lower_bound(all(rrh), sf[i]) - rrh.begin() + 1;

  for(int i = 1; i <= n; i ++){
//    cerr << i << " " << a[i] << " " << des[i] << " p\n";
    if(a[i] < des[i]){
      open[a[i]].push_back(i);
    }
    close[des[i]].push_back(i);

  }

  ans = 0;

  set<int> col;

  for(int k = 1; k <= m; k ++){
    for(auto j : close[k]){
      if(col.find(j) != col.end()) col.erase(j);
      update(j, oo);
    }
    for(auto j : open[k]){
      col.insert(j);
      update(j, oo);
    }
    if(col.empty()) continue;
    int tmp = rrh[k - 1], nxt = rrh[k];
    int x = (*col.begin());
    int y = (*col.rbegin());
    if(x == y){
      int val = ((get(1, x - 1) + get(x + 1, n)) * (nxt - tmp) % mod + cal(tmp, nxt - 1)) % mod;
      add(ans, val);
    }else{
      int cx = ((get(1, x - 1) + get(x + 1, n)) * (nxt - tmp));
      int cy = ((get(1, y - 1) + get(y + 1, n)) * (nxt - tmp));
//      cerr << cx << " " << cy << " q\n"
      int val = (min(cx + get(y + 1, n) * (nxt - tmp),
                     cy + get(1, x - 1) * (nxt - tmp)) % mod + 3 * cal(tmp, nxt - 1) % mod + (nxt - tmp)) % mod;
//      cerr << val << " " << cx << " " << 2 * cal(tmp, nxt - 1) % mod + (nxt - tmp) << " " << get(y + 1, n) << " r\n";
      add(ans, val);
    }

//    cerr << k << " " << ans << " r\n";

    int cnt = (int)col.size();

    int val = max(0ll, cnt - 2) * (3 * cal(tmp, nxt - 1) % mod + 2 * (nxt - tmp) % mod) % mod;
    add(ans, val);

  }
  cout << ans;
}

Compilation message

Main.cpp: In function 'int main()':
Main.cpp:62:12: warning: ignoring return value of 'FILE* freopen(const char*, const char*, FILE*)' declared with attribute 'warn_unused_result' [-Wunused-result]
   62 |     freopen(task ".inp","r",stdin);
      |     ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~
Main.cpp:63:12: warning: ignoring return value of 'FILE* freopen(const char*, const char*, FILE*)' declared with attribute 'warn_unused_result' [-Wunused-result]
   63 |     freopen(task ".out","w",stdout);
      |     ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~
# Verdict Execution time Memory Grader output
1 Correct 33 ms 47432 KB Output is correct
2 Correct 35 ms 47440 KB Output is correct
3 Correct 33 ms 47440 KB Output is correct
4 Correct 35 ms 47936 KB Output is correct
5 Correct 39 ms 47952 KB Output is correct
6 Correct 36 ms 47944 KB Output is correct
7 Correct 31 ms 47912 KB Output is correct
8 Correct 33 ms 47952 KB Output is correct
9 Correct 34 ms 47696 KB Output is correct
10 Correct 35 ms 47696 KB Output is correct
11 Correct 34 ms 47952 KB Output is correct
12 Correct 33 ms 47944 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 33 ms 47432 KB Output is correct
2 Correct 35 ms 47440 KB Output is correct
3 Correct 33 ms 47440 KB Output is correct
4 Correct 35 ms 47936 KB Output is correct
5 Correct 39 ms 47952 KB Output is correct
6 Correct 36 ms 47944 KB Output is correct
7 Correct 31 ms 47912 KB Output is correct
8 Correct 33 ms 47952 KB Output is correct
9 Correct 34 ms 47696 KB Output is correct
10 Correct 35 ms 47696 KB Output is correct
11 Correct 34 ms 47952 KB Output is correct
12 Correct 33 ms 47944 KB Output is correct
13 Correct 34 ms 48004 KB Output is correct
14 Correct 35 ms 47440 KB Output is correct
15 Correct 35 ms 47436 KB Output is correct
16 Correct 38 ms 47944 KB Output is correct
17 Correct 36 ms 47952 KB Output is correct
18 Correct 37 ms 47944 KB Output is correct
19 Correct 37 ms 48076 KB Output is correct
20 Correct 34 ms 47964 KB Output is correct
21 Correct 37 ms 47948 KB Output is correct
22 Correct 35 ms 47964 KB Output is correct
23 Correct 37 ms 47952 KB Output is correct
24 Correct 37 ms 47952 KB Output is correct
25 Correct 37 ms 47944 KB Output is correct
26 Correct 39 ms 47944 KB Output is correct
27 Correct 38 ms 47964 KB Output is correct
28 Correct 37 ms 47968 KB Output is correct
29 Correct 35 ms 47440 KB Output is correct
30 Correct 34 ms 47440 KB Output is correct
31 Correct 32 ms 47440 KB Output is correct
32 Correct 38 ms 47432 KB Output is correct
33 Correct 36 ms 47468 KB Output is correct
34 Correct 32 ms 47432 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 33 ms 47432 KB Output is correct
2 Correct 35 ms 47440 KB Output is correct
3 Correct 33 ms 47440 KB Output is correct
4 Correct 35 ms 47936 KB Output is correct
5 Correct 39 ms 47952 KB Output is correct
6 Correct 36 ms 47944 KB Output is correct
7 Correct 31 ms 47912 KB Output is correct
8 Correct 33 ms 47952 KB Output is correct
9 Correct 34 ms 47696 KB Output is correct
10 Correct 35 ms 47696 KB Output is correct
11 Correct 34 ms 47952 KB Output is correct
12 Correct 33 ms 47944 KB Output is correct
13 Correct 34 ms 48004 KB Output is correct
14 Correct 35 ms 47440 KB Output is correct
15 Correct 35 ms 47436 KB Output is correct
16 Correct 38 ms 47944 KB Output is correct
17 Correct 36 ms 47952 KB Output is correct
18 Correct 37 ms 47944 KB Output is correct
19 Correct 37 ms 48076 KB Output is correct
20 Correct 34 ms 47964 KB Output is correct
21 Correct 37 ms 47948 KB Output is correct
22 Correct 35 ms 47964 KB Output is correct
23 Correct 37 ms 47952 KB Output is correct
24 Correct 37 ms 47952 KB Output is correct
25 Correct 37 ms 47944 KB Output is correct
26 Correct 39 ms 47944 KB Output is correct
27 Correct 38 ms 47964 KB Output is correct
28 Correct 37 ms 47968 KB Output is correct
29 Correct 35 ms 47440 KB Output is correct
30 Correct 34 ms 47440 KB Output is correct
31 Correct 32 ms 47440 KB Output is correct
32 Correct 38 ms 47432 KB Output is correct
33 Correct 36 ms 47468 KB Output is correct
34 Correct 32 ms 47432 KB Output is correct
35 Correct 37 ms 48120 KB Output is correct
36 Correct 39 ms 48280 KB Output is correct
37 Correct 41 ms 48200 KB Output is correct
38 Correct 40 ms 48052 KB Output is correct
39 Correct 38 ms 48208 KB Output is correct
40 Correct 37 ms 47952 KB Output is correct
41 Correct 36 ms 48108 KB Output is correct
42 Correct 35 ms 47952 KB Output is correct
43 Correct 39 ms 48220 KB Output is correct
44 Correct 38 ms 48200 KB Output is correct
45 Correct 45 ms 48204 KB Output is correct
46 Correct 36 ms 48208 KB Output is correct
47 Correct 37 ms 48200 KB Output is correct
48 Correct 37 ms 48096 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 33 ms 47432 KB Output is correct
2 Correct 35 ms 47440 KB Output is correct
3 Correct 33 ms 47440 KB Output is correct
4 Correct 35 ms 47936 KB Output is correct
5 Correct 39 ms 47952 KB Output is correct
6 Correct 36 ms 47944 KB Output is correct
7 Correct 31 ms 47912 KB Output is correct
8 Correct 33 ms 47952 KB Output is correct
9 Correct 34 ms 47696 KB Output is correct
10 Correct 35 ms 47696 KB Output is correct
11 Correct 34 ms 47952 KB Output is correct
12 Correct 33 ms 47944 KB Output is correct
13 Correct 34 ms 48004 KB Output is correct
14 Correct 35 ms 47440 KB Output is correct
15 Correct 35 ms 47436 KB Output is correct
16 Correct 38 ms 47944 KB Output is correct
17 Correct 36 ms 47952 KB Output is correct
18 Correct 37 ms 47944 KB Output is correct
19 Correct 37 ms 48076 KB Output is correct
20 Correct 34 ms 47964 KB Output is correct
21 Correct 37 ms 47948 KB Output is correct
22 Correct 35 ms 47964 KB Output is correct
23 Correct 37 ms 47952 KB Output is correct
24 Correct 37 ms 47952 KB Output is correct
25 Correct 37 ms 47944 KB Output is correct
26 Correct 39 ms 47944 KB Output is correct
27 Correct 38 ms 47964 KB Output is correct
28 Correct 37 ms 47968 KB Output is correct
29 Correct 35 ms 47440 KB Output is correct
30 Correct 34 ms 47440 KB Output is correct
31 Correct 32 ms 47440 KB Output is correct
32 Correct 38 ms 47432 KB Output is correct
33 Correct 36 ms 47468 KB Output is correct
34 Correct 32 ms 47432 KB Output is correct
35 Correct 37 ms 48120 KB Output is correct
36 Correct 39 ms 48280 KB Output is correct
37 Correct 41 ms 48200 KB Output is correct
38 Correct 40 ms 48052 KB Output is correct
39 Correct 38 ms 48208 KB Output is correct
40 Correct 37 ms 47952 KB Output is correct
41 Correct 36 ms 48108 KB Output is correct
42 Correct 35 ms 47952 KB Output is correct
43 Correct 39 ms 48220 KB Output is correct
44 Correct 38 ms 48200 KB Output is correct
45 Correct 45 ms 48204 KB Output is correct
46 Correct 36 ms 48208 KB Output is correct
47 Correct 37 ms 48200 KB Output is correct
48 Correct 37 ms 48096 KB Output is correct
49 Correct 40 ms 48200 KB Output is correct
50 Correct 39 ms 48224 KB Output is correct
51 Correct 39 ms 48184 KB Output is correct
52 Correct 43 ms 48200 KB Output is correct
53 Correct 45 ms 48308 KB Output is correct
54 Correct 36 ms 47944 KB Output is correct
55 Correct 37 ms 47944 KB Output is correct
56 Correct 38 ms 47952 KB Output is correct
57 Correct 38 ms 48200 KB Output is correct
58 Correct 36 ms 48080 KB Output is correct
59 Correct 41 ms 48424 KB Output is correct
60 Correct 38 ms 48208 KB Output is correct
61 Correct 42 ms 48204 KB Output is correct
62 Correct 39 ms 48208 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 33 ms 47432 KB Output is correct
2 Correct 35 ms 47440 KB Output is correct
3 Correct 33 ms 47440 KB Output is correct
4 Correct 35 ms 47936 KB Output is correct
5 Correct 39 ms 47952 KB Output is correct
6 Correct 36 ms 47944 KB Output is correct
7 Correct 31 ms 47912 KB Output is correct
8 Correct 33 ms 47952 KB Output is correct
9 Correct 34 ms 47696 KB Output is correct
10 Correct 35 ms 47696 KB Output is correct
11 Correct 34 ms 47952 KB Output is correct
12 Correct 33 ms 47944 KB Output is correct
13 Correct 34 ms 48004 KB Output is correct
14 Correct 35 ms 47440 KB Output is correct
15 Correct 35 ms 47436 KB Output is correct
16 Correct 38 ms 47944 KB Output is correct
17 Correct 36 ms 47952 KB Output is correct
18 Correct 37 ms 47944 KB Output is correct
19 Correct 37 ms 48076 KB Output is correct
20 Correct 34 ms 47964 KB Output is correct
21 Correct 37 ms 47948 KB Output is correct
22 Correct 35 ms 47964 KB Output is correct
23 Correct 37 ms 47952 KB Output is correct
24 Correct 37 ms 47952 KB Output is correct
25 Correct 37 ms 47944 KB Output is correct
26 Correct 39 ms 47944 KB Output is correct
27 Correct 38 ms 47964 KB Output is correct
28 Correct 37 ms 47968 KB Output is correct
29 Correct 35 ms 47440 KB Output is correct
30 Correct 34 ms 47440 KB Output is correct
31 Correct 32 ms 47440 KB Output is correct
32 Correct 38 ms 47432 KB Output is correct
33 Correct 36 ms 47468 KB Output is correct
34 Correct 32 ms 47432 KB Output is correct
35 Correct 970 ms 186536 KB Output is correct
36 Correct 979 ms 186688 KB Output is correct
37 Correct 1002 ms 186276 KB Output is correct
38 Correct 1126 ms 186384 KB Output is correct
39 Correct 985 ms 186508 KB Output is correct
40 Correct 32 ms 47432 KB Output is correct
41 Correct 36 ms 47440 KB Output is correct
42 Correct 598 ms 184228 KB Output is correct
43 Correct 627 ms 184028 KB Output is correct
44 Correct 599 ms 184500 KB Output is correct
45 Correct 529 ms 186708 KB Output is correct
46 Correct 532 ms 185624 KB Output is correct
47 Correct 528 ms 186784 KB Output is correct
48 Correct 673 ms 186572 KB Output is correct
49 Correct 675 ms 186728 KB Output is correct
50 Correct 658 ms 185504 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 33 ms 47432 KB Output is correct
2 Correct 35 ms 47440 KB Output is correct
3 Correct 33 ms 47440 KB Output is correct
4 Correct 35 ms 47936 KB Output is correct
5 Correct 39 ms 47952 KB Output is correct
6 Correct 36 ms 47944 KB Output is correct
7 Correct 31 ms 47912 KB Output is correct
8 Correct 33 ms 47952 KB Output is correct
9 Correct 34 ms 47696 KB Output is correct
10 Correct 35 ms 47696 KB Output is correct
11 Correct 34 ms 47952 KB Output is correct
12 Correct 33 ms 47944 KB Output is correct
13 Correct 34 ms 48004 KB Output is correct
14 Correct 35 ms 47440 KB Output is correct
15 Correct 35 ms 47436 KB Output is correct
16 Correct 38 ms 47944 KB Output is correct
17 Correct 36 ms 47952 KB Output is correct
18 Correct 37 ms 47944 KB Output is correct
19 Correct 37 ms 48076 KB Output is correct
20 Correct 34 ms 47964 KB Output is correct
21 Correct 37 ms 47948 KB Output is correct
22 Correct 35 ms 47964 KB Output is correct
23 Correct 37 ms 47952 KB Output is correct
24 Correct 37 ms 47952 KB Output is correct
25 Correct 37 ms 47944 KB Output is correct
26 Correct 39 ms 47944 KB Output is correct
27 Correct 38 ms 47964 KB Output is correct
28 Correct 37 ms 47968 KB Output is correct
29 Correct 35 ms 47440 KB Output is correct
30 Correct 34 ms 47440 KB Output is correct
31 Correct 32 ms 47440 KB Output is correct
32 Correct 38 ms 47432 KB Output is correct
33 Correct 36 ms 47468 KB Output is correct
34 Correct 32 ms 47432 KB Output is correct
35 Correct 37 ms 48120 KB Output is correct
36 Correct 39 ms 48280 KB Output is correct
37 Correct 41 ms 48200 KB Output is correct
38 Correct 40 ms 48052 KB Output is correct
39 Correct 38 ms 48208 KB Output is correct
40 Correct 37 ms 47952 KB Output is correct
41 Correct 36 ms 48108 KB Output is correct
42 Correct 35 ms 47952 KB Output is correct
43 Correct 39 ms 48220 KB Output is correct
44 Correct 38 ms 48200 KB Output is correct
45 Correct 45 ms 48204 KB Output is correct
46 Correct 36 ms 48208 KB Output is correct
47 Correct 37 ms 48200 KB Output is correct
48 Correct 37 ms 48096 KB Output is correct
49 Correct 970 ms 186536 KB Output is correct
50 Correct 979 ms 186688 KB Output is correct
51 Correct 1002 ms 186276 KB Output is correct
52 Correct 1126 ms 186384 KB Output is correct
53 Correct 985 ms 186508 KB Output is correct
54 Correct 32 ms 47432 KB Output is correct
55 Correct 36 ms 47440 KB Output is correct
56 Correct 598 ms 184228 KB Output is correct
57 Correct 627 ms 184028 KB Output is correct
58 Correct 599 ms 184500 KB Output is correct
59 Correct 529 ms 186708 KB Output is correct
60 Correct 532 ms 185624 KB Output is correct
61 Correct 528 ms 186784 KB Output is correct
62 Correct 673 ms 186572 KB Output is correct
63 Correct 675 ms 186728 KB Output is correct
64 Correct 658 ms 185504 KB Output is correct
65 Correct 1828 ms 200292 KB Output is correct
66 Correct 2120 ms 200624 KB Output is correct
67 Correct 2049 ms 200288 KB Output is correct
68 Correct 1972 ms 200068 KB Output is correct
69 Correct 2009 ms 200328 KB Output is correct
70 Correct 560 ms 184080 KB Output is correct
71 Correct 585 ms 184276 KB Output is correct
72 Correct 559 ms 184484 KB Output is correct
73 Correct 832 ms 200368 KB Output is correct
74 Correct 825 ms 199332 KB Output is correct
75 Correct 903 ms 200368 KB Output is correct
76 Correct 1105 ms 200352 KB Output is correct
77 Correct 1062 ms 200364 KB Output is correct
78 Correct 1108 ms 199804 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 33 ms 47432 KB Output is correct
2 Correct 35 ms 47440 KB Output is correct
3 Correct 33 ms 47440 KB Output is correct
4 Correct 35 ms 47936 KB Output is correct
5 Correct 39 ms 47952 KB Output is correct
6 Correct 36 ms 47944 KB Output is correct
7 Correct 31 ms 47912 KB Output is correct
8 Correct 33 ms 47952 KB Output is correct
9 Correct 34 ms 47696 KB Output is correct
10 Correct 35 ms 47696 KB Output is correct
11 Correct 34 ms 47952 KB Output is correct
12 Correct 33 ms 47944 KB Output is correct
13 Correct 34 ms 48004 KB Output is correct
14 Correct 35 ms 47440 KB Output is correct
15 Correct 35 ms 47436 KB Output is correct
16 Correct 38 ms 47944 KB Output is correct
17 Correct 36 ms 47952 KB Output is correct
18 Correct 37 ms 47944 KB Output is correct
19 Correct 37 ms 48076 KB Output is correct
20 Correct 34 ms 47964 KB Output is correct
21 Correct 37 ms 47948 KB Output is correct
22 Correct 35 ms 47964 KB Output is correct
23 Correct 37 ms 47952 KB Output is correct
24 Correct 37 ms 47952 KB Output is correct
25 Correct 37 ms 47944 KB Output is correct
26 Correct 39 ms 47944 KB Output is correct
27 Correct 38 ms 47964 KB Output is correct
28 Correct 37 ms 47968 KB Output is correct
29 Correct 35 ms 47440 KB Output is correct
30 Correct 34 ms 47440 KB Output is correct
31 Correct 32 ms 47440 KB Output is correct
32 Correct 38 ms 47432 KB Output is correct
33 Correct 36 ms 47468 KB Output is correct
34 Correct 32 ms 47432 KB Output is correct
35 Correct 37 ms 48120 KB Output is correct
36 Correct 39 ms 48280 KB Output is correct
37 Correct 41 ms 48200 KB Output is correct
38 Correct 40 ms 48052 KB Output is correct
39 Correct 38 ms 48208 KB Output is correct
40 Correct 37 ms 47952 KB Output is correct
41 Correct 36 ms 48108 KB Output is correct
42 Correct 35 ms 47952 KB Output is correct
43 Correct 39 ms 48220 KB Output is correct
44 Correct 38 ms 48200 KB Output is correct
45 Correct 45 ms 48204 KB Output is correct
46 Correct 36 ms 48208 KB Output is correct
47 Correct 37 ms 48200 KB Output is correct
48 Correct 37 ms 48096 KB Output is correct
49 Correct 40 ms 48200 KB Output is correct
50 Correct 39 ms 48224 KB Output is correct
51 Correct 39 ms 48184 KB Output is correct
52 Correct 43 ms 48200 KB Output is correct
53 Correct 45 ms 48308 KB Output is correct
54 Correct 36 ms 47944 KB Output is correct
55 Correct 37 ms 47944 KB Output is correct
56 Correct 38 ms 47952 KB Output is correct
57 Correct 38 ms 48200 KB Output is correct
58 Correct 36 ms 48080 KB Output is correct
59 Correct 41 ms 48424 KB Output is correct
60 Correct 38 ms 48208 KB Output is correct
61 Correct 42 ms 48204 KB Output is correct
62 Correct 39 ms 48208 KB Output is correct
63 Correct 970 ms 186536 KB Output is correct
64 Correct 979 ms 186688 KB Output is correct
65 Correct 1002 ms 186276 KB Output is correct
66 Correct 1126 ms 186384 KB Output is correct
67 Correct 985 ms 186508 KB Output is correct
68 Correct 32 ms 47432 KB Output is correct
69 Correct 36 ms 47440 KB Output is correct
70 Correct 598 ms 184228 KB Output is correct
71 Correct 627 ms 184028 KB Output is correct
72 Correct 599 ms 184500 KB Output is correct
73 Correct 529 ms 186708 KB Output is correct
74 Correct 532 ms 185624 KB Output is correct
75 Correct 528 ms 186784 KB Output is correct
76 Correct 673 ms 186572 KB Output is correct
77 Correct 675 ms 186728 KB Output is correct
78 Correct 658 ms 185504 KB Output is correct
79 Correct 1828 ms 200292 KB Output is correct
80 Correct 2120 ms 200624 KB Output is correct
81 Correct 2049 ms 200288 KB Output is correct
82 Correct 1972 ms 200068 KB Output is correct
83 Correct 2009 ms 200328 KB Output is correct
84 Correct 560 ms 184080 KB Output is correct
85 Correct 585 ms 184276 KB Output is correct
86 Correct 559 ms 184484 KB Output is correct
87 Correct 832 ms 200368 KB Output is correct
88 Correct 825 ms 199332 KB Output is correct
89 Correct 903 ms 200368 KB Output is correct
90 Correct 1105 ms 200352 KB Output is correct
91 Correct 1062 ms 200364 KB Output is correct
92 Correct 1108 ms 199804 KB Output is correct
93 Correct 576 ms 184308 KB Output is correct
94 Correct 1002 ms 213528 KB Output is correct
95 Correct 1022 ms 213536 KB Output is correct
96 Correct 1041 ms 213552 KB Output is correct
97 Correct 1159 ms 213212 KB Output is correct
98 Correct 1103 ms 213412 KB Output is correct
99 Correct 1115 ms 213148 KB Output is correct
100 Correct 2117 ms 213496 KB Output is correct
101 Correct 2262 ms 213456 KB Output is correct
102 Correct 2236 ms 213412 KB Output is correct
103 Correct 2186 ms 213408 KB Output is correct
104 Correct 1980 ms 213500 KB Output is correct
105 Correct 521 ms 184400 KB Output is correct
106 Correct 533 ms 184232 KB Output is correct