| # | Time | Username | Problem | Language | Result | Execution time | Memory |
|---|---|---|---|---|---|---|---|
| 1202925 | ericl23302 | Magic Show (APIO24_show) | C++20 | 2 ms | 380 KiB |
#include <vector>
#include "Alice.h"
// 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().
using namespace std;
std::vector<std::pair<int,int>> Alice(){
// add your code here
// change below into your code
long long x = setN(5000);
vector<pair<int, int>> tree;
for (int i = 1; i <= 5000; ++i) {
if (i == x) continue;
tree.emplace_back(x, i);
}
return tree;
}
#include <vector>
#include "Bob.h"
// 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().
using namespace std;
long long Bob(std::vector<std::pair<int,int>> V){
vector<int> cnts(5001, 0);
for (auto &i : V) ++cnts[i.first], ++cnts[i.second];
for (int i = 1; i <= 5000; ++i) {
if (cnts[i] > 1) return i;
}
}
Compilation message (stderr)
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
