結果

問題 No.3012 岩井星人グラフ
ユーザー 👑 loop0919
提出日時 2024-10-24 23:39:11
言語 Rust
(1.83.0 + proconio)
結果
AC  
実行時間 304 ms / 2,000 ms
コード長 482 bytes
コンパイル時間 21,416 ms
コンパイル使用メモリ 379,904 KB
実行使用メモリ 5,248 KB
最終ジャッジ日時 2025-01-25 21:50:54
合計ジャッジ時間 28,352 ms
ジャッジサーバーID
(参考情報)
judge5 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 23
権限があれば一括ダウンロードができます

ソースコード

diff #

use proconio::input;

fn main() {
    input! {
        x: u32, y: u32,
    }

    let mut edges = vec![];

    for i in 0..x {
        for j in 0..y - 1 {
            edges.push((i * y + j, i * y + j + 1));
        }
    }

    for i in 0..x - 1 {
        edges.push((i * y, (i + 1) * y));
    }

    edges.push(((x - 1) * y, 0));

    let n = x * y;
    let m = edges.len();

    println!("{} {}", n, m);

    for (u, v) in edges {
        println!("{} {}", u + 1, v + 1);
    }
}
0