Submission #781401

# Submission time Handle Problem Language Result Execution time Memory
781401 2023-07-13T05:30:49 Z vjudge1 Mechanical Doll (IOI18_doll) C++17
6 / 100
75 ms 23584 KB
#include "doll.h"
#include<bits/stdc++.h>
using namespace std;
vector<int> X, Y, C;
int ms(int a, int b) {
    X.push_back(a);
    Y.push_back(b);
    return -Y.size();
}
vector<int> adj[500100];
void create_circuit(int M, std::vector<int> A) {
    C.resize(M+1);
    int n = A.size();
    adj[0].push_back(A[0]);
    A.push_back(0);
    for(int i = 0; i < n; i++)
        adj[A[i]].push_back(A[i+1]);
    for(int i = 0; i <= M; i++) {
        int tmp;
        switch(adj[i].size()) {
            case 1:C[i] = adj[i][0];break;
            case 2:C[i] = ms(adj[i][0], adj[i][1]);break;
            case 3:
            tmp = ms(adj[i][1], adj[i][2]);
            C[i] = ms(ms(adj[i][0], tmp), tmp);break;
            case 4:
            answer({},{},{});
            C[i] = ms(ms(adj[i][0], adj[i][2]), ms(adj[i][1], adj[i][3]));break;
        }
    }
    answer(C, X, Y);
}
# Verdict Execution time Memory Grader output
1 Correct 6 ms 11988 KB Output is correct
2 Correct 25 ms 15696 KB Output is correct
3 Correct 21 ms 15512 KB Output is correct
4 Correct 6 ms 11988 KB Output is correct
5 Correct 14 ms 13140 KB Output is correct
6 Correct 29 ms 17212 KB Output is correct
7 Correct 6 ms 11988 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 6 ms 11988 KB Output is correct
2 Correct 25 ms 15696 KB Output is correct
3 Correct 21 ms 15512 KB Output is correct
4 Correct 6 ms 11988 KB Output is correct
5 Correct 14 ms 13140 KB Output is correct
6 Correct 29 ms 17212 KB Output is correct
7 Correct 6 ms 11988 KB Output is correct
8 Correct 45 ms 18272 KB Output is correct
9 Correct 44 ms 18596 KB Output is correct
10 Correct 60 ms 21744 KB Output is correct
11 Correct 6 ms 11988 KB Output is correct
12 Correct 7 ms 11980 KB Output is correct
13 Correct 5 ms 11988 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 6 ms 11988 KB Output is correct
2 Correct 25 ms 15696 KB Output is correct
3 Correct 21 ms 15512 KB Output is correct
4 Correct 6 ms 11988 KB Output is correct
5 Correct 14 ms 13140 KB Output is correct
6 Correct 29 ms 17212 KB Output is correct
7 Correct 6 ms 11988 KB Output is correct
8 Correct 45 ms 18272 KB Output is correct
9 Correct 44 ms 18596 KB Output is correct
10 Correct 60 ms 21744 KB Output is correct
11 Correct 6 ms 11988 KB Output is correct
12 Correct 7 ms 11980 KB Output is correct
13 Correct 5 ms 11988 KB Output is correct
14 Incorrect 75 ms 23584 KB state 'Y'
15 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 8 ms 11988 KB wrong motion
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 5 ms 11988 KB wrong motion
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 5 ms 11988 KB wrong motion
2 Halted 0 ms 0 KB -