結果

問題 No.2597 Yet Another Topological Problem
ユーザー suisen
提出日時 2023-11-21 21:32:02
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 749 bytes
コンパイル時間 444 ms
コンパイル使用メモリ 67,072 KB
最終ジャッジ日時 2025-02-17 22:46:58
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 42 WA * 13
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>

const std::string Possible{"Possible"};
const std::string Impossible{"Impossible"};

void print_point(int x, int y) {
    std::cout << x << ' ' << y << '\n';
}

int main() {
    std::ios::sync_with_stdio(false);
    std::cin.tie(nullptr);

    int p, q;
    std::cin >> p >> q;

    if (2 * p <= q) {
        std::cout << Impossible << '\n';
        return 0;
    }

    std::cout << Possible << '\n';
    std::cout << 2 * q + 4 << '\n';
    print_point(0, 0);
    print_point(0, -1);
    for (int x = 1; x <= 2 * p - 1; ++x) {
        print_point(x, -1);
    }
    print_point(2 * p - 1, 0);
    print_point(2 * p - 1, 1);
    for (int x = 2 * p; x <= 2 * q; ++x) {
        print_point(x, 1);
    }
    print_point(2 * q, 0);
}
0