Submission #609386

# Submission time Handle Problem Language Result Execution time Memory
609386 2022-07-27T14:45:31 Z AmirElarbi Mechanical Doll (IOI18_doll) C++14
6 / 100
70 ms 12588 KB
#include <bits/stdc++.h>
#define vi vector<int>
#define ve vector
#define ll long long
#define vf vector<float>
#define vll vector<pair<ll,ll>>
#define ii pair<int,int>
#define pll pair<ll,ll>
#define vvi vector<vi>
#define vii vector<ii>
#define gii greater<ii>
#define pb push_back
#define mp make_pair
#define fi first
#define se second
#define INF 2e9+5
#define eps 1e-7
#define eps1 1e-25
#define optimise ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define MAX_A 1e3+5
#define V 450
using namespace std;
const int MOD = 1e9;
const int nax = 2e5+5;
#include "doll.h"
void create_circuit(int m, vi a) {
    int n = a.size();
    vvi adj(m+1);
    vi c(m+1);
    vi x, y;
    int par = 0;
    for (int i = 0; i < n; ++i) {
        adj[par].pb(a[i]);
        par = a[i];
    }
    adj[par].pb(0);
    int swtch= 0;
    for (int i = 0; i <= m; ++i)
    {
        if(adj[i].size() == 0){
            c[i] = 0;
        } else if(adj[i].size() == 1){
            c[i] = adj[i][0];
        } else if(adj[i].size() == 2){
            c[i] = -swtch-1;
            x.pb(adj[i][0]);
            y.pb(adj[i][1]);
            swtch++;
        }
    }
    answer(c, x, y);
}
# Verdict Execution time Memory Grader output
1 Correct 0 ms 212 KB Output is correct
2 Correct 27 ms 6356 KB Output is correct
3 Correct 19 ms 5076 KB Output is correct
4 Correct 0 ms 212 KB Output is correct
5 Correct 10 ms 3796 KB Output is correct
6 Correct 33 ms 7732 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 6356 KB Output is correct
3 Correct 19 ms 5076 KB Output is correct
4 Correct 0 ms 212 KB Output is correct
5 Correct 10 ms 3796 KB Output is correct
6 Correct 33 ms 7732 KB Output is correct
7 Correct 0 ms 212 KB Output is correct
8 Correct 42 ms 7248 KB Output is correct
9 Correct 46 ms 9564 KB Output is correct
10 Correct 70 ms 12588 KB Output is correct
11 Correct 0 ms 212 KB Output is correct
12 Correct 1 ms 308 KB Output is correct
13 Correct 1 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 6356 KB Output is correct
3 Correct 19 ms 5076 KB Output is correct
4 Correct 0 ms 212 KB Output is correct
5 Correct 10 ms 3796 KB Output is correct
6 Correct 33 ms 7732 KB Output is correct
7 Correct 0 ms 212 KB Output is correct
8 Correct 42 ms 7248 KB Output is correct
9 Correct 46 ms 9564 KB Output is correct
10 Correct 70 ms 12588 KB Output is correct
11 Correct 0 ms 212 KB Output is correct
12 Correct 1 ms 308 KB Output is correct
13 Correct 1 ms 212 KB Output is correct
14 Incorrect 45 ms 7736 KB wrong motion
15 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 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 -