#include "doll.h"
//#include "grader.cpp"
#include <bits/stdc++.h>
using namespace std;
const int NN=2e5+5;
vector<int> g[NN];
vector<int> x,y;
#define pb push_back
void create_circuit(int m, vector<int> a) {
int n=a.size();
vector<int> c(m+1);
c[0]=a[0];
for(int i=0;i<n-1;i++){
g[a[i]].push_back(a[i+1]);
c[a[i]]=a[i+1];
}
g[a[n-1]].pb(0);
int id=-1;
for(int i=1;i<=m;i++){
int sz=g[i].size();
if(sz<=1) continue;
c[i]=id--;
if(sz==2){
x.pb(g[i][0]);
y.pb(g[i][1]);
}
else if(sz==3){
x.pb(id--);
y.pb(id--);
x.pb(c[i]);
y.pb(g[i][1]);
x.pb(g[i][0]);
y.pb(g[i][2]);
}
else if(sz==4){
x.pb(id--);
y.pb(id--);
x.pb(g[i][0]);
y.pb(g[i][2]);
x.pb(g[i][1]);
y.pb(g[i][3]);
}
}
answer(c,x,y);
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
3 ms |
4948 KB |
Output is correct |
2 |
Correct |
19 ms |
8724 KB |
Output is correct |
3 |
Correct |
25 ms |
8276 KB |
Output is correct |
4 |
Correct |
3 ms |
4948 KB |
Output is correct |
5 |
Correct |
13 ms |
6100 KB |
Output is correct |
6 |
Correct |
28 ms |
9980 KB |
Output is correct |
7 |
Correct |
4 ms |
4996 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
3 ms |
4948 KB |
Output is correct |
2 |
Correct |
19 ms |
8724 KB |
Output is correct |
3 |
Correct |
25 ms |
8276 KB |
Output is correct |
4 |
Correct |
3 ms |
4948 KB |
Output is correct |
5 |
Correct |
13 ms |
6100 KB |
Output is correct |
6 |
Correct |
28 ms |
9980 KB |
Output is correct |
7 |
Correct |
4 ms |
4996 KB |
Output is correct |
8 |
Correct |
56 ms |
10344 KB |
Output is correct |
9 |
Correct |
36 ms |
11856 KB |
Output is correct |
10 |
Correct |
70 ms |
14836 KB |
Output is correct |
11 |
Correct |
3 ms |
4948 KB |
Output is correct |
12 |
Correct |
3 ms |
4948 KB |
Output is correct |
13 |
Correct |
2 ms |
4948 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
3 ms |
4948 KB |
Output is correct |
2 |
Correct |
19 ms |
8724 KB |
Output is correct |
3 |
Correct |
25 ms |
8276 KB |
Output is correct |
4 |
Correct |
3 ms |
4948 KB |
Output is correct |
5 |
Correct |
13 ms |
6100 KB |
Output is correct |
6 |
Correct |
28 ms |
9980 KB |
Output is correct |
7 |
Correct |
4 ms |
4996 KB |
Output is correct |
8 |
Correct |
56 ms |
10344 KB |
Output is correct |
9 |
Correct |
36 ms |
11856 KB |
Output is correct |
10 |
Correct |
70 ms |
14836 KB |
Output is correct |
11 |
Correct |
3 ms |
4948 KB |
Output is correct |
12 |
Correct |
3 ms |
4948 KB |
Output is correct |
13 |
Correct |
2 ms |
4948 KB |
Output is correct |
14 |
Correct |
86 ms |
16056 KB |
Output is correct |
15 |
Correct |
36 ms |
10680 KB |
Output is correct |
16 |
Correct |
65 ms |
13708 KB |
Output is correct |
17 |
Correct |
3 ms |
4948 KB |
Output is correct |
18 |
Correct |
2 ms |
4948 KB |
Output is correct |
19 |
Correct |
2 ms |
4948 KB |
Output is correct |
20 |
Correct |
62 ms |
15128 KB |
Output is correct |
21 |
Correct |
3 ms |
5000 KB |
Output is correct |
22 |
Correct |
3 ms |
5000 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
3 ms |
4948 KB |
wrong serial number |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
3 ms |
4948 KB |
wrong serial number |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
3 ms |
4948 KB |
wrong serial number |
2 |
Halted |
0 ms |
0 KB |
- |