답안 #937682

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
937682 2024-03-04T10:40:02 Z nguyentunglam 푸드 코트 (JOI21_foodcourt) C++17
100 / 100
479 ms 47324 KB
#include<bits/stdc++.h>
#define all(v) v.begin(), v.end()
#define endl "\n"
using namespace std;

const int N = 250000 + 10;

int n, m, q;

int ans[N];

vector<tuple<int, int, int, int> > query;

vector<pair<long long, long long> > ask[N];

struct IT1 {
  long long sum[N << 2], pref_sum[N << 2];
  void push(int s, int l, int r) {
    if (!sum[s] && !pref_sum[s]) return;
    if (l == r) return;
    pref_sum[s << 1] = min(pref_sum[s << 1], sum[s << 1] + pref_sum[s]);
    sum[s << 1] += sum[s];
    pref_sum[s << 1 | 1] = min(pref_sum[s << 1 | 1], sum[s << 1 | 1] + pref_sum[s]);
    sum[s << 1 | 1] += sum[s];
    sum[s] = pref_sum[s] = 0;
  }
  void up(int s, int l, int r, int from, int to, long long val) {
    push(s, l, r);
    if (l > to || r < from) return;
    if (from <= l && r <= to) {
      pref_sum[s] = min(pref_sum[s], sum[s] + val);
      sum[s] += val;
      return;
    }
    int mid = l + r >> 1;
    up(s << 1, l, mid, from, to, val);
    up(s << 1 | 1, mid + 1, r, from, to, val);
  }

  pair<long long, long long> get(int s, int l, int r, int pos) {
    push(s, l, r);
    if (l == r) return make_pair(sum[s], pref_sum[s]);
    int mid = l + r >> 1;
    if (pos <= mid) return get(s << 1, l, mid, pos);
    return get(s << 1 | 1, mid + 1, r, pos);
  }
} it1, it2;

struct IT2 {
  long long lazy[N << 2], T[N << 2];

  void push(int s, int l, int r) {
    if (lazy[s] == 0) return;
    T[s] += lazy[s];
    if (l != r) {
      lazy[s << 1] += lazy[s];
      lazy[s << 1 | 1] += lazy[s];
    }
    lazy[s] = 0;
  }

  void up(int s, int l, int r, int from, int to, long long val) {
    push(s, l, r);
    if (l > to || r < from) return;
    if (from <= l && r <= to) {
      lazy[s] = val;
      push(s, l, r);
      return;
    }
    int mid = l + r >> 1;
    up(s << 1, l, mid, from, to, val);
    up(s << 1 | 1, mid + 1, r, from, to, val);
    T[s] = max(T[s << 1], T[s << 1 | 1]);
  }

  int get(int s, int l, int r) {
    push(s, l, r);
    if (l == r) return l;
    int mid = l + r >> 1;
    push(s << 1, l, mid);
    if (T[s << 1] == T[s]) return get(s << 1, l, mid);
    return get(s << 1 | 1, mid + 1, r);
  }
} it3;

int32_t main() {
  #define task ""

  cin.tie(0) -> sync_with_stdio(0);

  if (fopen("task.inp", "r")) {
    freopen("task.inp", "r", stdin);
    freopen("task.out", "w", stdout);
  }

  if (fopen(task".inp", "r")) {
    freopen (task".inp", "r", stdin);
    freopen (task".out", "w", stdout);
  }

  cin >> n >> m >> q;

  for(int i = 1; i <= q; i++) {
    int t; cin >> t;
    if (t == 1) {
      int l, r, c, k; cin >> l >> r >> c >> k;
      query.emplace_back(l, r, c, k);
      it1.up(1, 1, n, l, r, k);
      it2.up(1, 1, n, l, r, k);
    }
    if (t == 2) {
      int l, r, k; cin >> l >> r >> k;
      it1.up(1, 1, n, l, r, -k);
    }
    if (t == 3) {
      int a; long long b; cin >> a >> b;
      ans[i] = -1;
      pair<long long, long long> tmp = it1.get(1, 1, n, a);
      long long cur = tmp.first - tmp.second;
      if (cur < b) continue;
      long long total = it2.get(1, 1, n, a).first;
      long long idx = total - cur + b;
      ask[a].emplace_back(idx, i);
//      cout << i << endl;
    }
  }

//  it3.up(1, 1, n, 3, 3, 1);
  for(int i = 1; i <= n; i++) {
    if (ask[i].empty()) {
      it3.up(1, 1, n, i, i, -1e16);
    }
    else {
      sort(all(ask[i]));
      reverse(all(ask[i]));
      it3.up(1, 1, n, i, i, -ask[i].back().first);
    }
  }
//  exit(0);

  int group;

  auto handle = [&] (int pos) {
    long long old = ask[pos].back().first;
    ans[ask[pos].back().second] = group;
    ask[pos].pop_back();
    if (ask[pos].empty()) {
      it3.up(1, 1, n, pos, pos, -1e16);
    }
    else {
      it3.up(1, 1, n, pos, pos, -ask[pos].back().first + old);
    }
  };

  for(auto &[l, r, c, k] : query) {
    group = c;
    it3.up(1, 1, n, l, r, k);
    while (it3.T[1] >= 0) {
      int pos = it3.get(1, 1, n);
      handle(pos);
    }
  }

  for(int i = 1; i <= q; i++) if (ans[i]) {
    cout << max(ans[i], 0) << endl;
  }
}

Compilation message

foodcourt.cpp: In member function 'void IT1::up(int, int, int, int, int, long long int)':
foodcourt.cpp:35:17: warning: suggest parentheses around '+' inside '>>' [-Wparentheses]
   35 |     int mid = l + r >> 1;
      |               ~~^~~
foodcourt.cpp: In member function 'std::pair<long long int, long long int> IT1::get(int, int, int, int)':
foodcourt.cpp:43:17: warning: suggest parentheses around '+' inside '>>' [-Wparentheses]
   43 |     int mid = l + r >> 1;
      |               ~~^~~
foodcourt.cpp: In member function 'void IT2::up(int, int, int, int, int, long long int)':
foodcourt.cpp:70:17: warning: suggest parentheses around '+' inside '>>' [-Wparentheses]
   70 |     int mid = l + r >> 1;
      |               ~~^~~
foodcourt.cpp: In member function 'int IT2::get(int, int, int)':
foodcourt.cpp:79:17: warning: suggest parentheses around '+' inside '>>' [-Wparentheses]
   79 |     int mid = l + r >> 1;
      |               ~~^~~
foodcourt.cpp: In function 'int32_t main()':
foodcourt.cpp:92:12: warning: ignoring return value of 'FILE* freopen(const char*, const char*, FILE*)' declared with attribute 'warn_unused_result' [-Wunused-result]
   92 |     freopen("task.inp", "r", stdin);
      |     ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~
foodcourt.cpp:93:12: warning: ignoring return value of 'FILE* freopen(const char*, const char*, FILE*)' declared with attribute 'warn_unused_result' [-Wunused-result]
   93 |     freopen("task.out", "w", stdout);
      |     ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~
foodcourt.cpp:97:13: warning: ignoring return value of 'FILE* freopen(const char*, const char*, FILE*)' declared with attribute 'warn_unused_result' [-Wunused-result]
   97 |     freopen (task".inp", "r", stdin);
      |     ~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~
foodcourt.cpp:98:13: warning: ignoring return value of 'FILE* freopen(const char*, const char*, FILE*)' declared with attribute 'warn_unused_result' [-Wunused-result]
   98 |     freopen (task".out", "w", stdout);
      |     ~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~
# 결과 실행 시간 메모리 Grader output
1 Correct 4 ms 10844 KB Output is correct
2 Correct 4 ms 10936 KB Output is correct
3 Correct 4 ms 10844 KB Output is correct
4 Correct 5 ms 10992 KB Output is correct
5 Correct 2 ms 10588 KB Output is correct
6 Correct 2 ms 10588 KB Output is correct
7 Correct 4 ms 10844 KB Output is correct
8 Correct 4 ms 10844 KB Output is correct
9 Correct 4 ms 10844 KB Output is correct
10 Correct 5 ms 10992 KB Output is correct
11 Correct 4 ms 10844 KB Output is correct
12 Correct 4 ms 10944 KB Output is correct
13 Correct 4 ms 11100 KB Output is correct
14 Correct 3 ms 10988 KB Output is correct
15 Correct 3 ms 10844 KB Output is correct
16 Correct 5 ms 10844 KB Output is correct
17 Correct 4 ms 10844 KB Output is correct
18 Correct 4 ms 10844 KB Output is correct
19 Correct 4 ms 10844 KB Output is correct
20 Correct 4 ms 10844 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 4 ms 10844 KB Output is correct
2 Correct 4 ms 10936 KB Output is correct
3 Correct 4 ms 10844 KB Output is correct
4 Correct 5 ms 10992 KB Output is correct
5 Correct 2 ms 10588 KB Output is correct
6 Correct 2 ms 10588 KB Output is correct
7 Correct 4 ms 10844 KB Output is correct
8 Correct 4 ms 10844 KB Output is correct
9 Correct 4 ms 10844 KB Output is correct
10 Correct 5 ms 10992 KB Output is correct
11 Correct 4 ms 10844 KB Output is correct
12 Correct 4 ms 10944 KB Output is correct
13 Correct 4 ms 11100 KB Output is correct
14 Correct 3 ms 10988 KB Output is correct
15 Correct 3 ms 10844 KB Output is correct
16 Correct 5 ms 10844 KB Output is correct
17 Correct 4 ms 10844 KB Output is correct
18 Correct 4 ms 10844 KB Output is correct
19 Correct 4 ms 10844 KB Output is correct
20 Correct 4 ms 10844 KB Output is correct
21 Correct 4 ms 10840 KB Output is correct
22 Correct 4 ms 10848 KB Output is correct
23 Correct 4 ms 10844 KB Output is correct
24 Correct 4 ms 10844 KB Output is correct
25 Correct 2 ms 10584 KB Output is correct
26 Correct 3 ms 10680 KB Output is correct
27 Correct 4 ms 10856 KB Output is correct
28 Correct 5 ms 10856 KB Output is correct
29 Correct 4 ms 10856 KB Output is correct
30 Correct 5 ms 10848 KB Output is correct
31 Correct 4 ms 10964 KB Output is correct
32 Correct 4 ms 10844 KB Output is correct
33 Correct 4 ms 10844 KB Output is correct
34 Correct 3 ms 10844 KB Output is correct
35 Correct 3 ms 10844 KB Output is correct
36 Correct 5 ms 11100 KB Output is correct
37 Correct 3 ms 10932 KB Output is correct
38 Correct 4 ms 10844 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 58 ms 19404 KB Output is correct
2 Correct 64 ms 19628 KB Output is correct
3 Correct 66 ms 19436 KB Output is correct
4 Correct 59 ms 19316 KB Output is correct
5 Correct 68 ms 19432 KB Output is correct
6 Correct 66 ms 19600 KB Output is correct
7 Correct 16 ms 12004 KB Output is correct
8 Correct 17 ms 12100 KB Output is correct
9 Correct 60 ms 19392 KB Output is correct
10 Correct 60 ms 19408 KB Output is correct
11 Correct 60 ms 19408 KB Output is correct
12 Correct 60 ms 19400 KB Output is correct
13 Correct 57 ms 19452 KB Output is correct
14 Correct 63 ms 19404 KB Output is correct
15 Correct 67 ms 20176 KB Output is correct
16 Correct 71 ms 19788 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 360 ms 43708 KB Output is correct
2 Correct 299 ms 41924 KB Output is correct
3 Correct 404 ms 44848 KB Output is correct
4 Correct 368 ms 42292 KB Output is correct
5 Correct 311 ms 42260 KB Output is correct
6 Correct 453 ms 45112 KB Output is correct
7 Correct 67 ms 17592 KB Output is correct
8 Correct 75 ms 17928 KB Output is correct
9 Correct 473 ms 46536 KB Output is correct
10 Correct 465 ms 46304 KB Output is correct
11 Correct 406 ms 44492 KB Output is correct
12 Correct 417 ms 44464 KB Output is correct
13 Correct 400 ms 44540 KB Output is correct
14 Correct 427 ms 44532 KB Output is correct
15 Correct 417 ms 44344 KB Output is correct
16 Correct 391 ms 44492 KB Output is correct
17 Correct 414 ms 44600 KB Output is correct
18 Correct 426 ms 44468 KB Output is correct
19 Correct 404 ms 44824 KB Output is correct
20 Correct 411 ms 44444 KB Output is correct
21 Correct 420 ms 44532 KB Output is correct
22 Correct 420 ms 44440 KB Output is correct
23 Correct 402 ms 44352 KB Output is correct
24 Correct 444 ms 44432 KB Output is correct
25 Correct 318 ms 44092 KB Output is correct
26 Correct 335 ms 44532 KB Output is correct
27 Correct 305 ms 46016 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 4 ms 10844 KB Output is correct
2 Correct 4 ms 10936 KB Output is correct
3 Correct 4 ms 10844 KB Output is correct
4 Correct 5 ms 10992 KB Output is correct
5 Correct 2 ms 10588 KB Output is correct
6 Correct 2 ms 10588 KB Output is correct
7 Correct 4 ms 10844 KB Output is correct
8 Correct 4 ms 10844 KB Output is correct
9 Correct 4 ms 10844 KB Output is correct
10 Correct 5 ms 10992 KB Output is correct
11 Correct 4 ms 10844 KB Output is correct
12 Correct 4 ms 10944 KB Output is correct
13 Correct 4 ms 11100 KB Output is correct
14 Correct 3 ms 10988 KB Output is correct
15 Correct 3 ms 10844 KB Output is correct
16 Correct 5 ms 10844 KB Output is correct
17 Correct 4 ms 10844 KB Output is correct
18 Correct 4 ms 10844 KB Output is correct
19 Correct 4 ms 10844 KB Output is correct
20 Correct 4 ms 10844 KB Output is correct
21 Correct 58 ms 19404 KB Output is correct
22 Correct 64 ms 19628 KB Output is correct
23 Correct 66 ms 19436 KB Output is correct
24 Correct 59 ms 19316 KB Output is correct
25 Correct 68 ms 19432 KB Output is correct
26 Correct 66 ms 19600 KB Output is correct
27 Correct 16 ms 12004 KB Output is correct
28 Correct 17 ms 12100 KB Output is correct
29 Correct 60 ms 19392 KB Output is correct
30 Correct 60 ms 19408 KB Output is correct
31 Correct 60 ms 19408 KB Output is correct
32 Correct 60 ms 19400 KB Output is correct
33 Correct 57 ms 19452 KB Output is correct
34 Correct 63 ms 19404 KB Output is correct
35 Correct 67 ms 20176 KB Output is correct
36 Correct 71 ms 19788 KB Output is correct
37 Correct 74 ms 19400 KB Output is correct
38 Correct 92 ms 19340 KB Output is correct
39 Correct 13 ms 11860 KB Output is correct
40 Correct 16 ms 11948 KB Output is correct
41 Correct 80 ms 19732 KB Output is correct
42 Correct 81 ms 19792 KB Output is correct
43 Correct 96 ms 19716 KB Output is correct
44 Correct 80 ms 19764 KB Output is correct
45 Correct 80 ms 19764 KB Output is correct
46 Correct 81 ms 19636 KB Output is correct
47 Correct 47 ms 19864 KB Output is correct
48 Correct 74 ms 19612 KB Output is correct
49 Correct 59 ms 19032 KB Output is correct
50 Correct 82 ms 19268 KB Output is correct
51 Correct 81 ms 19748 KB Output is correct
52 Correct 82 ms 19752 KB Output is correct
53 Correct 62 ms 19608 KB Output is correct
54 Correct 72 ms 19920 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 84 ms 20428 KB Output is correct
2 Correct 89 ms 20932 KB Output is correct
3 Correct 95 ms 20936 KB Output is correct
4 Correct 75 ms 19916 KB Output is correct
5 Correct 84 ms 20428 KB Output is correct
6 Correct 97 ms 20848 KB Output is correct
7 Correct 19 ms 13044 KB Output is correct
8 Correct 19 ms 12976 KB Output is correct
9 Correct 58 ms 21016 KB Output is correct
10 Correct 65 ms 19904 KB Output is correct
11 Correct 86 ms 20692 KB Output is correct
12 Correct 85 ms 20680 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 4 ms 10844 KB Output is correct
2 Correct 4 ms 10936 KB Output is correct
3 Correct 4 ms 10844 KB Output is correct
4 Correct 5 ms 10992 KB Output is correct
5 Correct 2 ms 10588 KB Output is correct
6 Correct 2 ms 10588 KB Output is correct
7 Correct 4 ms 10844 KB Output is correct
8 Correct 4 ms 10844 KB Output is correct
9 Correct 4 ms 10844 KB Output is correct
10 Correct 5 ms 10992 KB Output is correct
11 Correct 4 ms 10844 KB Output is correct
12 Correct 4 ms 10944 KB Output is correct
13 Correct 4 ms 11100 KB Output is correct
14 Correct 3 ms 10988 KB Output is correct
15 Correct 3 ms 10844 KB Output is correct
16 Correct 5 ms 10844 KB Output is correct
17 Correct 4 ms 10844 KB Output is correct
18 Correct 4 ms 10844 KB Output is correct
19 Correct 4 ms 10844 KB Output is correct
20 Correct 4 ms 10844 KB Output is correct
21 Correct 4 ms 10840 KB Output is correct
22 Correct 4 ms 10848 KB Output is correct
23 Correct 4 ms 10844 KB Output is correct
24 Correct 4 ms 10844 KB Output is correct
25 Correct 2 ms 10584 KB Output is correct
26 Correct 3 ms 10680 KB Output is correct
27 Correct 4 ms 10856 KB Output is correct
28 Correct 5 ms 10856 KB Output is correct
29 Correct 4 ms 10856 KB Output is correct
30 Correct 5 ms 10848 KB Output is correct
31 Correct 4 ms 10964 KB Output is correct
32 Correct 4 ms 10844 KB Output is correct
33 Correct 4 ms 10844 KB Output is correct
34 Correct 3 ms 10844 KB Output is correct
35 Correct 3 ms 10844 KB Output is correct
36 Correct 5 ms 11100 KB Output is correct
37 Correct 3 ms 10932 KB Output is correct
38 Correct 4 ms 10844 KB Output is correct
39 Correct 58 ms 19404 KB Output is correct
40 Correct 64 ms 19628 KB Output is correct
41 Correct 66 ms 19436 KB Output is correct
42 Correct 59 ms 19316 KB Output is correct
43 Correct 68 ms 19432 KB Output is correct
44 Correct 66 ms 19600 KB Output is correct
45 Correct 16 ms 12004 KB Output is correct
46 Correct 17 ms 12100 KB Output is correct
47 Correct 60 ms 19392 KB Output is correct
48 Correct 60 ms 19408 KB Output is correct
49 Correct 60 ms 19408 KB Output is correct
50 Correct 60 ms 19400 KB Output is correct
51 Correct 57 ms 19452 KB Output is correct
52 Correct 63 ms 19404 KB Output is correct
53 Correct 67 ms 20176 KB Output is correct
54 Correct 71 ms 19788 KB Output is correct
55 Correct 74 ms 19400 KB Output is correct
56 Correct 92 ms 19340 KB Output is correct
57 Correct 13 ms 11860 KB Output is correct
58 Correct 16 ms 11948 KB Output is correct
59 Correct 80 ms 19732 KB Output is correct
60 Correct 81 ms 19792 KB Output is correct
61 Correct 96 ms 19716 KB Output is correct
62 Correct 80 ms 19764 KB Output is correct
63 Correct 80 ms 19764 KB Output is correct
64 Correct 81 ms 19636 KB Output is correct
65 Correct 47 ms 19864 KB Output is correct
66 Correct 74 ms 19612 KB Output is correct
67 Correct 59 ms 19032 KB Output is correct
68 Correct 82 ms 19268 KB Output is correct
69 Correct 81 ms 19748 KB Output is correct
70 Correct 82 ms 19752 KB Output is correct
71 Correct 62 ms 19608 KB Output is correct
72 Correct 72 ms 19920 KB Output is correct
73 Correct 84 ms 20428 KB Output is correct
74 Correct 89 ms 20932 KB Output is correct
75 Correct 95 ms 20936 KB Output is correct
76 Correct 75 ms 19916 KB Output is correct
77 Correct 84 ms 20428 KB Output is correct
78 Correct 97 ms 20848 KB Output is correct
79 Correct 19 ms 13044 KB Output is correct
80 Correct 19 ms 12976 KB Output is correct
81 Correct 58 ms 21016 KB Output is correct
82 Correct 65 ms 19904 KB Output is correct
83 Correct 86 ms 20692 KB Output is correct
84 Correct 85 ms 20680 KB Output is correct
85 Correct 73 ms 19916 KB Output is correct
86 Correct 89 ms 20292 KB Output is correct
87 Correct 80 ms 20172 KB Output is correct
88 Correct 91 ms 20520 KB Output is correct
89 Correct 57 ms 19472 KB Output is correct
90 Correct 89 ms 20496 KB Output is correct
91 Correct 83 ms 19724 KB Output is correct
92 Correct 65 ms 19768 KB Output is correct
93 Correct 85 ms 20204 KB Output is correct
94 Correct 85 ms 20272 KB Output is correct
95 Correct 81 ms 20268 KB Output is correct
96 Correct 85 ms 20240 KB Output is correct
97 Correct 88 ms 20288 KB Output is correct
98 Correct 77 ms 19892 KB Output is correct
99 Correct 42 ms 20120 KB Output is correct
100 Correct 63 ms 19844 KB Output is correct
101 Correct 73 ms 20204 KB Output is correct
102 Correct 71 ms 20428 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 4 ms 10844 KB Output is correct
2 Correct 4 ms 10936 KB Output is correct
3 Correct 4 ms 10844 KB Output is correct
4 Correct 5 ms 10992 KB Output is correct
5 Correct 2 ms 10588 KB Output is correct
6 Correct 2 ms 10588 KB Output is correct
7 Correct 4 ms 10844 KB Output is correct
8 Correct 4 ms 10844 KB Output is correct
9 Correct 4 ms 10844 KB Output is correct
10 Correct 5 ms 10992 KB Output is correct
11 Correct 4 ms 10844 KB Output is correct
12 Correct 4 ms 10944 KB Output is correct
13 Correct 4 ms 11100 KB Output is correct
14 Correct 3 ms 10988 KB Output is correct
15 Correct 3 ms 10844 KB Output is correct
16 Correct 5 ms 10844 KB Output is correct
17 Correct 4 ms 10844 KB Output is correct
18 Correct 4 ms 10844 KB Output is correct
19 Correct 4 ms 10844 KB Output is correct
20 Correct 4 ms 10844 KB Output is correct
21 Correct 4 ms 10840 KB Output is correct
22 Correct 4 ms 10848 KB Output is correct
23 Correct 4 ms 10844 KB Output is correct
24 Correct 4 ms 10844 KB Output is correct
25 Correct 2 ms 10584 KB Output is correct
26 Correct 3 ms 10680 KB Output is correct
27 Correct 4 ms 10856 KB Output is correct
28 Correct 5 ms 10856 KB Output is correct
29 Correct 4 ms 10856 KB Output is correct
30 Correct 5 ms 10848 KB Output is correct
31 Correct 4 ms 10964 KB Output is correct
32 Correct 4 ms 10844 KB Output is correct
33 Correct 4 ms 10844 KB Output is correct
34 Correct 3 ms 10844 KB Output is correct
35 Correct 3 ms 10844 KB Output is correct
36 Correct 5 ms 11100 KB Output is correct
37 Correct 3 ms 10932 KB Output is correct
38 Correct 4 ms 10844 KB Output is correct
39 Correct 58 ms 19404 KB Output is correct
40 Correct 64 ms 19628 KB Output is correct
41 Correct 66 ms 19436 KB Output is correct
42 Correct 59 ms 19316 KB Output is correct
43 Correct 68 ms 19432 KB Output is correct
44 Correct 66 ms 19600 KB Output is correct
45 Correct 16 ms 12004 KB Output is correct
46 Correct 17 ms 12100 KB Output is correct
47 Correct 60 ms 19392 KB Output is correct
48 Correct 60 ms 19408 KB Output is correct
49 Correct 60 ms 19408 KB Output is correct
50 Correct 60 ms 19400 KB Output is correct
51 Correct 57 ms 19452 KB Output is correct
52 Correct 63 ms 19404 KB Output is correct
53 Correct 67 ms 20176 KB Output is correct
54 Correct 71 ms 19788 KB Output is correct
55 Correct 360 ms 43708 KB Output is correct
56 Correct 299 ms 41924 KB Output is correct
57 Correct 404 ms 44848 KB Output is correct
58 Correct 368 ms 42292 KB Output is correct
59 Correct 311 ms 42260 KB Output is correct
60 Correct 453 ms 45112 KB Output is correct
61 Correct 67 ms 17592 KB Output is correct
62 Correct 75 ms 17928 KB Output is correct
63 Correct 473 ms 46536 KB Output is correct
64 Correct 465 ms 46304 KB Output is correct
65 Correct 406 ms 44492 KB Output is correct
66 Correct 417 ms 44464 KB Output is correct
67 Correct 400 ms 44540 KB Output is correct
68 Correct 427 ms 44532 KB Output is correct
69 Correct 417 ms 44344 KB Output is correct
70 Correct 391 ms 44492 KB Output is correct
71 Correct 414 ms 44600 KB Output is correct
72 Correct 426 ms 44468 KB Output is correct
73 Correct 404 ms 44824 KB Output is correct
74 Correct 411 ms 44444 KB Output is correct
75 Correct 420 ms 44532 KB Output is correct
76 Correct 420 ms 44440 KB Output is correct
77 Correct 402 ms 44352 KB Output is correct
78 Correct 444 ms 44432 KB Output is correct
79 Correct 318 ms 44092 KB Output is correct
80 Correct 335 ms 44532 KB Output is correct
81 Correct 305 ms 46016 KB Output is correct
82 Correct 74 ms 19400 KB Output is correct
83 Correct 92 ms 19340 KB Output is correct
84 Correct 13 ms 11860 KB Output is correct
85 Correct 16 ms 11948 KB Output is correct
86 Correct 80 ms 19732 KB Output is correct
87 Correct 81 ms 19792 KB Output is correct
88 Correct 96 ms 19716 KB Output is correct
89 Correct 80 ms 19764 KB Output is correct
90 Correct 80 ms 19764 KB Output is correct
91 Correct 81 ms 19636 KB Output is correct
92 Correct 47 ms 19864 KB Output is correct
93 Correct 74 ms 19612 KB Output is correct
94 Correct 59 ms 19032 KB Output is correct
95 Correct 82 ms 19268 KB Output is correct
96 Correct 81 ms 19748 KB Output is correct
97 Correct 82 ms 19752 KB Output is correct
98 Correct 62 ms 19608 KB Output is correct
99 Correct 72 ms 19920 KB Output is correct
100 Correct 84 ms 20428 KB Output is correct
101 Correct 89 ms 20932 KB Output is correct
102 Correct 95 ms 20936 KB Output is correct
103 Correct 75 ms 19916 KB Output is correct
104 Correct 84 ms 20428 KB Output is correct
105 Correct 97 ms 20848 KB Output is correct
106 Correct 19 ms 13044 KB Output is correct
107 Correct 19 ms 12976 KB Output is correct
108 Correct 58 ms 21016 KB Output is correct
109 Correct 65 ms 19904 KB Output is correct
110 Correct 86 ms 20692 KB Output is correct
111 Correct 85 ms 20680 KB Output is correct
112 Correct 73 ms 19916 KB Output is correct
113 Correct 89 ms 20292 KB Output is correct
114 Correct 80 ms 20172 KB Output is correct
115 Correct 91 ms 20520 KB Output is correct
116 Correct 57 ms 19472 KB Output is correct
117 Correct 89 ms 20496 KB Output is correct
118 Correct 83 ms 19724 KB Output is correct
119 Correct 65 ms 19768 KB Output is correct
120 Correct 85 ms 20204 KB Output is correct
121 Correct 85 ms 20272 KB Output is correct
122 Correct 81 ms 20268 KB Output is correct
123 Correct 85 ms 20240 KB Output is correct
124 Correct 88 ms 20288 KB Output is correct
125 Correct 77 ms 19892 KB Output is correct
126 Correct 42 ms 20120 KB Output is correct
127 Correct 63 ms 19844 KB Output is correct
128 Correct 73 ms 20204 KB Output is correct
129 Correct 71 ms 20428 KB Output is correct
130 Correct 403 ms 45252 KB Output is correct
131 Correct 291 ms 42336 KB Output is correct
132 Correct 400 ms 45544 KB Output is correct
133 Correct 457 ms 45364 KB Output is correct
134 Correct 418 ms 44612 KB Output is correct
135 Correct 465 ms 46000 KB Output is correct
136 Correct 479 ms 47036 KB Output is correct
137 Correct 465 ms 47324 KB Output is correct
138 Correct 407 ms 45056 KB Output is correct
139 Correct 407 ms 45256 KB Output is correct
140 Correct 409 ms 45104 KB Output is correct
141 Correct 394 ms 45040 KB Output is correct
142 Correct 417 ms 45096 KB Output is correct
143 Correct 418 ms 45092 KB Output is correct
144 Correct 417 ms 45216 KB Output is correct
145 Correct 448 ms 45168 KB Output is correct
146 Correct 403 ms 45096 KB Output is correct
147 Correct 408 ms 45044 KB Output is correct
148 Correct 407 ms 45104 KB Output is correct
149 Correct 394 ms 45628 KB Output is correct
150 Correct 188 ms 44492 KB Output is correct
151 Correct 334 ms 44936 KB Output is correct
152 Correct 342 ms 44992 KB Output is correct
153 Correct 310 ms 46608 KB Output is correct