| # | Time | Username | Problem | Language | Result | Execution time | Memory |
|---|---|---|---|---|---|---|---|
| 1346462 | phamngocphuc2008 | Magic Show (APIO24_show) | C++20 | 3 ms | 1092 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;
const int nodes = 5000;
const int sub1 = 5000;
using pii = pair<int,int>;
namespace subtask1
{
std::vector<std::pair<int,int>> solve(int x)
{
vector<pii> ans;
for(int i = 1; i <= nodes; ++i) if(i != x) ans.push_back({i,x});
return ans;
}
}
std::vector<std::pair<int,int>> Alice(){
// add your code here
// change below into your code
int x = setN(sub1);
return subtask1::solve(x);
}
#include <vector>
#include "Bob.h"
using namespace std;
// 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().
const int nodes = 5000;
long long Bob(std::vector<std::pair<int,int>> V)
{
vector<bool> used(nodes+1);
for(auto [a, b] : V)
{
if(used[a]) return a;
if(used[b]) return b;
used[a] = true;
used[b] = true;
}
}
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... | ||||
