답안 #681626

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
681626 2023-01-13T13:21:53 Z stevancv Progression (NOI20_progression) C++14
100 / 100
1714 ms 125724 KB
#include <bits/stdc++.h>
#define ll long long
#define ld long double
#define sp ' '
#define en '\n'
#define smin(a, b) a = min(a, b)
#define smax(a, b) a = max(a, b)
using namespace std;
const int N = 3e5 + 2;
const ll linf = 9e18;
struct Segtree {
    ll st[4 * N], lzys[4 * N], lzya[4 * N];
    void Reset1(int n) {
        for (int i = 1; i <= 4 * n; i++) {
            lzys[i] = linf;
            st[i] = lzya[i] = 0;
        }
    }
    void Propagate1(int node, int l, int r) {
        if (lzys[node] == linf && lzya[node] == 0) return;
        if (l < r) {
            if (lzys[node] != linf) {
                lzys[2 * node] = lzys[2 * node + 1] = lzys[node];
                lzya[2 * node] = lzya[2 * node + 1] = 0;
            }
            if (lzya[node] != 0) {
                if (lzys[2 * node] != linf) lzys[2 * node] += lzya[node];
                else lzya[2 * node] += lzya[node];
                if (lzys[2 * node + 1] != linf) lzys[2 * node + 1] += lzya[node];
                else lzya[2 * node + 1] += lzya[node];
            }
        }
        if (lzys[node] != linf) {st[node] = lzys[node]; lzys[node] = linf;}
        if (lzya[node] != 0) {st[node] += lzya[node]; lzya[node] = 0;}
    }
    void Set1(int node, int l, int r, int ql, int qr, ll y) {
        Propagate1(node, l, r);
        if (r < ql || qr < l || ql > qr) return;
        if (ql <= l && r <= qr) {
            lzys[node] = y;
            Propagate1(node, l, r);
            return;
        }
        int mid = l + r >> 1;
        Set1(2 * node, l, mid, ql, qr, y);
        Set1(2 * node + 1, mid + 1, r, ql, qr, y);
        st[node] = min(st[2 * node], st[2 * node + 1]);
    }
    void Add1(int node, int l, int r, int ql, int qr, ll y) {
        Propagate1(node, l, r);
        if (r < ql || qr < l || ql > qr) return;
        if (ql <= l && r <= qr) {
            lzya[node] = y;
            Propagate1(node, l, r);
            return;
        }
        int mid = l + r >> 1;
        Add1(2 * node, l, mid, ql, qr, y);
        Add1(2 * node + 1, mid + 1, r, ql, qr, y);
        st[node] = min(st[2 * node], st[2 * node + 1]);
    }
    ll Get1(int node, int l, int r, int x) {
        Propagate1(node, l, r);
        if (l == r) return st[node];
        int mid = l + r >> 1;
        if (x <= mid) return Get1(2 * node, l, mid, x);
        return Get1(2 * node + 1, mid + 1, r, x);
    }
}st1, st2;
struct Node {
    int ans, llen, rlen, seg;
    ll lval, rval;
    Node() {
        ans = llen = rlen = seg = 0;
        lval = rval = linf;
    }
    Node(int a, int b, int c, int d, ll e, ll f) {
        ans = a; llen = b; rlen = c; seg = d; lval = e; rval = f;
    }
}st[4 * N];
Node Merge(Node a, Node b) {
    Node c = Node();
    if (a.lval == linf) {c = b; return c;}
    if (b.lval == linf) {c = a; return c;}
    c.ans = max(a.ans, b.ans); c.lval = a.lval; c.rval = b.rval; c.llen = a.llen; c.rlen = b.rlen; c.seg = a.seg + b.seg;
    if (a.rval != b.lval) return c;
    smax(c.ans, a.rlen + b.llen);
    if (a.llen == a.seg) c.llen += b.llen;
    if (b.rlen == b.seg) c.rlen += a.rlen;
    return c;
}
ll a[N], d[N], lzys[4 * N], lzya[4 * N];
void Init(int node, int l, int r) {
    lzys[node] = linf; lzya[node] = 0;
    if (l == r) {
        st[node] = Node(1, 1, 1, 1, d[l], d[l]);
        return;
    }
    int mid = l + r >> 1;
    Init(2 * node, l, mid);
    Init(2 * node + 1, mid + 1, r);
    st[node] = Merge(st[2 * node], st[2 * node + 1]);
}
void Propagate(int node, int l, int r) {
    if (lzys[node] == linf && lzya[node] == 0) return;
    if (l < r) {
        if (lzys[node] != linf) {
            lzys[2 * node] = lzys[2 * node + 1] = lzys[node];
            lzya[2 * node] = lzya[2 * node + 1] = 0;
        }
        if (lzya[node] != 0) {
            if (lzys[2 * node] != linf) lzys[2 * node] += lzya[node];
            else lzya[2 * node] += lzya[node];
            if (lzys[2 * node + 1] != linf) lzys[2 * node + 1] += lzya[node];
            else lzya[2 * node + 1] += lzya[node];
        }
    }
    if (lzys[node] != linf) {
        st[node] = Node(r - l + 1, r - l + 1, r - l + 1, r - l + 1, lzys[node], lzys[node]);
        lzys[node] = linf;
    }
    if (lzya[node] != 0) {
        st[node].lval += lzya[node]; st[node].rval += lzya[node];
        lzya[node] = 0;
    }
}
void Set(int node, int l, int r, int ql, int qr, ll y) {
    Propagate(node, l, r);
    if (r < ql || qr < l || ql > qr) return;
    if (ql <= l && r <= qr) {
        lzys[node] = y;
        Propagate(node, l, r);
        return;
    }
    int mid = l + r >> 1;
    Set(2 * node, l, mid, ql, qr, y);
    Set(2 * node + 1, mid + 1, r, ql, qr, y);
    st[node] = Merge(st[2 * node], st[2 * node + 1]);
}
void Add(int node, int l, int r, int ql, int qr, ll y) {
    Propagate(node, l, r);
    if (r < ql || qr < l || ql > qr) return;
    if (ql <= l && r <= qr) {
        lzya[node] = y;
        Propagate(node, l, r);
        return;
    }
    int mid = l + r >> 1;
    Add(2 * node, l, mid, ql, qr, y);
    Add(2 * node + 1, mid + 1, r, ql, qr, y);
    st[node] = Merge(st[2 * node], st[2 * node + 1]);
}
Node Get(int node, int l, int r, int ql, int qr) {
    Propagate(node, l, r);
    if (r < ql || qr < l || ql > qr) return Node();
    if (ql <= l && r <= qr) return st[node];
    int mid = l + r >> 1;
    return Merge(Get(2 * node, l, mid, ql, qr), Get(2 * node + 1, mid + 1, r, ql, qr));
}
int main() {
    ios::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    int n, q;
    cin >> n >> q;
    st1.Reset1(n); st2.Reset1(n);
    for (int i = 1; i <= n; i++) {
        cin >> a[i];
        st1.Add1(1, 1, n, i, i, a[i]);
    }
    for (int i = 1; i < n; i++) d[i] = a[i + 1] - a[i];
    if (n == 1) {
        while (q--) {
            int ty, l, r, s, c;
            cin >> ty;
            if (ty <= 2) cin >> l >> r >> s >> c;
            else cin >> l >> r;
            if (ty == 3) cout << 1 << en;
        }
        return 0;
    }
    Init(1, 1, n - 1);
    while (q--) {
        int ty; cin >> ty;
        if (ty == 1) {
            int l, r;
            ll s, c;
            cin >> l >> r >> s >> c;
            st1.Add1(1, 1, n, l, r, s - l * c);
            st2.Add1(1, 1, n, l, r, c);
            if (l > 1) Add(1, 1, n - 1, l - 1, l - 1, s);
            Add(1, 1, n - 1, l, r - 1, c);
            if (r < n) Add(1, 1, n - 1, r, r, -s - (r - l) * c);
        }
        else if (ty == 2) {
            int l, r;
            ll s, c;
            cin >> l >> r >> s >> c;
            st1.Set1(1, 1, n, l, r, s - l * c);
            st2.Set1(1, 1, n, l, r, c);
            if (l > 1) {
                ll val = st1.Get1(1, 1, n, l - 1) + (l - 1) * st2.Get1(1, 1, n, l - 1);
                Set(1, 1, n - 1, l - 1, l - 1, s - val);
            }
            Set(1, 1, n - 1, l, r - 1, c);
            if (r < n) {
                ll val = st1.Get1(1, 1, n, r + 1) + (r + 1) * st2.Get1(1, 1, n, r + 1);
                Set(1, 1, n - 1, r, r, val - s - (r - l) * c);
            }
        }
        else {
            int l, r;
            cin >> l >> r;
            cout << Get(1, 1, n - 1, l, r - 1).ans + 1 << en;
        }
    }
    return 0;
}

Compilation message

Progression.cpp: In member function 'void Segtree::Set1(int, int, int, int, int, long long int)':
Progression.cpp:44:21: warning: suggest parentheses around '+' inside '>>' [-Wparentheses]
   44 |         int mid = l + r >> 1;
      |                   ~~^~~
Progression.cpp: In member function 'void Segtree::Add1(int, int, int, int, int, long long int)':
Progression.cpp:57:21: warning: suggest parentheses around '+' inside '>>' [-Wparentheses]
   57 |         int mid = l + r >> 1;
      |                   ~~^~~
Progression.cpp: In member function 'long long int Segtree::Get1(int, int, int, int)':
Progression.cpp:65:21: warning: suggest parentheses around '+' inside '>>' [-Wparentheses]
   65 |         int mid = l + r >> 1;
      |                   ~~^~~
Progression.cpp: In function 'void Init(int, int, int)':
Progression.cpp:99:17: warning: suggest parentheses around '+' inside '>>' [-Wparentheses]
   99 |     int mid = l + r >> 1;
      |               ~~^~~
Progression.cpp: In function 'void Set(int, int, int, int, int, long long int)':
Progression.cpp:135:17: warning: suggest parentheses around '+' inside '>>' [-Wparentheses]
  135 |     int mid = l + r >> 1;
      |               ~~^~~
Progression.cpp: In function 'void Add(int, int, int, int, int, long long int)':
Progression.cpp:148:17: warning: suggest parentheses around '+' inside '>>' [-Wparentheses]
  148 |     int mid = l + r >> 1;
      |               ~~^~~
Progression.cpp: In function 'Node Get(int, int, int, int, int)':
Progression.cpp:157:17: warning: suggest parentheses around '+' inside '>>' [-Wparentheses]
  157 |     int mid = l + r >> 1;
      |               ~~^~~
# 결과 실행 시간 메모리 Grader output
1 Correct 236 ms 115980 KB Output is correct
2 Correct 94 ms 38204 KB Output is correct
3 Correct 91 ms 38200 KB Output is correct
4 Correct 92 ms 38220 KB Output is correct
5 Correct 94 ms 38292 KB Output is correct
6 Correct 92 ms 38292 KB Output is correct
7 Correct 100 ms 38304 KB Output is correct
8 Correct 18 ms 38068 KB Output is correct
9 Correct 18 ms 37944 KB Output is correct
10 Correct 17 ms 37884 KB Output is correct
11 Correct 253 ms 124056 KB Output is correct
12 Correct 240 ms 123988 KB Output is correct
13 Correct 243 ms 124216 KB Output is correct
14 Correct 247 ms 124320 KB Output is correct
15 Correct 242 ms 124156 KB Output is correct
16 Correct 243 ms 123824 KB Output is correct
17 Correct 237 ms 123856 KB Output is correct
18 Correct 244 ms 123932 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 18 ms 38176 KB Output is correct
2 Correct 17 ms 37936 KB Output is correct
3 Correct 17 ms 37972 KB Output is correct
4 Correct 18 ms 37972 KB Output is correct
5 Correct 16 ms 37868 KB Output is correct
6 Correct 16 ms 37852 KB Output is correct
7 Correct 16 ms 37972 KB Output is correct
8 Correct 19 ms 38216 KB Output is correct
9 Correct 18 ms 38208 KB Output is correct
10 Correct 19 ms 38228 KB Output is correct
11 Correct 19 ms 38092 KB Output is correct
12 Correct 19 ms 38180 KB Output is correct
13 Correct 17 ms 38204 KB Output is correct
14 Correct 18 ms 38172 KB Output is correct
15 Correct 19 ms 38212 KB Output is correct
16 Correct 20 ms 38196 KB Output is correct
17 Correct 21 ms 38148 KB Output is correct
18 Correct 19 ms 38228 KB Output is correct
19 Correct 18 ms 37972 KB Output is correct
20 Correct 18 ms 37920 KB Output is correct
21 Correct 19 ms 37920 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 394 ms 116368 KB Output is correct
2 Correct 103 ms 38492 KB Output is correct
3 Correct 105 ms 38552 KB Output is correct
4 Correct 90 ms 38516 KB Output is correct
5 Correct 103 ms 38528 KB Output is correct
6 Correct 101 ms 38636 KB Output is correct
7 Correct 102 ms 38620 KB Output is correct
8 Correct 16 ms 37844 KB Output is correct
9 Correct 17 ms 37828 KB Output is correct
10 Correct 19 ms 37936 KB Output is correct
11 Correct 406 ms 116112 KB Output is correct
12 Correct 399 ms 116396 KB Output is correct
13 Correct 405 ms 116104 KB Output is correct
14 Correct 397 ms 116368 KB Output is correct
15 Correct 412 ms 116380 KB Output is correct
16 Correct 401 ms 116788 KB Output is correct
17 Correct 421 ms 116636 KB Output is correct
18 Correct 414 ms 116916 KB Output is correct
19 Correct 379 ms 115964 KB Output is correct
20 Correct 399 ms 116124 KB Output is correct
21 Correct 373 ms 116152 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 1006 ms 115688 KB Output is correct
2 Correct 183 ms 38148 KB Output is correct
3 Correct 189 ms 38100 KB Output is correct
4 Correct 189 ms 38152 KB Output is correct
5 Correct 194 ms 38152 KB Output is correct
6 Correct 197 ms 38144 KB Output is correct
7 Correct 206 ms 38152 KB Output is correct
8 Correct 18 ms 37852 KB Output is correct
9 Correct 18 ms 37972 KB Output is correct
10 Correct 20 ms 37872 KB Output is correct
11 Correct 944 ms 121920 KB Output is correct
12 Correct 960 ms 125224 KB Output is correct
13 Correct 940 ms 121916 KB Output is correct
14 Correct 935 ms 121920 KB Output is correct
15 Correct 1047 ms 125132 KB Output is correct
16 Correct 964 ms 125308 KB Output is correct
17 Correct 1004 ms 125296 KB Output is correct
18 Correct 1029 ms 125516 KB Output is correct
19 Correct 977 ms 125220 KB Output is correct
20 Correct 968 ms 125208 KB Output is correct
21 Correct 964 ms 125164 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 394 ms 116368 KB Output is correct
2 Correct 103 ms 38492 KB Output is correct
3 Correct 105 ms 38552 KB Output is correct
4 Correct 90 ms 38516 KB Output is correct
5 Correct 103 ms 38528 KB Output is correct
6 Correct 101 ms 38636 KB Output is correct
7 Correct 102 ms 38620 KB Output is correct
8 Correct 16 ms 37844 KB Output is correct
9 Correct 17 ms 37828 KB Output is correct
10 Correct 19 ms 37936 KB Output is correct
11 Correct 406 ms 116112 KB Output is correct
12 Correct 399 ms 116396 KB Output is correct
13 Correct 405 ms 116104 KB Output is correct
14 Correct 397 ms 116368 KB Output is correct
15 Correct 412 ms 116380 KB Output is correct
16 Correct 401 ms 116788 KB Output is correct
17 Correct 421 ms 116636 KB Output is correct
18 Correct 414 ms 116916 KB Output is correct
19 Correct 379 ms 115964 KB Output is correct
20 Correct 399 ms 116124 KB Output is correct
21 Correct 373 ms 116152 KB Output is correct
22 Correct 1304 ms 115876 KB Output is correct
23 Correct 202 ms 38216 KB Output is correct
24 Correct 194 ms 38216 KB Output is correct
25 Correct 195 ms 38256 KB Output is correct
26 Correct 202 ms 38260 KB Output is correct
27 Correct 204 ms 38252 KB Output is correct
28 Correct 200 ms 38200 KB Output is correct
29 Correct 17 ms 37844 KB Output is correct
30 Correct 18 ms 37896 KB Output is correct
31 Correct 17 ms 37972 KB Output is correct
32 Correct 1281 ms 122008 KB Output is correct
33 Correct 1266 ms 124636 KB Output is correct
34 Correct 1280 ms 121864 KB Output is correct
35 Correct 1327 ms 121800 KB Output is correct
36 Correct 936 ms 121708 KB Output is correct
37 Correct 990 ms 121860 KB Output is correct
38 Correct 935 ms 121756 KB Output is correct
39 Correct 1384 ms 124644 KB Output is correct
40 Correct 1317 ms 125048 KB Output is correct
41 Correct 1380 ms 124804 KB Output is correct
42 Correct 1341 ms 124744 KB Output is correct
43 Correct 1329 ms 124716 KB Output is correct
44 Correct 1330 ms 124820 KB Output is correct
45 Correct 1303 ms 124740 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 236 ms 115980 KB Output is correct
2 Correct 94 ms 38204 KB Output is correct
3 Correct 91 ms 38200 KB Output is correct
4 Correct 92 ms 38220 KB Output is correct
5 Correct 94 ms 38292 KB Output is correct
6 Correct 92 ms 38292 KB Output is correct
7 Correct 100 ms 38304 KB Output is correct
8 Correct 18 ms 38068 KB Output is correct
9 Correct 18 ms 37944 KB Output is correct
10 Correct 17 ms 37884 KB Output is correct
11 Correct 253 ms 124056 KB Output is correct
12 Correct 240 ms 123988 KB Output is correct
13 Correct 243 ms 124216 KB Output is correct
14 Correct 247 ms 124320 KB Output is correct
15 Correct 242 ms 124156 KB Output is correct
16 Correct 243 ms 123824 KB Output is correct
17 Correct 237 ms 123856 KB Output is correct
18 Correct 244 ms 123932 KB Output is correct
19 Correct 18 ms 38176 KB Output is correct
20 Correct 17 ms 37936 KB Output is correct
21 Correct 17 ms 37972 KB Output is correct
22 Correct 18 ms 37972 KB Output is correct
23 Correct 16 ms 37868 KB Output is correct
24 Correct 16 ms 37852 KB Output is correct
25 Correct 16 ms 37972 KB Output is correct
26 Correct 19 ms 38216 KB Output is correct
27 Correct 18 ms 38208 KB Output is correct
28 Correct 19 ms 38228 KB Output is correct
29 Correct 19 ms 38092 KB Output is correct
30 Correct 19 ms 38180 KB Output is correct
31 Correct 17 ms 38204 KB Output is correct
32 Correct 18 ms 38172 KB Output is correct
33 Correct 19 ms 38212 KB Output is correct
34 Correct 20 ms 38196 KB Output is correct
35 Correct 21 ms 38148 KB Output is correct
36 Correct 19 ms 38228 KB Output is correct
37 Correct 18 ms 37972 KB Output is correct
38 Correct 18 ms 37920 KB Output is correct
39 Correct 19 ms 37920 KB Output is correct
40 Correct 394 ms 116368 KB Output is correct
41 Correct 103 ms 38492 KB Output is correct
42 Correct 105 ms 38552 KB Output is correct
43 Correct 90 ms 38516 KB Output is correct
44 Correct 103 ms 38528 KB Output is correct
45 Correct 101 ms 38636 KB Output is correct
46 Correct 102 ms 38620 KB Output is correct
47 Correct 16 ms 37844 KB Output is correct
48 Correct 17 ms 37828 KB Output is correct
49 Correct 19 ms 37936 KB Output is correct
50 Correct 406 ms 116112 KB Output is correct
51 Correct 399 ms 116396 KB Output is correct
52 Correct 405 ms 116104 KB Output is correct
53 Correct 397 ms 116368 KB Output is correct
54 Correct 412 ms 116380 KB Output is correct
55 Correct 401 ms 116788 KB Output is correct
56 Correct 421 ms 116636 KB Output is correct
57 Correct 414 ms 116916 KB Output is correct
58 Correct 379 ms 115964 KB Output is correct
59 Correct 399 ms 116124 KB Output is correct
60 Correct 373 ms 116152 KB Output is correct
61 Correct 1006 ms 115688 KB Output is correct
62 Correct 183 ms 38148 KB Output is correct
63 Correct 189 ms 38100 KB Output is correct
64 Correct 189 ms 38152 KB Output is correct
65 Correct 194 ms 38152 KB Output is correct
66 Correct 197 ms 38144 KB Output is correct
67 Correct 206 ms 38152 KB Output is correct
68 Correct 18 ms 37852 KB Output is correct
69 Correct 18 ms 37972 KB Output is correct
70 Correct 20 ms 37872 KB Output is correct
71 Correct 944 ms 121920 KB Output is correct
72 Correct 960 ms 125224 KB Output is correct
73 Correct 940 ms 121916 KB Output is correct
74 Correct 935 ms 121920 KB Output is correct
75 Correct 1047 ms 125132 KB Output is correct
76 Correct 964 ms 125308 KB Output is correct
77 Correct 1004 ms 125296 KB Output is correct
78 Correct 1029 ms 125516 KB Output is correct
79 Correct 977 ms 125220 KB Output is correct
80 Correct 968 ms 125208 KB Output is correct
81 Correct 964 ms 125164 KB Output is correct
82 Correct 1304 ms 115876 KB Output is correct
83 Correct 202 ms 38216 KB Output is correct
84 Correct 194 ms 38216 KB Output is correct
85 Correct 195 ms 38256 KB Output is correct
86 Correct 202 ms 38260 KB Output is correct
87 Correct 204 ms 38252 KB Output is correct
88 Correct 200 ms 38200 KB Output is correct
89 Correct 17 ms 37844 KB Output is correct
90 Correct 18 ms 37896 KB Output is correct
91 Correct 17 ms 37972 KB Output is correct
92 Correct 1281 ms 122008 KB Output is correct
93 Correct 1266 ms 124636 KB Output is correct
94 Correct 1280 ms 121864 KB Output is correct
95 Correct 1327 ms 121800 KB Output is correct
96 Correct 936 ms 121708 KB Output is correct
97 Correct 990 ms 121860 KB Output is correct
98 Correct 935 ms 121756 KB Output is correct
99 Correct 1384 ms 124644 KB Output is correct
100 Correct 1317 ms 125048 KB Output is correct
101 Correct 1380 ms 124804 KB Output is correct
102 Correct 1341 ms 124744 KB Output is correct
103 Correct 1329 ms 124716 KB Output is correct
104 Correct 1330 ms 124820 KB Output is correct
105 Correct 1303 ms 124740 KB Output is correct
106 Correct 1714 ms 125700 KB Output is correct
107 Correct 265 ms 41304 KB Output is correct
108 Correct 278 ms 41496 KB Output is correct
109 Correct 268 ms 41336 KB Output is correct
110 Correct 19 ms 37916 KB Output is correct
111 Correct 18 ms 37972 KB Output is correct
112 Correct 19 ms 37952 KB Output is correct
113 Correct 1379 ms 124732 KB Output is correct
114 Correct 1306 ms 124856 KB Output is correct
115 Correct 1325 ms 124616 KB Output is correct
116 Correct 1263 ms 124748 KB Output is correct
117 Correct 1644 ms 125724 KB Output is correct
118 Correct 1268 ms 124704 KB Output is correct
119 Correct 1254 ms 124728 KB Output is correct
120 Correct 418 ms 123184 KB Output is correct
121 Correct 406 ms 123056 KB Output is correct
122 Correct 416 ms 123408 KB Output is correct
123 Correct 365 ms 122316 KB Output is correct
124 Correct 373 ms 122416 KB Output is correct
125 Correct 369 ms 122464 KB Output is correct
126 Correct 1631 ms 122316 KB Output is correct
127 Correct 1633 ms 122324 KB Output is correct
128 Correct 1667 ms 125664 KB Output is correct
129 Correct 1602 ms 122456 KB Output is correct
130 Correct 1012 ms 122296 KB Output is correct
131 Correct 1018 ms 122568 KB Output is correct
132 Correct 1006 ms 122372 KB Output is correct
133 Correct 1638 ms 125716 KB Output is correct
134 Correct 1657 ms 125672 KB Output is correct
135 Correct 1653 ms 125636 KB Output is correct
136 Correct 262 ms 41292 KB Output is correct
137 Correct 260 ms 41328 KB Output is correct
138 Correct 262 ms 41320 KB Output is correct