Submission #520274

# Submission time Handle Problem Language Result Execution time Memory
520274 2022-01-29T04:46:33 Z KoD Konstrukcija (COCI20_konstrukcija) C++17
0 / 110
1 ms 336 KB
#include <bits/stdc++.h>

using std::vector;
using std::array;
using std::tuple;
using std::pair;

int main() {
    std::ios_base::sync_with_stdio(false);
    std::cin.tie(nullptr);
    long long K;
    std::cin >> K;
    const int D = 64;
    const int V = 4 * D + 3;
    vector<pair<int, int>> edge;
    for (int i = 2; i <= 4; ++i) {
        edge.emplace_back(i, V);
    }
    for (int d = 1; d < D; ++d) {
        const int a = 3 * d;
        const int b = 3 * d + 3;
        for (int i = -1; i <= 1; ++i) {
            for (int j = -1; j <= 1; ++j) {
                edge.emplace_back(b + j, a + i);
            }
        }
    }
    for (int i = 3 * D - 1; i <= 3 * D + 1; ++i) {
        edge.emplace_back(3 * D + 2, i);
    }
    edge.emplace_back(1, 3 * D + 2);
    int coeff = 1;
    for (int i = 1; i <= D; ++i) {
        edge.emplace_back(3 * D + 2 + i, 3 * i - 1);
        edge.emplace_back(3 * D + 2 + i, 3 * i + 1);
        if (K % 2 != 0) {
            K -= coeff;
            edge.emplace_back(1, 3 * D + 2 + i);
        }
        K /= 2;
        coeff *= -1;
    }
    std::cout << V << ' ' << edge.size() << '\n';
    for (const auto& [a, b] : edge) {
        std::cout << a << ' ' << b << '\n';
    }   
    return 0;
}
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 304 KB Wrong answer.
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 336 KB Wrong answer.
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 304 KB Wrong answer.
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 304 KB Wrong answer.
2 Halted 0 ms 0 KB -