이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#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 | 
|---|
| Fetching results... | 
| # | Verdict  | Execution time | Memory | Grader output | 
|---|
| Fetching results... | 
| # | Verdict  | Execution time | Memory | Grader output | 
|---|
| Fetching results... | 
| # | Verdict  | Execution time | Memory | Grader output | 
|---|
| Fetching results... |