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 "doll.h"
#include <bits/stdc++.h>
#define eb emplace_back
#define printv(a, b) { \
for(auto pv : a) b << pv << " "; \
b << "\n"; \
}
#define mp make_pair
#define F first
#define S second
#define pob pop_back()
#define iter(a) a.begin(), a.end()
using namespace std;
typedef long long ll;
using pll = pair<ll, ll>;
using pii = pair<int, int>;
void create_circuit(int m, vector<int> a){
int n = a.size();
vector<vector<int>> g(m + 1);
int lst = 0;
for(int i = 0; i < n; i++){
g[lst].eb(a[i]);
lst = a[i];
}
g[lst].eb(0);
vector<int> c(m + 1);
int ts = 0;
vector<int> x, y;
for(int i = 0; i <= m; i++){
if(g[i].empty()) continue;
if(g[i].size() == 1){
c[i] = g[i][0];
continue;
}
else if(g[i].size() == 2){
ts++;
c[i] = -ts;
x.eb(g[i][0]);
y.eb(g[i][1]);
}
else if(g[i].size() == 3){
ts++;
c[i] = -ts;
x.eb(-ts - 1);
y.eb(-ts - 2);
x.eb(g[i][0]);
y.eb(-ts);
x.eb(g[i][1]);
y.eb(g[i][2]);
ts += 2;
}
else if(g[i].size() == 4){
ts++;
c[i] = -ts;
x.eb(-ts - 1);
y.eb(-ts - 2);
x.eb(g[i][0]);
y.eb(g[i][2]);
x.eb(g[i][1]);
y.eb(g[i][3]);
ts += 2;
}
}
answer(c, x, y);
}
# | 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... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |