Submission #1113406

# Submission time Handle Problem Language Result Execution time Memory
1113406 2024-11-16T14:23:56 Z ntdaccode Real Mountains (CCO23_day1problem2) C++17
25 / 25
2821 ms 183116 KB
#include<bits/stdc++.h>
#define fori(i,a,b) for(int i = a;i <= b; i++)
#define int long long
#define pb push_back
using namespace std;

typedef pair<int,int> ii;
typedef tuple<int,int,int> tp;

const int M = 1e6 + 10;
const int N = 5e3 + 10;
const int mod = 1e6 + 3;

int n,h[M];
int target[M];
vector<int> in[M],out[M];
vector<int> rrh;
int calc(int l,int r) {
  return ((l + r) * (r - l + 1) / 2) % mod;
}
int add(int a,int b) {
  return (a + b) % mod;
}

int t[4 * M];
void build(int s,int l, int r)
{
  if(l == r) {
    t[s] = h[l];
    return ;
  }
  int mid = (l + r)/2;
  build(s * 2,l,mid);
  build(s * 2 + 1, mid + 1, r);
  t[s] = min(t[s * 2] , t[s * 2 + 1]);
}

void upd(int s,int l, int r, int pos, int val)
{
  if(l > pos || pos > r) return ;
  if(l == r) {
    t[s] = val;
    return ;
  }
  int mid = (l + r)/2;
  upd(s * 2, l, mid, pos, val);
  upd(s * 2 + 1, mid + 1, r, pos, val);
  t[s] = min(t[s * 2],t[s * 2 + 1]);
}

int get(int s, int l, int r, int u, int v)
{
  if(l > v || r < u) return 1e9;
  if(u <= l && r <= v) return t[s];
  int mid = (l + r)/2;
  return min(get(s * 2, l, mid, u, v),get(s * 2 + 1, mid + 1, r, u, v));
}

int32_t main()
{
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  if(fopen("1.inp","r"))
  {
    freopen("1.inp","r",stdin);
    freopen("1.out","w",stdout);
  }
  #define task ""
  if(fopen(task".inp","r"))
  {
    freopen(task".inp","r",stdin);
    freopen(task".out","w",stdout);
  }
  cin >> n;
  for(int i = 1;i <= n; i++) cin >> h[i];
  build(1,1,n);

  int suf = 0,pre = 0;
  for(int i = 1;i <= n; i++) {
    pre = max(pre, h[i]);
    target[i] =  pre ;
  }
  for(int i = n; i != 0; i--) {
    suf = max(suf, h[i]);
    target[i] = min(target[i], suf);
  }

  for(int i = 1;i <= n; i++) rrh.pb(h[i]);
  sort(rrh.begin(),rrh.end());
  rrh.resize(unique (rrh.begin(), rrh.end()) - rrh.begin());
  for(int i = 1;i <= n; i++) {
      h[i] = lower_bound(rrh.begin(),rrh.end(),h[i]) - rrh.begin() ;
      target[i] = lower_bound(rrh.begin(),rrh.end(),target[i]) - rrh.begin() ;
      if(h[i] != target[i]) {
        out[target[i]].pb(i);
      }
      in[h[i]].pb(i);

  }


  int kq = 0;
  int m= rrh.size();
  set<int> s;

  for(int high = 0;high <= m - 2; high ++) {

    for(int idx : in[high]) {
        if(h[idx] != target[idx]) s.insert(idx);
        upd(1,1,n,idx,1e9);
    }

    int sz = s.size();
    if(sz == 0) continue;
    //cout << sz << " ";
    int val = rrh[high] % mod;
    int nxt_val = rrh[high + 1] % mod;
    if(sz == 1) {

      int cur = *s.begin();
      int x = get(1, 1, n, 1, cur - 1) , y = get(1, 1, n, cur + 1, n);
      x %= mod;
      y %= mod;
      //cout << cur << " " << nxt_val << " " << val << "\n";
      //cout << x <<  " " << y << "\n";
      kq = (kq + (nxt_val - val)*(x + y) % mod  ) % mod;

    }
    else {

      int l = *s.begin(), r = *s.rbegin();

      int pre_l = get(1, 1, n, 1, l - 1) , pre_r = get(1, 1, n, 1, r - 1) ,
      suf_l = get(1, 1, n, l + 1, n) , suf_r = get(1, 1, n, r + 1, n);

      int x =(rrh[high + 1] - rrh[high]) * add(pre_l,suf_l) + (rrh[high + 1] - rrh[high]) * suf_r ;
      int y =(rrh[high + 1] - rrh[high]) * add(pre_r,suf_r) + (rrh[high + 1] - rrh[high]) * pre_l ;

      x = min(x,y) % mod;
      kq = (kq + x) % mod;

      kq = ( kq + (sz - 2) * 2ll * calc(val + 1 ,nxt_val) % mod + calc(val + 1,nxt_val)) % mod;
    }

    //cout << kq << " " << sz << "\n";
    kq = (kq + sz * calc(val,nxt_val - 1) % mod) % mod;


    for(int idx : out[high + 1]) s.erase(idx);

  }
  cout << kq % mod;
}

Compilation message

Main.cpp: In function 'int32_t main()':
Main.cpp:66:12: warning: ignoring return value of 'FILE* freopen(const char*, const char*, FILE*)' declared with attribute 'warn_unused_result' [-Wunused-result]
   66 |     freopen("1.inp","r",stdin);
      |     ~~~~~~~^~~~~~~~~~~~~~~~~~~
Main.cpp:67:12: warning: ignoring return value of 'FILE* freopen(const char*, const char*, FILE*)' declared with attribute 'warn_unused_result' [-Wunused-result]
   67 |     freopen("1.out","w",stdout);
      |     ~~~~~~~^~~~~~~~~~~~~~~~~~~~
Main.cpp:72:12: warning: ignoring return value of 'FILE* freopen(const char*, const char*, FILE*)' declared with attribute 'warn_unused_result' [-Wunused-result]
   72 |     freopen(task".inp","r",stdin);
      |     ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~
Main.cpp:73:12: warning: ignoring return value of 'FILE* freopen(const char*, const char*, FILE*)' declared with attribute 'warn_unused_result' [-Wunused-result]
   73 |     freopen(task".out","w",stdout);
      |     ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~
# Verdict Execution time Memory Grader output
1 Correct 32 ms 47304 KB Output is correct
2 Correct 33 ms 47368 KB Output is correct
3 Correct 34 ms 47364 KB Output is correct
4 Correct 34 ms 48192 KB Output is correct
5 Correct 32 ms 47700 KB Output is correct
6 Correct 35 ms 47696 KB Output is correct
7 Correct 33 ms 47696 KB Output is correct
8 Correct 40 ms 48200 KB Output is correct
9 Correct 34 ms 47696 KB Output is correct
10 Correct 33 ms 47688 KB Output is correct
11 Correct 33 ms 47952 KB Output is correct
12 Correct 35 ms 47952 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 32 ms 47304 KB Output is correct
2 Correct 33 ms 47368 KB Output is correct
3 Correct 34 ms 47364 KB Output is correct
4 Correct 34 ms 48192 KB Output is correct
5 Correct 32 ms 47700 KB Output is correct
6 Correct 35 ms 47696 KB Output is correct
7 Correct 33 ms 47696 KB Output is correct
8 Correct 40 ms 48200 KB Output is correct
9 Correct 34 ms 47696 KB Output is correct
10 Correct 33 ms 47688 KB Output is correct
11 Correct 33 ms 47952 KB Output is correct
12 Correct 35 ms 47952 KB Output is correct
13 Correct 38 ms 47848 KB Output is correct
14 Correct 32 ms 47440 KB Output is correct
15 Correct 32 ms 47608 KB Output is correct
16 Correct 35 ms 47952 KB Output is correct
17 Correct 34 ms 47952 KB Output is correct
18 Correct 37 ms 47952 KB Output is correct
19 Correct 33 ms 47952 KB Output is correct
20 Correct 34 ms 47964 KB Output is correct
21 Correct 34 ms 47944 KB Output is correct
22 Correct 36 ms 47960 KB Output is correct
23 Correct 35 ms 48116 KB Output is correct
24 Correct 37 ms 47940 KB Output is correct
25 Correct 35 ms 48048 KB Output is correct
26 Correct 35 ms 47952 KB Output is correct
27 Correct 34 ms 47952 KB Output is correct
28 Correct 34 ms 47944 KB Output is correct
29 Correct 33 ms 47432 KB Output is correct
30 Correct 32 ms 47432 KB Output is correct
31 Correct 34 ms 47440 KB Output is correct
32 Correct 41 ms 47436 KB Output is correct
33 Correct 32 ms 47440 KB Output is correct
34 Correct 32 ms 47440 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 32 ms 47304 KB Output is correct
2 Correct 33 ms 47368 KB Output is correct
3 Correct 34 ms 47364 KB Output is correct
4 Correct 34 ms 48192 KB Output is correct
5 Correct 32 ms 47700 KB Output is correct
6 Correct 35 ms 47696 KB Output is correct
7 Correct 33 ms 47696 KB Output is correct
8 Correct 40 ms 48200 KB Output is correct
9 Correct 34 ms 47696 KB Output is correct
10 Correct 33 ms 47688 KB Output is correct
11 Correct 33 ms 47952 KB Output is correct
12 Correct 35 ms 47952 KB Output is correct
13 Correct 38 ms 47848 KB Output is correct
14 Correct 32 ms 47440 KB Output is correct
15 Correct 32 ms 47608 KB Output is correct
16 Correct 35 ms 47952 KB Output is correct
17 Correct 34 ms 47952 KB Output is correct
18 Correct 37 ms 47952 KB Output is correct
19 Correct 33 ms 47952 KB Output is correct
20 Correct 34 ms 47964 KB Output is correct
21 Correct 34 ms 47944 KB Output is correct
22 Correct 36 ms 47960 KB Output is correct
23 Correct 35 ms 48116 KB Output is correct
24 Correct 37 ms 47940 KB Output is correct
25 Correct 35 ms 48048 KB Output is correct
26 Correct 35 ms 47952 KB Output is correct
27 Correct 34 ms 47952 KB Output is correct
28 Correct 34 ms 47944 KB Output is correct
29 Correct 33 ms 47432 KB Output is correct
30 Correct 32 ms 47432 KB Output is correct
31 Correct 34 ms 47440 KB Output is correct
32 Correct 41 ms 47436 KB Output is correct
33 Correct 32 ms 47440 KB Output is correct
34 Correct 32 ms 47440 KB Output is correct
35 Correct 36 ms 48152 KB Output is correct
36 Correct 40 ms 47952 KB Output is correct
37 Correct 38 ms 48160 KB Output is correct
38 Correct 38 ms 47952 KB Output is correct
39 Correct 37 ms 47952 KB Output is correct
40 Correct 38 ms 47944 KB Output is correct
41 Correct 35 ms 47964 KB Output is correct
42 Correct 34 ms 47952 KB Output is correct
43 Correct 39 ms 47944 KB Output is correct
44 Correct 36 ms 47952 KB Output is correct
45 Correct 38 ms 47956 KB Output is correct
46 Correct 38 ms 47944 KB Output is correct
47 Correct 38 ms 47952 KB Output is correct
48 Correct 38 ms 48116 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 32 ms 47304 KB Output is correct
2 Correct 33 ms 47368 KB Output is correct
3 Correct 34 ms 47364 KB Output is correct
4 Correct 34 ms 48192 KB Output is correct
5 Correct 32 ms 47700 KB Output is correct
6 Correct 35 ms 47696 KB Output is correct
7 Correct 33 ms 47696 KB Output is correct
8 Correct 40 ms 48200 KB Output is correct
9 Correct 34 ms 47696 KB Output is correct
10 Correct 33 ms 47688 KB Output is correct
11 Correct 33 ms 47952 KB Output is correct
12 Correct 35 ms 47952 KB Output is correct
13 Correct 38 ms 47848 KB Output is correct
14 Correct 32 ms 47440 KB Output is correct
15 Correct 32 ms 47608 KB Output is correct
16 Correct 35 ms 47952 KB Output is correct
17 Correct 34 ms 47952 KB Output is correct
18 Correct 37 ms 47952 KB Output is correct
19 Correct 33 ms 47952 KB Output is correct
20 Correct 34 ms 47964 KB Output is correct
21 Correct 34 ms 47944 KB Output is correct
22 Correct 36 ms 47960 KB Output is correct
23 Correct 35 ms 48116 KB Output is correct
24 Correct 37 ms 47940 KB Output is correct
25 Correct 35 ms 48048 KB Output is correct
26 Correct 35 ms 47952 KB Output is correct
27 Correct 34 ms 47952 KB Output is correct
28 Correct 34 ms 47944 KB Output is correct
29 Correct 33 ms 47432 KB Output is correct
30 Correct 32 ms 47432 KB Output is correct
31 Correct 34 ms 47440 KB Output is correct
32 Correct 41 ms 47436 KB Output is correct
33 Correct 32 ms 47440 KB Output is correct
34 Correct 32 ms 47440 KB Output is correct
35 Correct 36 ms 48152 KB Output is correct
36 Correct 40 ms 47952 KB Output is correct
37 Correct 38 ms 48160 KB Output is correct
38 Correct 38 ms 47952 KB Output is correct
39 Correct 37 ms 47952 KB Output is correct
40 Correct 38 ms 47944 KB Output is correct
41 Correct 35 ms 47964 KB Output is correct
42 Correct 34 ms 47952 KB Output is correct
43 Correct 39 ms 47944 KB Output is correct
44 Correct 36 ms 47952 KB Output is correct
45 Correct 38 ms 47956 KB Output is correct
46 Correct 38 ms 47944 KB Output is correct
47 Correct 38 ms 47952 KB Output is correct
48 Correct 38 ms 48116 KB Output is correct
49 Correct 36 ms 47952 KB Output is correct
50 Correct 38 ms 48116 KB Output is correct
51 Correct 41 ms 47944 KB Output is correct
52 Correct 38 ms 47952 KB Output is correct
53 Correct 39 ms 47964 KB Output is correct
54 Correct 34 ms 47952 KB Output is correct
55 Correct 38 ms 47952 KB Output is correct
56 Correct 38 ms 47952 KB Output is correct
57 Correct 35 ms 47952 KB Output is correct
58 Correct 39 ms 47944 KB Output is correct
59 Correct 38 ms 47944 KB Output is correct
60 Correct 38 ms 47948 KB Output is correct
61 Correct 38 ms 47952 KB Output is correct
62 Correct 38 ms 47952 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 32 ms 47304 KB Output is correct
2 Correct 33 ms 47368 KB Output is correct
3 Correct 34 ms 47364 KB Output is correct
4 Correct 34 ms 48192 KB Output is correct
5 Correct 32 ms 47700 KB Output is correct
6 Correct 35 ms 47696 KB Output is correct
7 Correct 33 ms 47696 KB Output is correct
8 Correct 40 ms 48200 KB Output is correct
9 Correct 34 ms 47696 KB Output is correct
10 Correct 33 ms 47688 KB Output is correct
11 Correct 33 ms 47952 KB Output is correct
12 Correct 35 ms 47952 KB Output is correct
13 Correct 38 ms 47848 KB Output is correct
14 Correct 32 ms 47440 KB Output is correct
15 Correct 32 ms 47608 KB Output is correct
16 Correct 35 ms 47952 KB Output is correct
17 Correct 34 ms 47952 KB Output is correct
18 Correct 37 ms 47952 KB Output is correct
19 Correct 33 ms 47952 KB Output is correct
20 Correct 34 ms 47964 KB Output is correct
21 Correct 34 ms 47944 KB Output is correct
22 Correct 36 ms 47960 KB Output is correct
23 Correct 35 ms 48116 KB Output is correct
24 Correct 37 ms 47940 KB Output is correct
25 Correct 35 ms 48048 KB Output is correct
26 Correct 35 ms 47952 KB Output is correct
27 Correct 34 ms 47952 KB Output is correct
28 Correct 34 ms 47944 KB Output is correct
29 Correct 33 ms 47432 KB Output is correct
30 Correct 32 ms 47432 KB Output is correct
31 Correct 34 ms 47440 KB Output is correct
32 Correct 41 ms 47436 KB Output is correct
33 Correct 32 ms 47440 KB Output is correct
34 Correct 32 ms 47440 KB Output is correct
35 Correct 1047 ms 156068 KB Output is correct
36 Correct 1036 ms 156052 KB Output is correct
37 Correct 1002 ms 156108 KB Output is correct
38 Correct 1039 ms 156044 KB Output is correct
39 Correct 1173 ms 156076 KB Output is correct
40 Correct 30 ms 47440 KB Output is correct
41 Correct 30 ms 47440 KB Output is correct
42 Correct 572 ms 153400 KB Output is correct
43 Correct 592 ms 153512 KB Output is correct
44 Correct 628 ms 154020 KB Output is correct
45 Correct 479 ms 156092 KB Output is correct
46 Correct 501 ms 156344 KB Output is correct
47 Correct 482 ms 156148 KB Output is correct
48 Correct 578 ms 156072 KB Output is correct
49 Correct 617 ms 156180 KB Output is correct
50 Correct 595 ms 156132 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 32 ms 47304 KB Output is correct
2 Correct 33 ms 47368 KB Output is correct
3 Correct 34 ms 47364 KB Output is correct
4 Correct 34 ms 48192 KB Output is correct
5 Correct 32 ms 47700 KB Output is correct
6 Correct 35 ms 47696 KB Output is correct
7 Correct 33 ms 47696 KB Output is correct
8 Correct 40 ms 48200 KB Output is correct
9 Correct 34 ms 47696 KB Output is correct
10 Correct 33 ms 47688 KB Output is correct
11 Correct 33 ms 47952 KB Output is correct
12 Correct 35 ms 47952 KB Output is correct
13 Correct 38 ms 47848 KB Output is correct
14 Correct 32 ms 47440 KB Output is correct
15 Correct 32 ms 47608 KB Output is correct
16 Correct 35 ms 47952 KB Output is correct
17 Correct 34 ms 47952 KB Output is correct
18 Correct 37 ms 47952 KB Output is correct
19 Correct 33 ms 47952 KB Output is correct
20 Correct 34 ms 47964 KB Output is correct
21 Correct 34 ms 47944 KB Output is correct
22 Correct 36 ms 47960 KB Output is correct
23 Correct 35 ms 48116 KB Output is correct
24 Correct 37 ms 47940 KB Output is correct
25 Correct 35 ms 48048 KB Output is correct
26 Correct 35 ms 47952 KB Output is correct
27 Correct 34 ms 47952 KB Output is correct
28 Correct 34 ms 47944 KB Output is correct
29 Correct 33 ms 47432 KB Output is correct
30 Correct 32 ms 47432 KB Output is correct
31 Correct 34 ms 47440 KB Output is correct
32 Correct 41 ms 47436 KB Output is correct
33 Correct 32 ms 47440 KB Output is correct
34 Correct 32 ms 47440 KB Output is correct
35 Correct 36 ms 48152 KB Output is correct
36 Correct 40 ms 47952 KB Output is correct
37 Correct 38 ms 48160 KB Output is correct
38 Correct 38 ms 47952 KB Output is correct
39 Correct 37 ms 47952 KB Output is correct
40 Correct 38 ms 47944 KB Output is correct
41 Correct 35 ms 47964 KB Output is correct
42 Correct 34 ms 47952 KB Output is correct
43 Correct 39 ms 47944 KB Output is correct
44 Correct 36 ms 47952 KB Output is correct
45 Correct 38 ms 47956 KB Output is correct
46 Correct 38 ms 47944 KB Output is correct
47 Correct 38 ms 47952 KB Output is correct
48 Correct 38 ms 48116 KB Output is correct
49 Correct 1047 ms 156068 KB Output is correct
50 Correct 1036 ms 156052 KB Output is correct
51 Correct 1002 ms 156108 KB Output is correct
52 Correct 1039 ms 156044 KB Output is correct
53 Correct 1173 ms 156076 KB Output is correct
54 Correct 30 ms 47440 KB Output is correct
55 Correct 30 ms 47440 KB Output is correct
56 Correct 572 ms 153400 KB Output is correct
57 Correct 592 ms 153512 KB Output is correct
58 Correct 628 ms 154020 KB Output is correct
59 Correct 479 ms 156092 KB Output is correct
60 Correct 501 ms 156344 KB Output is correct
61 Correct 482 ms 156148 KB Output is correct
62 Correct 578 ms 156072 KB Output is correct
63 Correct 617 ms 156180 KB Output is correct
64 Correct 595 ms 156132 KB Output is correct
65 Correct 2364 ms 169944 KB Output is correct
66 Correct 2467 ms 170200 KB Output is correct
67 Correct 2285 ms 169824 KB Output is correct
68 Correct 2479 ms 169756 KB Output is correct
69 Correct 2154 ms 170016 KB Output is correct
70 Correct 558 ms 153604 KB Output is correct
71 Correct 580 ms 153508 KB Output is correct
72 Correct 573 ms 153764 KB Output is correct
73 Correct 1025 ms 169932 KB Output is correct
74 Correct 1006 ms 169916 KB Output is correct
75 Correct 1049 ms 169896 KB Output is correct
76 Correct 1400 ms 169704 KB Output is correct
77 Correct 1337 ms 169784 KB Output is correct
78 Correct 1441 ms 169540 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 32 ms 47304 KB Output is correct
2 Correct 33 ms 47368 KB Output is correct
3 Correct 34 ms 47364 KB Output is correct
4 Correct 34 ms 48192 KB Output is correct
5 Correct 32 ms 47700 KB Output is correct
6 Correct 35 ms 47696 KB Output is correct
7 Correct 33 ms 47696 KB Output is correct
8 Correct 40 ms 48200 KB Output is correct
9 Correct 34 ms 47696 KB Output is correct
10 Correct 33 ms 47688 KB Output is correct
11 Correct 33 ms 47952 KB Output is correct
12 Correct 35 ms 47952 KB Output is correct
13 Correct 38 ms 47848 KB Output is correct
14 Correct 32 ms 47440 KB Output is correct
15 Correct 32 ms 47608 KB Output is correct
16 Correct 35 ms 47952 KB Output is correct
17 Correct 34 ms 47952 KB Output is correct
18 Correct 37 ms 47952 KB Output is correct
19 Correct 33 ms 47952 KB Output is correct
20 Correct 34 ms 47964 KB Output is correct
21 Correct 34 ms 47944 KB Output is correct
22 Correct 36 ms 47960 KB Output is correct
23 Correct 35 ms 48116 KB Output is correct
24 Correct 37 ms 47940 KB Output is correct
25 Correct 35 ms 48048 KB Output is correct
26 Correct 35 ms 47952 KB Output is correct
27 Correct 34 ms 47952 KB Output is correct
28 Correct 34 ms 47944 KB Output is correct
29 Correct 33 ms 47432 KB Output is correct
30 Correct 32 ms 47432 KB Output is correct
31 Correct 34 ms 47440 KB Output is correct
32 Correct 41 ms 47436 KB Output is correct
33 Correct 32 ms 47440 KB Output is correct
34 Correct 32 ms 47440 KB Output is correct
35 Correct 36 ms 48152 KB Output is correct
36 Correct 40 ms 47952 KB Output is correct
37 Correct 38 ms 48160 KB Output is correct
38 Correct 38 ms 47952 KB Output is correct
39 Correct 37 ms 47952 KB Output is correct
40 Correct 38 ms 47944 KB Output is correct
41 Correct 35 ms 47964 KB Output is correct
42 Correct 34 ms 47952 KB Output is correct
43 Correct 39 ms 47944 KB Output is correct
44 Correct 36 ms 47952 KB Output is correct
45 Correct 38 ms 47956 KB Output is correct
46 Correct 38 ms 47944 KB Output is correct
47 Correct 38 ms 47952 KB Output is correct
48 Correct 38 ms 48116 KB Output is correct
49 Correct 36 ms 47952 KB Output is correct
50 Correct 38 ms 48116 KB Output is correct
51 Correct 41 ms 47944 KB Output is correct
52 Correct 38 ms 47952 KB Output is correct
53 Correct 39 ms 47964 KB Output is correct
54 Correct 34 ms 47952 KB Output is correct
55 Correct 38 ms 47952 KB Output is correct
56 Correct 38 ms 47952 KB Output is correct
57 Correct 35 ms 47952 KB Output is correct
58 Correct 39 ms 47944 KB Output is correct
59 Correct 38 ms 47944 KB Output is correct
60 Correct 38 ms 47948 KB Output is correct
61 Correct 38 ms 47952 KB Output is correct
62 Correct 38 ms 47952 KB Output is correct
63 Correct 1047 ms 156068 KB Output is correct
64 Correct 1036 ms 156052 KB Output is correct
65 Correct 1002 ms 156108 KB Output is correct
66 Correct 1039 ms 156044 KB Output is correct
67 Correct 1173 ms 156076 KB Output is correct
68 Correct 30 ms 47440 KB Output is correct
69 Correct 30 ms 47440 KB Output is correct
70 Correct 572 ms 153400 KB Output is correct
71 Correct 592 ms 153512 KB Output is correct
72 Correct 628 ms 154020 KB Output is correct
73 Correct 479 ms 156092 KB Output is correct
74 Correct 501 ms 156344 KB Output is correct
75 Correct 482 ms 156148 KB Output is correct
76 Correct 578 ms 156072 KB Output is correct
77 Correct 617 ms 156180 KB Output is correct
78 Correct 595 ms 156132 KB Output is correct
79 Correct 2364 ms 169944 KB Output is correct
80 Correct 2467 ms 170200 KB Output is correct
81 Correct 2285 ms 169824 KB Output is correct
82 Correct 2479 ms 169756 KB Output is correct
83 Correct 2154 ms 170016 KB Output is correct
84 Correct 558 ms 153604 KB Output is correct
85 Correct 580 ms 153508 KB Output is correct
86 Correct 573 ms 153764 KB Output is correct
87 Correct 1025 ms 169932 KB Output is correct
88 Correct 1006 ms 169916 KB Output is correct
89 Correct 1049 ms 169896 KB Output is correct
90 Correct 1400 ms 169704 KB Output is correct
91 Correct 1337 ms 169784 KB Output is correct
92 Correct 1441 ms 169540 KB Output is correct
93 Correct 560 ms 153968 KB Output is correct
94 Correct 1142 ms 182976 KB Output is correct
95 Correct 1200 ms 182956 KB Output is correct
96 Correct 1203 ms 182956 KB Output is correct
97 Correct 1583 ms 182560 KB Output is correct
98 Correct 1618 ms 182696 KB Output is correct
99 Correct 1610 ms 182600 KB Output is correct
100 Correct 2592 ms 183116 KB Output is correct
101 Correct 2821 ms 182828 KB Output is correct
102 Correct 2711 ms 183068 KB Output is correct
103 Correct 2710 ms 182848 KB Output is correct
104 Correct 2701 ms 182804 KB Output is correct
105 Correct 568 ms 153764 KB Output is correct
106 Correct 560 ms 153668 KB Output is correct