#include "doll.h"
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef vector<int> vi;
typedef vector<vi> vii;
typedef pair<int,int> pi;
typedef vector<pi> pii;
typedef tuple<int,int,int> tii;
#define REP(i,a,b) for(int i=a;i<b;i++)
#define F first
#define S second
#define PB push_back
#define MP make_pair
#define LSOne(s) ((s)&(-s))
ll INF=1e18+10;
int inf=1e9+10;
ll M=1e9+7;
void create_circuit(int M, std::vector<int> A) {
int n=A.size();
vi c,x,y;
vi a(M+1,0);
vii b(M+1);
REP(i,0,n)a[A[i]]++;
REP(i,0,n-1)b[A[i]].PB(A[i+1]);
b[A[n-1]].PB(0);
c.resize(M+1,0);
c[0]=A[0];
int k=0;
REP(i,1,M+1){
if(a[i]==0)continue;
if(a[i]==1)c[i]=b[i][0];
else{
c[i]=k-1;
k--;
x.PB(b[i][0]);
y.PB(b[i][1]);
}
}
answer(c,x,y);
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
348 KB |
Output is correct |
2 |
Correct |
16 ms |
6720 KB |
Output is correct |
3 |
Correct |
14 ms |
5468 KB |
Output is correct |
4 |
Correct |
0 ms |
348 KB |
Output is correct |
5 |
Correct |
6 ms |
4188 KB |
Output is correct |
6 |
Correct |
21 ms |
8028 KB |
Output is correct |
7 |
Correct |
0 ms |
348 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
348 KB |
Output is correct |
2 |
Correct |
16 ms |
6720 KB |
Output is correct |
3 |
Correct |
14 ms |
5468 KB |
Output is correct |
4 |
Correct |
0 ms |
348 KB |
Output is correct |
5 |
Correct |
6 ms |
4188 KB |
Output is correct |
6 |
Correct |
21 ms |
8028 KB |
Output is correct |
7 |
Correct |
0 ms |
348 KB |
Output is correct |
8 |
Correct |
30 ms |
7640 KB |
Output is correct |
9 |
Correct |
33 ms |
9176 KB |
Output is correct |
10 |
Correct |
42 ms |
11468 KB |
Output is correct |
11 |
Correct |
0 ms |
348 KB |
Output is correct |
12 |
Correct |
0 ms |
348 KB |
Output is correct |
13 |
Correct |
0 ms |
344 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
348 KB |
Output is correct |
2 |
Correct |
16 ms |
6720 KB |
Output is correct |
3 |
Correct |
14 ms |
5468 KB |
Output is correct |
4 |
Correct |
0 ms |
348 KB |
Output is correct |
5 |
Correct |
6 ms |
4188 KB |
Output is correct |
6 |
Correct |
21 ms |
8028 KB |
Output is correct |
7 |
Correct |
0 ms |
348 KB |
Output is correct |
8 |
Correct |
30 ms |
7640 KB |
Output is correct |
9 |
Correct |
33 ms |
9176 KB |
Output is correct |
10 |
Correct |
42 ms |
11468 KB |
Output is correct |
11 |
Correct |
0 ms |
348 KB |
Output is correct |
12 |
Correct |
0 ms |
348 KB |
Output is correct |
13 |
Correct |
0 ms |
344 KB |
Output is correct |
14 |
Incorrect |
35 ms |
8340 KB |
wrong motion |
15 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
0 ms |
348 KB |
wrong motion |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
0 ms |
348 KB |
wrong motion |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
0 ms |
348 KB |
wrong motion |
2 |
Halted |
0 ms |
0 KB |
- |