Submission #823964

# Submission time Handle Problem Language Result Execution time Memory
823964 2023-08-13T10:46:46 Z Kahou Meetings (JOI19_meetings) C++14
29 / 100
1657 ms 1060 KB
#include<bits/stdc++.h>
#include"meetings.h"
using namespace std;
#define F first
#define S second
#define endl '\n'
#define mk make_pair
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;

const int MAXN = 2050;
int n, sub[MAXN];
bool mark[MAXN][MAXN];

void Solve(int N) {
        n = N;
        sub[0] = n-1;
        for (int u = 1; u < n; u++) {
                mark[0][u] = 1;
        }
        for (int u = 1; u < n; u++) {
                for (int v = u+1; v < n; v++) {
                        int lca = Query(0, u, v);
                        if (lca == u) {
                                mark[u][v] = 1;
                                sub[u]++;
                        }
                        else if (lca == v) {
                                mark[v][u] = 1;
                                sub[v]++;
                        }
                }
        }
        for (int u = 1; u < n; u++) {
                int v = 0;
                for (int w = 0; w < n; w++) {
                        if (mark[w][u] && sub[w] < sub[v]) v = w;
                }
                Bridge(min(u, v), max(u, v));
        }
}
# Verdict Execution time Memory Grader output
1 Correct 0 ms 336 KB Output is correct
2 Correct 0 ms 336 KB Output is correct
3 Correct 0 ms 336 KB Output is correct
4 Correct 0 ms 336 KB Output is correct
5 Correct 1 ms 336 KB Output is correct
6 Correct 0 ms 336 KB Output is correct
7 Correct 0 ms 336 KB Output is correct
8 Correct 0 ms 336 KB Output is correct
9 Correct 0 ms 336 KB Output is correct
10 Correct 0 ms 336 KB Output is correct
11 Correct 0 ms 336 KB Output is correct
12 Correct 0 ms 336 KB Output is correct
13 Correct 0 ms 336 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 0 ms 336 KB Output is correct
2 Correct 0 ms 336 KB Output is correct
3 Correct 0 ms 336 KB Output is correct
4 Correct 0 ms 336 KB Output is correct
5 Correct 1 ms 336 KB Output is correct
6 Correct 0 ms 336 KB Output is correct
7 Correct 0 ms 336 KB Output is correct
8 Correct 0 ms 336 KB Output is correct
9 Correct 0 ms 336 KB Output is correct
10 Correct 0 ms 336 KB Output is correct
11 Correct 0 ms 336 KB Output is correct
12 Correct 0 ms 336 KB Output is correct
13 Correct 0 ms 336 KB Output is correct
14 Correct 1 ms 336 KB Output is correct
15 Correct 1 ms 336 KB Output is correct
16 Correct 1 ms 336 KB Output is correct
17 Correct 1 ms 336 KB Output is correct
18 Correct 1 ms 336 KB Output is correct
19 Correct 1 ms 336 KB Output is correct
20 Correct 1 ms 336 KB Output is correct
21 Correct 1 ms 336 KB Output is correct
22 Correct 1 ms 336 KB Output is correct
23 Correct 1 ms 464 KB Output is correct
24 Correct 1 ms 464 KB Output is correct
25 Correct 1 ms 464 KB Output is correct
26 Correct 1 ms 464 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 0 ms 336 KB Output is correct
2 Correct 0 ms 336 KB Output is correct
3 Correct 0 ms 336 KB Output is correct
4 Correct 0 ms 336 KB Output is correct
5 Correct 1 ms 336 KB Output is correct
6 Correct 0 ms 336 KB Output is correct
7 Correct 0 ms 336 KB Output is correct
8 Correct 0 ms 336 KB Output is correct
9 Correct 0 ms 336 KB Output is correct
10 Correct 0 ms 336 KB Output is correct
11 Correct 0 ms 336 KB Output is correct
12 Correct 0 ms 336 KB Output is correct
13 Correct 0 ms 336 KB Output is correct
14 Correct 1 ms 336 KB Output is correct
15 Correct 1 ms 336 KB Output is correct
16 Correct 1 ms 336 KB Output is correct
17 Correct 1 ms 336 KB Output is correct
18 Correct 1 ms 336 KB Output is correct
19 Correct 1 ms 336 KB Output is correct
20 Correct 1 ms 336 KB Output is correct
21 Correct 1 ms 336 KB Output is correct
22 Correct 1 ms 336 KB Output is correct
23 Correct 1 ms 464 KB Output is correct
24 Correct 1 ms 464 KB Output is correct
25 Correct 1 ms 464 KB Output is correct
26 Correct 1 ms 464 KB Output is correct
27 Correct 88 ms 724 KB Output is correct
28 Correct 87 ms 732 KB Output is correct
29 Correct 94 ms 752 KB Output is correct
30 Correct 93 ms 840 KB Output is correct
31 Correct 101 ms 840 KB Output is correct
32 Correct 83 ms 476 KB Output is correct
33 Correct 79 ms 588 KB Output is correct
34 Correct 88 ms 456 KB Output is correct
35 Correct 87 ms 444 KB Output is correct
36 Correct 104 ms 824 KB Output is correct
37 Correct 145 ms 976 KB Output is correct
38 Correct 149 ms 976 KB Output is correct
39 Correct 148 ms 940 KB Output is correct
# Verdict Execution time Memory Grader output
1 Incorrect 1657 ms 1060 KB Wrong Answer [2]
2 Halted 0 ms 0 KB -