#include "doll.h"
using namespace std;
#define debug(x) cerr<<#x<<" = "<<x<<endl
void create_circuit(int M, vector<int> A) {
int n = A.size();
vector<int> C(M + 1);
C[0] = A[0];
vector<int> destiny[100005];
for(int i=0;i<n-1;i++){
destiny[ A[i] ].push_back(A[i+1]);
}
destiny[ A[n-1] ].push_back(0);
vector<int> X,Y;
int k=0;
for(int i=1;i<=M;i++){
if(destiny[i].size()==0){
C[i]=0;
}
else if(destiny[i].size()==1){
C[i]=destiny[i][0];
}
else{
k++;
X.push_back(destiny[i][0]);
Y.push_back(destiny[i][1]);
C[i]=-k;
}
}
answer(C, X, Y);
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
3 ms |
2508 KB |
Output is correct |
2 |
Correct |
38 ms |
6348 KB |
Output is correct |
3 |
Correct |
28 ms |
5916 KB |
Output is correct |
4 |
Correct |
3 ms |
2508 KB |
Output is correct |
5 |
Correct |
18 ms |
3788 KB |
Output is correct |
6 |
Correct |
44 ms |
7620 KB |
Output is correct |
7 |
Correct |
3 ms |
2508 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
3 ms |
2508 KB |
Output is correct |
2 |
Correct |
38 ms |
6348 KB |
Output is correct |
3 |
Correct |
28 ms |
5916 KB |
Output is correct |
4 |
Correct |
3 ms |
2508 KB |
Output is correct |
5 |
Correct |
18 ms |
3788 KB |
Output is correct |
6 |
Correct |
44 ms |
7620 KB |
Output is correct |
7 |
Correct |
3 ms |
2508 KB |
Output is correct |
8 |
Correct |
71 ms |
7984 KB |
Output is correct |
9 |
Correct |
71 ms |
8588 KB |
Output is correct |
10 |
Correct |
103 ms |
10972 KB |
Output is correct |
11 |
Correct |
2 ms |
2508 KB |
Output is correct |
12 |
Correct |
3 ms |
2508 KB |
Output is correct |
13 |
Correct |
3 ms |
2508 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
3 ms |
2508 KB |
Output is correct |
2 |
Correct |
38 ms |
6348 KB |
Output is correct |
3 |
Correct |
28 ms |
5916 KB |
Output is correct |
4 |
Correct |
3 ms |
2508 KB |
Output is correct |
5 |
Correct |
18 ms |
3788 KB |
Output is correct |
6 |
Correct |
44 ms |
7620 KB |
Output is correct |
7 |
Correct |
3 ms |
2508 KB |
Output is correct |
8 |
Correct |
71 ms |
7984 KB |
Output is correct |
9 |
Correct |
71 ms |
8588 KB |
Output is correct |
10 |
Correct |
103 ms |
10972 KB |
Output is correct |
11 |
Correct |
2 ms |
2508 KB |
Output is correct |
12 |
Correct |
3 ms |
2508 KB |
Output is correct |
13 |
Correct |
3 ms |
2508 KB |
Output is correct |
14 |
Incorrect |
76 ms |
8868 KB |
wrong motion |
15 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
2 ms |
2508 KB |
wrong motion |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
3 ms |
2508 KB |
wrong motion |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
3 ms |
2508 KB |
wrong motion |
2 |
Halted |
0 ms |
0 KB |
- |