답안 #960514

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
960514 2024-04-10T14:50:49 Z Prieved1 봉쇄 시간 (IOI23_closing) C++17
100 / 100
265 ms 43156 KB
#include "closing.h"
#include<bits/stdc++.h>
#include<vector>
#include<queue>
#include<cstring>
#include<set>
using namespace std;
const int MAXN=200010;
vector<pair<int,int>> g[MAXN];
long long distX[MAXN], distY[MAXN];
int dd[MAXN];
vector<int> path;
long long dist=0;
void dfsx(int at, int p) {
  for(auto [to,w]:g[at]) {
    if(to==p)continue;
    distX[to]=distX[at]+w;
    dfsx(to, at);
  }
}
void dfsy(int at, int p) {
  for(auto [to,w]:g[at]) {
    if(to==p)continue;
    distY[to]=distY[at]+w;
    dfsy(to, at);
    if(dd[to])dist+=w;
    dd[at]|=dd[to];
  }
  if(dd[at])path.push_back(at);
}
int max_score(int N, int X, int Y, long long K,
              std::vector<int> U, std::vector<int> V, std::vector<int> W)
{
  for(int i = 0;i<N-1;i++) {
    g[U[i]].push_back({V[i], W[i]});
    g[V[i]].push_back({U[i], W[i]});
  }
  dist=0;
  dd[X]=1;
  dfsx(X, -1);
  dfsy(Y, -1);
  int ans=0;
  // case 1
  {
    int cnt=0;
    priority_queue<long long> pq;
    for(int i = 0;i<N;i++) {
      pq.push(-distX[i]);
      pq.push(-distY[i]);
    }
    long long sum=0;
    while(sum<=K and pq.size()) {
      sum-=pq.top();
      cnt++;
      pq.pop();
      if(sum<=K)ans=max(ans,cnt);
    }
  }
  // case 2
  {
    for(int i = 0;i<N;i++) {
      if(distX[i]>distY[i])swap(distX[i], distY[i]);
      distY[i]-=distX[i];
    }
    int upd[N];
    memset(upd, 0, sizeof upd);
    long long sum=0;
    int cnt=0;
    priority_queue<long long> pq1;
    priority_queue<pair<long long,int>> pq2;
    multiset<long long> ms;
    for(int i:path) {
      sum+=distX[i];
      pq1.push(-distY[i]);
      cnt++;
      upd[i]++;
    }
    for(int i = 0;i<N;i++) {
      if(upd[i])continue;
      if(distX[i]>distY[i]) {
        pq2.push({-(distY[i]+distX[i]), i});
        ms.insert(distX[i]);
      }
      else {
        pq1.push(-distX[i]);
        pq1.push(-distY[i]);
      }
    }
    if(sum<=K)ans=max(ans, cnt);
    if(pq1.size() and sum-pq1.top()<=K)ans=max(ans, cnt+1);
    if(ms.size() and sum+(*ms.begin())<=K)ans=max(ans, cnt+1);
    if(pq1.size() and ms.size() and sum-pq1.top()+(*ms.begin())<=K)ans=max(ans, cnt+2);
    while(pq1.size() or pq2.size()) {
      if(pq1.size()>=2 and pq2.size()) {
        long long tmp=pq1.top();
        pq1.pop();
        if(-tmp-pq1.top()>=-pq2.top().first) {
          sum-=pq2.top().first;
          ms.erase(ms.find(distX[pq2.top().second]));
          cnt+=2;
          pq2.pop();
          pq1.push(tmp);
        }
        else {
          sum-=tmp;
          cnt++;
        }
      }
      else if(pq1.size()<=1 and pq2.size()) {
        sum-=pq2.top().first;
        ms.erase(ms.find(distX[pq2.top().second]));
        cnt+=2;
        pq2.pop();
      }
      else if(pq2.size()==0 and pq1.size()) {
        sum-=pq1.top();
        pq1.pop();
        cnt++;
      }
      if(sum<=K)ans=max(ans, cnt);
      if(pq1.size() and sum-pq1.top()<=K)ans=max(ans, cnt+1);
      if(ms.size() and sum+(*ms.begin())<=K)ans=max(ans, cnt+1);
      if(pq1.size() and ms.size() and sum-pq1.top()+(*ms.begin())<=K)ans=max(ans, cnt+2);
    }
  }
  for(int i = 0;i<=N;i++) {
    dd[i]=0;
    distX[i]=distY[i]=0;
    g[i].clear();
  }
  path.clear();
  return ans;
}

# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 6748 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 145 ms 35012 KB Output is correct
2 Correct 146 ms 40884 KB Output is correct
3 Correct 82 ms 12136 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 6744 KB Output is correct
2 Correct 2 ms 6744 KB Output is correct
3 Correct 2 ms 6836 KB Output is correct
4 Correct 2 ms 6748 KB Output is correct
5 Correct 1 ms 6748 KB Output is correct
6 Correct 1 ms 6748 KB Output is correct
7 Correct 1 ms 6748 KB Output is correct
8 Correct 2 ms 6744 KB Output is correct
9 Correct 2 ms 6748 KB Output is correct
10 Correct 1 ms 6748 KB Output is correct
11 Correct 1 ms 6748 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 6744 KB Output is correct
2 Correct 2 ms 6744 KB Output is correct
3 Correct 2 ms 6836 KB Output is correct
4 Correct 2 ms 6748 KB Output is correct
5 Correct 1 ms 6748 KB Output is correct
6 Correct 1 ms 6748 KB Output is correct
7 Correct 1 ms 6748 KB Output is correct
8 Correct 2 ms 6744 KB Output is correct
9 Correct 2 ms 6748 KB Output is correct
10 Correct 1 ms 6748 KB Output is correct
11 Correct 1 ms 6748 KB Output is correct
12 Correct 2 ms 6744 KB Output is correct
13 Correct 2 ms 6748 KB Output is correct
14 Correct 2 ms 6744 KB Output is correct
15 Correct 2 ms 6748 KB Output is correct
16 Correct 2 ms 6748 KB Output is correct
17 Correct 2 ms 6748 KB Output is correct
18 Correct 2 ms 6744 KB Output is correct
19 Correct 2 ms 6748 KB Output is correct
20 Correct 2 ms 6748 KB Output is correct
21 Correct 2 ms 6844 KB Output is correct
22 Correct 2 ms 6748 KB Output is correct
23 Correct 2 ms 6748 KB Output is correct
24 Correct 2 ms 6748 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 6744 KB Output is correct
2 Correct 2 ms 6744 KB Output is correct
3 Correct 2 ms 6836 KB Output is correct
4 Correct 2 ms 6748 KB Output is correct
5 Correct 1 ms 6748 KB Output is correct
6 Correct 1 ms 6748 KB Output is correct
7 Correct 1 ms 6748 KB Output is correct
8 Correct 2 ms 6744 KB Output is correct
9 Correct 2 ms 6748 KB Output is correct
10 Correct 1 ms 6748 KB Output is correct
11 Correct 1 ms 6748 KB Output is correct
12 Correct 2 ms 6744 KB Output is correct
13 Correct 2 ms 6748 KB Output is correct
14 Correct 2 ms 6744 KB Output is correct
15 Correct 2 ms 6748 KB Output is correct
16 Correct 2 ms 6748 KB Output is correct
17 Correct 2 ms 6748 KB Output is correct
18 Correct 2 ms 6744 KB Output is correct
19 Correct 2 ms 6748 KB Output is correct
20 Correct 2 ms 6748 KB Output is correct
21 Correct 2 ms 6844 KB Output is correct
22 Correct 2 ms 6748 KB Output is correct
23 Correct 2 ms 6748 KB Output is correct
24 Correct 2 ms 6748 KB Output is correct
25 Correct 3 ms 6748 KB Output is correct
26 Correct 3 ms 7260 KB Output is correct
27 Correct 3 ms 7260 KB Output is correct
28 Correct 3 ms 7364 KB Output is correct
29 Correct 4 ms 7260 KB Output is correct
30 Correct 3 ms 7260 KB Output is correct
31 Correct 3 ms 7260 KB Output is correct
32 Correct 4 ms 7260 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 6748 KB Output is correct
2 Correct 2 ms 6744 KB Output is correct
3 Correct 2 ms 6744 KB Output is correct
4 Correct 2 ms 6836 KB Output is correct
5 Correct 2 ms 6748 KB Output is correct
6 Correct 1 ms 6748 KB Output is correct
7 Correct 2 ms 6744 KB Output is correct
8 Correct 1 ms 6744 KB Output is correct
9 Correct 2 ms 6744 KB Output is correct
10 Correct 2 ms 6748 KB Output is correct
11 Correct 1 ms 6748 KB Output is correct
12 Correct 2 ms 6748 KB Output is correct
13 Correct 2 ms 6748 KB Output is correct
14 Correct 1 ms 6748 KB Output is correct
15 Correct 3 ms 6836 KB Output is correct
16 Correct 2 ms 6636 KB Output is correct
17 Correct 1 ms 6748 KB Output is correct
18 Correct 2 ms 6748 KB Output is correct
19 Correct 2 ms 6836 KB Output is correct
20 Correct 2 ms 6748 KB Output is correct
21 Correct 2 ms 6748 KB Output is correct
22 Correct 2 ms 6748 KB Output is correct
23 Correct 2 ms 6748 KB Output is correct
24 Correct 2 ms 6748 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 6748 KB Output is correct
2 Correct 2 ms 6744 KB Output is correct
3 Correct 2 ms 6744 KB Output is correct
4 Correct 2 ms 6836 KB Output is correct
5 Correct 2 ms 6748 KB Output is correct
6 Correct 1 ms 6748 KB Output is correct
7 Correct 1 ms 6748 KB Output is correct
8 Correct 1 ms 6748 KB Output is correct
9 Correct 2 ms 6744 KB Output is correct
10 Correct 2 ms 6748 KB Output is correct
11 Correct 1 ms 6748 KB Output is correct
12 Correct 1 ms 6748 KB Output is correct
13 Correct 2 ms 6744 KB Output is correct
14 Correct 2 ms 6748 KB Output is correct
15 Correct 2 ms 6744 KB Output is correct
16 Correct 2 ms 6748 KB Output is correct
17 Correct 2 ms 6748 KB Output is correct
18 Correct 2 ms 6748 KB Output is correct
19 Correct 2 ms 6744 KB Output is correct
20 Correct 1 ms 6744 KB Output is correct
21 Correct 2 ms 6744 KB Output is correct
22 Correct 2 ms 6748 KB Output is correct
23 Correct 1 ms 6748 KB Output is correct
24 Correct 2 ms 6748 KB Output is correct
25 Correct 2 ms 6748 KB Output is correct
26 Correct 1 ms 6748 KB Output is correct
27 Correct 3 ms 6836 KB Output is correct
28 Correct 2 ms 6636 KB Output is correct
29 Correct 1 ms 6748 KB Output is correct
30 Correct 2 ms 6748 KB Output is correct
31 Correct 2 ms 6836 KB Output is correct
32 Correct 2 ms 6748 KB Output is correct
33 Correct 2 ms 6748 KB Output is correct
34 Correct 2 ms 6748 KB Output is correct
35 Correct 2 ms 6748 KB Output is correct
36 Correct 2 ms 6748 KB Output is correct
37 Correct 2 ms 6744 KB Output is correct
38 Correct 2 ms 6748 KB Output is correct
39 Correct 2 ms 6748 KB Output is correct
40 Correct 2 ms 6748 KB Output is correct
41 Correct 1 ms 6748 KB Output is correct
42 Correct 2 ms 6748 KB Output is correct
43 Correct 2 ms 6748 KB Output is correct
44 Correct 3 ms 6748 KB Output is correct
45 Correct 2 ms 6840 KB Output is correct
46 Correct 2 ms 6744 KB Output is correct
47 Correct 2 ms 6748 KB Output is correct
48 Correct 2 ms 6748 KB Output is correct
49 Correct 2 ms 6748 KB Output is correct
50 Correct 2 ms 6748 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 6748 KB Output is correct
2 Correct 2 ms 6744 KB Output is correct
3 Correct 2 ms 6744 KB Output is correct
4 Correct 2 ms 6836 KB Output is correct
5 Correct 2 ms 6748 KB Output is correct
6 Correct 1 ms 6748 KB Output is correct
7 Correct 1 ms 6748 KB Output is correct
8 Correct 1 ms 6748 KB Output is correct
9 Correct 2 ms 6744 KB Output is correct
10 Correct 2 ms 6748 KB Output is correct
11 Correct 1 ms 6748 KB Output is correct
12 Correct 1 ms 6748 KB Output is correct
13 Correct 2 ms 6744 KB Output is correct
14 Correct 2 ms 6748 KB Output is correct
15 Correct 2 ms 6744 KB Output is correct
16 Correct 2 ms 6748 KB Output is correct
17 Correct 2 ms 6748 KB Output is correct
18 Correct 2 ms 6748 KB Output is correct
19 Correct 2 ms 6744 KB Output is correct
20 Correct 2 ms 6748 KB Output is correct
21 Correct 2 ms 6748 KB Output is correct
22 Correct 2 ms 6844 KB Output is correct
23 Correct 2 ms 6748 KB Output is correct
24 Correct 2 ms 6748 KB Output is correct
25 Correct 2 ms 6748 KB Output is correct
26 Correct 2 ms 6744 KB Output is correct
27 Correct 1 ms 6744 KB Output is correct
28 Correct 2 ms 6744 KB Output is correct
29 Correct 2 ms 6748 KB Output is correct
30 Correct 1 ms 6748 KB Output is correct
31 Correct 2 ms 6748 KB Output is correct
32 Correct 2 ms 6748 KB Output is correct
33 Correct 1 ms 6748 KB Output is correct
34 Correct 3 ms 6836 KB Output is correct
35 Correct 2 ms 6636 KB Output is correct
36 Correct 1 ms 6748 KB Output is correct
37 Correct 2 ms 6748 KB Output is correct
38 Correct 2 ms 6836 KB Output is correct
39 Correct 2 ms 6748 KB Output is correct
40 Correct 2 ms 6748 KB Output is correct
41 Correct 2 ms 6748 KB Output is correct
42 Correct 2 ms 6748 KB Output is correct
43 Correct 2 ms 6748 KB Output is correct
44 Correct 2 ms 6744 KB Output is correct
45 Correct 2 ms 6748 KB Output is correct
46 Correct 2 ms 6748 KB Output is correct
47 Correct 2 ms 6748 KB Output is correct
48 Correct 1 ms 6748 KB Output is correct
49 Correct 2 ms 6748 KB Output is correct
50 Correct 2 ms 6748 KB Output is correct
51 Correct 3 ms 6748 KB Output is correct
52 Correct 2 ms 6840 KB Output is correct
53 Correct 2 ms 6744 KB Output is correct
54 Correct 2 ms 6748 KB Output is correct
55 Correct 2 ms 6748 KB Output is correct
56 Correct 2 ms 6748 KB Output is correct
57 Correct 2 ms 6748 KB Output is correct
58 Correct 2 ms 6748 KB Output is correct
59 Correct 2 ms 6748 KB Output is correct
60 Correct 2 ms 6840 KB Output is correct
61 Correct 3 ms 6748 KB Output is correct
62 Correct 2 ms 6748 KB Output is correct
63 Correct 2 ms 6748 KB Output is correct
64 Correct 2 ms 6748 KB Output is correct
65 Correct 2 ms 6748 KB Output is correct
66 Correct 2 ms 6748 KB Output is correct
67 Correct 2 ms 6744 KB Output is correct
68 Correct 2 ms 6748 KB Output is correct
69 Correct 3 ms 6748 KB Output is correct
70 Correct 2 ms 6748 KB Output is correct
71 Correct 3 ms 7004 KB Output is correct
72 Correct 2 ms 6748 KB Output is correct
73 Correct 2 ms 7000 KB Output is correct
74 Correct 2 ms 6748 KB Output is correct
75 Correct 2 ms 6748 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 6748 KB Output is correct
2 Correct 2 ms 6744 KB Output is correct
3 Correct 2 ms 6744 KB Output is correct
4 Correct 2 ms 6836 KB Output is correct
5 Correct 2 ms 6748 KB Output is correct
6 Correct 1 ms 6748 KB Output is correct
7 Correct 1 ms 6748 KB Output is correct
8 Correct 1 ms 6748 KB Output is correct
9 Correct 2 ms 6744 KB Output is correct
10 Correct 2 ms 6748 KB Output is correct
11 Correct 1 ms 6748 KB Output is correct
12 Correct 1 ms 6748 KB Output is correct
13 Correct 2 ms 6744 KB Output is correct
14 Correct 2 ms 6748 KB Output is correct
15 Correct 2 ms 6744 KB Output is correct
16 Correct 2 ms 6748 KB Output is correct
17 Correct 2 ms 6748 KB Output is correct
18 Correct 2 ms 6748 KB Output is correct
19 Correct 2 ms 6744 KB Output is correct
20 Correct 2 ms 6748 KB Output is correct
21 Correct 2 ms 6748 KB Output is correct
22 Correct 2 ms 6844 KB Output is correct
23 Correct 2 ms 6748 KB Output is correct
24 Correct 2 ms 6748 KB Output is correct
25 Correct 2 ms 6748 KB Output is correct
26 Correct 3 ms 6748 KB Output is correct
27 Correct 3 ms 7260 KB Output is correct
28 Correct 3 ms 7260 KB Output is correct
29 Correct 3 ms 7364 KB Output is correct
30 Correct 4 ms 7260 KB Output is correct
31 Correct 3 ms 7260 KB Output is correct
32 Correct 3 ms 7260 KB Output is correct
33 Correct 4 ms 7260 KB Output is correct
34 Correct 2 ms 6744 KB Output is correct
35 Correct 1 ms 6744 KB Output is correct
36 Correct 2 ms 6744 KB Output is correct
37 Correct 2 ms 6748 KB Output is correct
38 Correct 1 ms 6748 KB Output is correct
39 Correct 2 ms 6748 KB Output is correct
40 Correct 2 ms 6748 KB Output is correct
41 Correct 1 ms 6748 KB Output is correct
42 Correct 3 ms 6836 KB Output is correct
43 Correct 2 ms 6636 KB Output is correct
44 Correct 1 ms 6748 KB Output is correct
45 Correct 2 ms 6748 KB Output is correct
46 Correct 2 ms 6836 KB Output is correct
47 Correct 2 ms 6748 KB Output is correct
48 Correct 2 ms 6748 KB Output is correct
49 Correct 2 ms 6748 KB Output is correct
50 Correct 2 ms 6748 KB Output is correct
51 Correct 2 ms 6748 KB Output is correct
52 Correct 2 ms 6744 KB Output is correct
53 Correct 2 ms 6748 KB Output is correct
54 Correct 2 ms 6748 KB Output is correct
55 Correct 2 ms 6748 KB Output is correct
56 Correct 1 ms 6748 KB Output is correct
57 Correct 2 ms 6748 KB Output is correct
58 Correct 2 ms 6748 KB Output is correct
59 Correct 3 ms 6748 KB Output is correct
60 Correct 2 ms 6840 KB Output is correct
61 Correct 2 ms 6744 KB Output is correct
62 Correct 2 ms 6748 KB Output is correct
63 Correct 2 ms 6748 KB Output is correct
64 Correct 2 ms 6748 KB Output is correct
65 Correct 2 ms 6748 KB Output is correct
66 Correct 2 ms 6748 KB Output is correct
67 Correct 2 ms 6748 KB Output is correct
68 Correct 2 ms 6840 KB Output is correct
69 Correct 3 ms 6748 KB Output is correct
70 Correct 2 ms 6748 KB Output is correct
71 Correct 2 ms 6748 KB Output is correct
72 Correct 2 ms 6748 KB Output is correct
73 Correct 2 ms 6748 KB Output is correct
74 Correct 2 ms 6748 KB Output is correct
75 Correct 2 ms 6744 KB Output is correct
76 Correct 2 ms 6748 KB Output is correct
77 Correct 3 ms 6748 KB Output is correct
78 Correct 2 ms 6748 KB Output is correct
79 Correct 3 ms 7004 KB Output is correct
80 Correct 2 ms 6748 KB Output is correct
81 Correct 2 ms 7000 KB Output is correct
82 Correct 2 ms 6748 KB Output is correct
83 Correct 2 ms 6748 KB Output is correct
84 Correct 3 ms 6744 KB Output is correct
85 Correct 3 ms 6748 KB Output is correct
86 Correct 3 ms 6748 KB Output is correct
87 Correct 3 ms 6748 KB Output is correct
88 Correct 3 ms 6748 KB Output is correct
89 Correct 4 ms 7260 KB Output is correct
90 Correct 4 ms 7260 KB Output is correct
91 Correct 4 ms 7176 KB Output is correct
92 Correct 3 ms 7260 KB Output is correct
93 Correct 3 ms 7260 KB Output is correct
94 Correct 3 ms 7260 KB Output is correct
95 Correct 3 ms 7260 KB Output is correct
96 Correct 3 ms 7256 KB Output is correct
97 Correct 3 ms 7256 KB Output is correct
98 Correct 4 ms 7256 KB Output is correct
99 Correct 4 ms 7260 KB Output is correct
100 Correct 5 ms 7004 KB Output is correct
101 Correct 3 ms 6748 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 6748 KB Output is correct
2 Correct 2 ms 6744 KB Output is correct
3 Correct 2 ms 6744 KB Output is correct
4 Correct 2 ms 6836 KB Output is correct
5 Correct 2 ms 6748 KB Output is correct
6 Correct 1 ms 6748 KB Output is correct
7 Correct 1 ms 6748 KB Output is correct
8 Correct 1 ms 6748 KB Output is correct
9 Correct 2 ms 6744 KB Output is correct
10 Correct 2 ms 6748 KB Output is correct
11 Correct 1 ms 6748 KB Output is correct
12 Correct 1 ms 6748 KB Output is correct
13 Correct 2 ms 6744 KB Output is correct
14 Correct 2 ms 6748 KB Output is correct
15 Correct 2 ms 6744 KB Output is correct
16 Correct 2 ms 6748 KB Output is correct
17 Correct 2 ms 6748 KB Output is correct
18 Correct 2 ms 6748 KB Output is correct
19 Correct 2 ms 6744 KB Output is correct
20 Correct 2 ms 6748 KB Output is correct
21 Correct 2 ms 6748 KB Output is correct
22 Correct 2 ms 6844 KB Output is correct
23 Correct 2 ms 6748 KB Output is correct
24 Correct 2 ms 6748 KB Output is correct
25 Correct 2 ms 6748 KB Output is correct
26 Correct 3 ms 6748 KB Output is correct
27 Correct 3 ms 7260 KB Output is correct
28 Correct 3 ms 7260 KB Output is correct
29 Correct 3 ms 7364 KB Output is correct
30 Correct 4 ms 7260 KB Output is correct
31 Correct 3 ms 7260 KB Output is correct
32 Correct 3 ms 7260 KB Output is correct
33 Correct 4 ms 7260 KB Output is correct
34 Correct 2 ms 6744 KB Output is correct
35 Correct 1 ms 6744 KB Output is correct
36 Correct 2 ms 6744 KB Output is correct
37 Correct 2 ms 6748 KB Output is correct
38 Correct 1 ms 6748 KB Output is correct
39 Correct 2 ms 6748 KB Output is correct
40 Correct 2 ms 6748 KB Output is correct
41 Correct 1 ms 6748 KB Output is correct
42 Correct 3 ms 6836 KB Output is correct
43 Correct 2 ms 6636 KB Output is correct
44 Correct 1 ms 6748 KB Output is correct
45 Correct 2 ms 6748 KB Output is correct
46 Correct 2 ms 6836 KB Output is correct
47 Correct 2 ms 6748 KB Output is correct
48 Correct 2 ms 6748 KB Output is correct
49 Correct 2 ms 6748 KB Output is correct
50 Correct 2 ms 6748 KB Output is correct
51 Correct 2 ms 6748 KB Output is correct
52 Correct 2 ms 6744 KB Output is correct
53 Correct 2 ms 6748 KB Output is correct
54 Correct 2 ms 6748 KB Output is correct
55 Correct 2 ms 6748 KB Output is correct
56 Correct 1 ms 6748 KB Output is correct
57 Correct 2 ms 6748 KB Output is correct
58 Correct 2 ms 6748 KB Output is correct
59 Correct 3 ms 6748 KB Output is correct
60 Correct 2 ms 6840 KB Output is correct
61 Correct 2 ms 6744 KB Output is correct
62 Correct 2 ms 6748 KB Output is correct
63 Correct 2 ms 6748 KB Output is correct
64 Correct 2 ms 6748 KB Output is correct
65 Correct 2 ms 6748 KB Output is correct
66 Correct 2 ms 6748 KB Output is correct
67 Correct 2 ms 6748 KB Output is correct
68 Correct 2 ms 6840 KB Output is correct
69 Correct 3 ms 6748 KB Output is correct
70 Correct 2 ms 6748 KB Output is correct
71 Correct 2 ms 6748 KB Output is correct
72 Correct 2 ms 6748 KB Output is correct
73 Correct 2 ms 6748 KB Output is correct
74 Correct 2 ms 6748 KB Output is correct
75 Correct 2 ms 6744 KB Output is correct
76 Correct 2 ms 6748 KB Output is correct
77 Correct 3 ms 6748 KB Output is correct
78 Correct 2 ms 6748 KB Output is correct
79 Correct 3 ms 7004 KB Output is correct
80 Correct 2 ms 6748 KB Output is correct
81 Correct 2 ms 7000 KB Output is correct
82 Correct 2 ms 6748 KB Output is correct
83 Correct 2 ms 6748 KB Output is correct
84 Correct 3 ms 6744 KB Output is correct
85 Correct 3 ms 6748 KB Output is correct
86 Correct 3 ms 6748 KB Output is correct
87 Correct 3 ms 6748 KB Output is correct
88 Correct 3 ms 6748 KB Output is correct
89 Correct 4 ms 7260 KB Output is correct
90 Correct 4 ms 7260 KB Output is correct
91 Correct 4 ms 7176 KB Output is correct
92 Correct 3 ms 7260 KB Output is correct
93 Correct 3 ms 7260 KB Output is correct
94 Correct 3 ms 7260 KB Output is correct
95 Correct 3 ms 7260 KB Output is correct
96 Correct 3 ms 7256 KB Output is correct
97 Correct 3 ms 7256 KB Output is correct
98 Correct 4 ms 7256 KB Output is correct
99 Correct 4 ms 7260 KB Output is correct
100 Correct 5 ms 7004 KB Output is correct
101 Correct 3 ms 6748 KB Output is correct
102 Correct 103 ms 11944 KB Output is correct
103 Correct 113 ms 12084 KB Output is correct
104 Correct 178 ms 39356 KB Output is correct
105 Correct 142 ms 13204 KB Output is correct
106 Correct 114 ms 13056 KB Output is correct
107 Correct 82 ms 29780 KB Output is correct
108 Correct 85 ms 30564 KB Output is correct
109 Correct 95 ms 39812 KB Output is correct
110 Correct 249 ms 38248 KB Output is correct
111 Correct 149 ms 43156 KB Output is correct
112 Correct 235 ms 37640 KB Output is correct
113 Correct 218 ms 37636 KB Output is correct
114 Correct 195 ms 37820 KB Output is correct
115 Correct 115 ms 43000 KB Output is correct
116 Correct 240 ms 40760 KB Output is correct
117 Correct 197 ms 36292 KB Output is correct
118 Correct 265 ms 38132 KB Output is correct
119 Correct 144 ms 16056 KB Output is correct
120 Correct 98 ms 11532 KB Output is correct