#include "doll.h"
#include<bits/stdc++.h>
using namespace std;
#define F first
#define S second
#define all(x) x.begin(),x.end()
typedef long long ll;
#define INF 99999999999999
#define pb push_back
void create_circuit(int M, std::vector<int> A) {
int N = A.size()+1;
A.pb(0);
vector<int> C(M + 1);
vector<bool>vis(M+1,0);
vector<int>sw(M+1,0);
ll idx=0;
vector<int> X, Y;
C[0]=A[0];
for(int i=0;i<N-1;i++)
{
if(!vis[A[i]])
{
vis[A[i]]=1;
C[A[i]]=-(idx+1);
X.pb(-(idx+1));
Y.pb(A[i+1]);
sw[A[i]]=idx++;
continue;
}
ll curr=sw[A[i]];
X[curr]=Y[curr];
Y[curr]=A[i+1];
}
answer(C, X, Y);
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
212 KB |
Output is correct |
2 |
Correct |
27 ms |
4272 KB |
Output is correct |
3 |
Correct |
21 ms |
4696 KB |
Output is correct |
4 |
Correct |
0 ms |
212 KB |
Output is correct |
5 |
Correct |
8 ms |
1832 KB |
Output is correct |
6 |
Correct |
32 ms |
6620 KB |
Output is correct |
7 |
Correct |
0 ms |
212 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
212 KB |
Output is correct |
2 |
Correct |
27 ms |
4272 KB |
Output is correct |
3 |
Correct |
21 ms |
4696 KB |
Output is correct |
4 |
Correct |
0 ms |
212 KB |
Output is correct |
5 |
Correct |
8 ms |
1832 KB |
Output is correct |
6 |
Correct |
32 ms |
6620 KB |
Output is correct |
7 |
Correct |
0 ms |
212 KB |
Output is correct |
8 |
Correct |
29 ms |
5152 KB |
Output is correct |
9 |
Correct |
40 ms |
7564 KB |
Output is correct |
10 |
Correct |
53 ms |
8720 KB |
Output is correct |
11 |
Correct |
1 ms |
300 KB |
Output is correct |
12 |
Correct |
0 ms |
300 KB |
Output is correct |
13 |
Correct |
0 ms |
212 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
212 KB |
Output is correct |
2 |
Correct |
27 ms |
4272 KB |
Output is correct |
3 |
Correct |
21 ms |
4696 KB |
Output is correct |
4 |
Correct |
0 ms |
212 KB |
Output is correct |
5 |
Correct |
8 ms |
1832 KB |
Output is correct |
6 |
Correct |
32 ms |
6620 KB |
Output is correct |
7 |
Correct |
0 ms |
212 KB |
Output is correct |
8 |
Correct |
29 ms |
5152 KB |
Output is correct |
9 |
Correct |
40 ms |
7564 KB |
Output is correct |
10 |
Correct |
53 ms |
8720 KB |
Output is correct |
11 |
Correct |
1 ms |
300 KB |
Output is correct |
12 |
Correct |
0 ms |
300 KB |
Output is correct |
13 |
Correct |
0 ms |
212 KB |
Output is correct |
14 |
Incorrect |
33 ms |
6676 KB |
wrong motion |
15 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
212 KB |
wrong motion |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
212 KB |
wrong motion |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
212 KB |
wrong motion |
2 |
Halted |
0 ms |
0 KB |
- |