#ifdef NYAOWO
#include "grader.cpp"
#define OUT_VEC(x) { cout << #x << ":"; { for(auto &IT:x) cout << " " << IT; } cout << "\n"; }
#else
#define OUT_VEC(x)
#endif
#include "doll.h"
#include <bits/stdc++.h>
#define For(i, a, b) for(int i = a; i <= b; i++)
#define F first
#define S second
#define all(x) x.begin(), x.end()
#define sz(x) ((int)x.size())
#define eb emplace_back
using namespace std;
using LL = long long;
using pii = pair<int, int>;
const int MAXM = 100010;
void create_circuit(int M, std::vector<int> A) {
vector<vector<int>> adj(M + 1, vector<int>());
vector<int> x, y;
int n = sz(A);
For(i, 0, n - 2) {
adj[A[i]].eb(A[i + 1]);
}
adj[A.back()].eb(0);
vector<int> ans(M + 1);
ans[0] = A[0];
For(i, 1, M) {
if(sz(adj[i]) == 0) {
ans[i] = 0;
} else {
int id = sz(x) + 1;
ans[i] = -id;
if(sz(adj[i]) == 1) {
x.eb(-id);
y.eb(adj[i][0]);
} else {
x.eb(adj[i][0]);
y.eb(adj[i][1]);
}
}
}
OUT_VEC(ans);
OUT_VEC(x);
OUT_VEC(y);
answer(ans, x, y);
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
212 KB |
Output is correct |
2 |
Correct |
35 ms |
7936 KB |
Output is correct |
3 |
Correct |
29 ms |
6728 KB |
Output is correct |
4 |
Correct |
0 ms |
212 KB |
Output is correct |
5 |
Correct |
10 ms |
3796 KB |
Output is correct |
6 |
Correct |
47 ms |
10312 KB |
Output is correct |
7 |
Correct |
0 ms |
212 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
212 KB |
Output is correct |
2 |
Correct |
35 ms |
7936 KB |
Output is correct |
3 |
Correct |
29 ms |
6728 KB |
Output is correct |
4 |
Correct |
0 ms |
212 KB |
Output is correct |
5 |
Correct |
10 ms |
3796 KB |
Output is correct |
6 |
Correct |
47 ms |
10312 KB |
Output is correct |
7 |
Correct |
0 ms |
212 KB |
Output is correct |
8 |
Correct |
43 ms |
7240 KB |
Output is correct |
9 |
Correct |
50 ms |
9928 KB |
Output is correct |
10 |
Correct |
68 ms |
11156 KB |
Output is correct |
11 |
Correct |
0 ms |
212 KB |
Output is correct |
12 |
Correct |
0 ms |
212 KB |
Output is correct |
13 |
Correct |
0 ms |
212 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
212 KB |
Output is correct |
2 |
Correct |
35 ms |
7936 KB |
Output is correct |
3 |
Correct |
29 ms |
6728 KB |
Output is correct |
4 |
Correct |
0 ms |
212 KB |
Output is correct |
5 |
Correct |
10 ms |
3796 KB |
Output is correct |
6 |
Correct |
47 ms |
10312 KB |
Output is correct |
7 |
Correct |
0 ms |
212 KB |
Output is correct |
8 |
Correct |
43 ms |
7240 KB |
Output is correct |
9 |
Correct |
50 ms |
9928 KB |
Output is correct |
10 |
Correct |
68 ms |
11156 KB |
Output is correct |
11 |
Correct |
0 ms |
212 KB |
Output is correct |
12 |
Correct |
0 ms |
212 KB |
Output is correct |
13 |
Correct |
0 ms |
212 KB |
Output is correct |
14 |
Incorrect |
53 ms |
8120 KB |
wrong motion |
15 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
0 ms |
212 KB |
wrong motion |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
0 ms |
212 KB |
wrong motion |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
0 ms |
212 KB |
wrong motion |
2 |
Halted |
0 ms |
0 KB |
- |