Submission #781405

# Submission time Handle Problem Language Result Execution time Memory
781405 2023-07-13T05:35:15 Z vjudge1 Mechanical Doll (IOI18_doll) C++17
16 / 100
66 ms 23724 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], -X.size()-2), tmp);break;
            case 4:
            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 8 ms 11932 KB Output is correct
2 Correct 30 ms 15764 KB Output is correct
3 Correct 27 ms 15440 KB Output is correct
4 Correct 5 ms 11988 KB Output is correct
5 Correct 14 ms 13140 KB Output is correct
6 Correct 29 ms 17300 KB Output is correct
7 Correct 5 ms 11988 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 8 ms 11932 KB Output is correct
2 Correct 30 ms 15764 KB Output is correct
3 Correct 27 ms 15440 KB Output is correct
4 Correct 5 ms 11988 KB Output is correct
5 Correct 14 ms 13140 KB Output is correct
6 Correct 29 ms 17300 KB Output is correct
7 Correct 5 ms 11988 KB Output is correct
8 Correct 42 ms 18140 KB Output is correct
9 Correct 43 ms 18500 KB Output is correct
10 Correct 65 ms 21732 KB Output is correct
11 Correct 6 ms 11936 KB Output is correct
12 Correct 5 ms 11988 KB Output is correct
13 Correct 5 ms 12016 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 8 ms 11932 KB Output is correct
2 Correct 30 ms 15764 KB Output is correct
3 Correct 27 ms 15440 KB Output is correct
4 Correct 5 ms 11988 KB Output is correct
5 Correct 14 ms 13140 KB Output is correct
6 Correct 29 ms 17300 KB Output is correct
7 Correct 5 ms 11988 KB Output is correct
8 Correct 42 ms 18140 KB Output is correct
9 Correct 43 ms 18500 KB Output is correct
10 Correct 65 ms 21732 KB Output is correct
11 Correct 6 ms 11936 KB Output is correct
12 Correct 5 ms 11988 KB Output is correct
13 Correct 5 ms 12016 KB Output is correct
14 Correct 66 ms 23528 KB Output is correct
15 Correct 46 ms 18756 KB Output is correct
16 Correct 57 ms 22124 KB Output is correct
17 Correct 7 ms 11988 KB Output is correct
18 Correct 6 ms 11992 KB Output is correct
19 Correct 6 ms 11988 KB Output is correct
20 Correct 65 ms 23724 KB Output is correct
21 Correct 8 ms 12048 KB Output is correct
22 Correct 6 ms 11988 KB Output is correct
# 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 -
# Verdict Execution time Memory Grader output
1 Incorrect 5 ms 11988 KB wrong motion
2 Halted 0 ms 0 KB -