Submission #1189797

#TimeUsernameProblemLanguageResultExecution timeMemory
1189797TsaganaMagic Show (APIO24_show)C++20
5 / 100
2 ms380 KiB
#include "Alice.h"
using namespace std;

vector<pair<int, int>> Alice() {
    long long x = setN(5000);
    vector<pair<int,int>> tree;
    for (int i = 1; i <= 5000; i++) {
        if (i != x) {
            tree.push_back({i, x});
        }
    }
    return tree;
}
#include "Bob.h"
using namespace std;

long long Bob(vector<pair<int,int>> tree) {
    int cnt[5001] = {};
    for (auto [u, v] : tree) {
        cnt[u]++, cnt[v]++;
    }
    int ans = 0;
    for (int i = 1; i <= 5000; i++) {
        if (cnt[i] > cnt[ans]) {
            ans = i;
        }
    }
    return ans;
}
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...