Submission #730251

# Submission time Handle Problem Language Result Execution time Memory
730251 2023-04-25T13:55:44 Z t6twotwo Mechanical Doll (IOI18_doll) C++17
10 / 100
1 ms 300 KB
#include "doll.h"
#include <bits/stdc++.h>
using namespace std;
vector<int> F(int n) {
    vector<int> a(1 << n), b;
    for (int i = 0; i < (1 << n); i++) {
        int j = 0;
        while(j < (1 << n)) {
            a[j] ^= 1;
            j = 2 * j + 1 - a[j];
        }
        b.push_back(j - (1 << n));
    }
    return b;
}
void create_circuit(int M, vector<int> A) {
    int N = A.size();
    vector<int> C(M + 1, -1), X(15), Y(15);
    for (int i = 0; i < 7; i++) {
        X[i] = -2 * (i + 1);
        Y[i] = -2 * (i + 1) - 1;
    }
    C[0] = A[0];
    auto a = F(3);
    for (int i = 0; i < 8; i++) {
        X[a[i] + 7] = A[i + 1];
    }
    for (int i = 0; i < 7; i++) {
        Y[a[i] + 7] = A[i + 9];
    }
    Y[a[7] + 7] = 0;
    answer(C, X, Y);
}

Compilation message

doll.cpp: In function 'void create_circuit(int, std::vector<int>)':
doll.cpp:17:9: warning: unused variable 'N' [-Wunused-variable]
   17 |     int N = A.size();
      |         ^
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 212 KB wrong serial number
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 212 KB wrong serial number
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 212 KB wrong serial number
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 212 KB Output is correct
2 Correct 1 ms 212 KB Output is correct
3 Correct 1 ms 212 KB Output is correct
4 Correct 0 ms 212 KB Output is correct
5 Correct 1 ms 296 KB Output is correct
6 Correct 1 ms 212 KB Output is correct
7 Correct 1 ms 300 KB Output is correct
8 Correct 0 ms 212 KB Output is correct
# 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 -