# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
936566 | azberjibiou | Longest Trip (IOI23_longesttrip) | C++17 | 11 ms | 1416 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include "longesttrip.h"
#include <bits/stdc++.h>
using namespace std;
const int mxN=300;
int N;
bool Chk[mxN];
vector <int> makev(int a){
vector <int> tmp;
tmp.push_back(a);
return tmp;
}
vector <int> makevlong(vector <int> v, int s, int e){
vector <int> res;
for(int i=s;i<=e;i++) res.push_back(v[i]);
return res;
}
vector <int> solv_bipartite(vector <int> v1, vector <int> v2){
if(!are_connected(v1, v2)){
if(v1.size()>v2.size()) swap(v1, v2);
return v2;
}
if(v1.size()>=2 && !are_connected(makev(v1[0]), makev(v1.back()))){
if(are_connected(makev(v1.back()), makev(v2.back()))){
while(v2.size()){
v1.push_back(v2.back());
v2.pop_back();
}
return v1;
}
else{
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... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |