// AM+DG
/*
*/
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef vector<ll> vll;
typedef vector<vll> vvll;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef pair<int, int> pi;
typedef pair<ll, ll> pll;
typedef vector<pi> vpi;
typedef vector<pll> vpll;
#define L(i, varmn, varmx) for(ll i = varmn; i < varmx; i++)
#define LR(i, varmx, varmn) for(ll i = varmx; i > varmn; i--)
#define LI(i, varmn, varmx) for(int i = varmn; i < varmx; i++)
#define LIR(i, varmx, varmn) for(int i = varmx; i > varmn; i--)
#define pb push_back
#include "doll.h"
void create_circuit(int m, std::vector<int> a) {
int n = a.size();
vi c(m + 1);
c[0] = -1;
for (int i = 1; i <= m; ++i) {
c[i] = 1;
}
// vi x(N), y(N);
// for (int k = 0; k < N; ++k) {
// x[k] = y[k] = a[k];
// }
vi x;
vi y;
vvi adjmat;
LI(i, 0, m + 1) {
vi adjmatr;
adjmat.pb(adjmatr);
}
LI(i, -1, n) {
if(i == -1) {
adjmat[0].pb(a[i + 1]);
} else if(i == n - 1) {
adjmat[a[i]].pb(0);
} else {
adjmat[a[i]].pb(a[i + 1]);
}
}
int last_switch = 0;
LI(i, 0, m + 1) {
int cur_switch_size = adjmat[i].size();
if(cur_switch_size == 1) {
c[i] = adjmat[i][0];
} else {
// ! TODO later!
// construct_switches(last_switch, );
// last_switch -= cur_switch_size - 1;
}
}
answer(c, x, y);
return;
}
Compilation message
doll.cpp: In function 'void create_circuit(int, std::vector<int>)':
doll.cpp:56:9: warning: unused variable 'last_switch' [-Wunused-variable]
56 | int last_switch = 0;
| ^~~~~~~~~~~
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
348 KB |
Output is correct |
2 |
Correct |
19 ms |
6860 KB |
Output is correct |
3 |
Correct |
15 ms |
5580 KB |
Output is correct |
4 |
Correct |
0 ms |
348 KB |
Output is correct |
5 |
Correct |
7 ms |
4048 KB |
Output is correct |
6 |
Correct |
22 ms |
8548 KB |
Output is correct |
7 |
Correct |
0 ms |
348 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
348 KB |
Output is correct |
2 |
Correct |
19 ms |
6860 KB |
Output is correct |
3 |
Correct |
15 ms |
5580 KB |
Output is correct |
4 |
Correct |
0 ms |
348 KB |
Output is correct |
5 |
Correct |
7 ms |
4048 KB |
Output is correct |
6 |
Correct |
22 ms |
8548 KB |
Output is correct |
7 |
Correct |
0 ms |
348 KB |
Output is correct |
8 |
Incorrect |
21 ms |
6688 KB |
wrong motion |
9 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
348 KB |
Output is correct |
2 |
Correct |
19 ms |
6860 KB |
Output is correct |
3 |
Correct |
15 ms |
5580 KB |
Output is correct |
4 |
Correct |
0 ms |
348 KB |
Output is correct |
5 |
Correct |
7 ms |
4048 KB |
Output is correct |
6 |
Correct |
22 ms |
8548 KB |
Output is correct |
7 |
Correct |
0 ms |
348 KB |
Output is correct |
8 |
Incorrect |
21 ms |
6688 KB |
wrong motion |
9 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
348 KB |
wrong motion |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
348 KB |
wrong motion |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
348 KB |
wrong motion |
2 |
Halted |
0 ms |
0 KB |
- |