제출 #1349101

#제출 시각아이디문제언어결과실행 시간메모리
1349101nagorn_ph마술쇼 (APIO24_show)C++20
0 / 100
2 ms624 KiB
#include <vector>
#include "Alice.h"
#include <bits/stdc++.h>
#define int long long
#define emb emplace_back
#define pii pair <int, int>
#define tiii tuple <int, int, int>
#define tdii tuple <double, int, int>
#define all(a) a.begin(), a.end()

using namespace std;

const int N = 1e5 + 5;
const double inf = 1e18;

// you may define some global variables, but it does not work if you try to transfer any information from function Alice() to function Bob() through these variables.
// you had better not use the same global variables in function Alice() and in function Bob().

std::vector<std::pair<int32_t,int32_t>> Alice(){
    int x = setN(5000);
    vector <pair <int32_t, int32_t>> ans;
    for (int i = 1; i <= 5000; i++) {
        if (i == x) continue;
        ans.emb(i, x);
    }
    return ans;
}
#include <vector>
#include "Bob.h"
#include <bits/stdc++.h>
#define int long long
#define emb emplace_back
#define pii pair <int, int>
#define tiii tuple <int, int, int>
#define tdii tuple <double, int, int>
#define all(a) a.begin(), a.end()

using namespace std;

const int N = 1e5 + 5;
const double inf = 1e18;

// you may define some global variables, but it does not work if you try to transfer any information from function Alice() to function Bob() through these variables.
// you had better not use the same global variables in function Alice() and in function Bob().

long long Bob(std::vector<std::pair<int32_t,int32_t>> v){
    int n = v.size() + 1;
    vector <int> deg(n + 1);
    pii mx = {0, 0};
    for (auto [u, v] : v) {
        deg[u]++;
        deg[v]++;
        mx = max(mx, {deg[u], u});
        mx = max(mx, {deg[v], v});
    }
    return mx.second;
}
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...