結果

問題 No.3012 岩井星人グラフ
コンテスト
ユーザー lp_ql
提出日時 2025-01-25 13:12:05
言語 Rust
(1.94.0 + proconio + num + itertools)
コンパイル:
/usr/bin/rustc_custom
実行:
./target/release/main
結果
AC  
実行時間 181 ms / 2,000 ms
コード長 474 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 14,008 ms
コンパイル使用メモリ 194,908 KB
実行使用メモリ 6,400 KB
最終ジャッジ日時 2026-06-23 22:11:47
合計ジャッジ時間 18,926 ms
ジャッジサーバーID
(参考情報)
judge1_0 / judge3_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 23
権限があれば一括ダウンロードができます
コンパイルメッセージ
warning: unused import: `itertools::Itertools`
 --> src/main.rs:1:5
  |
1 | use itertools::Itertools;
  |     ^^^^^^^^^^^^^^^^^^^^
  |
  = note: `#[warn(unused_imports)]` (part of `#[warn(unused)]`) on by default

ソースコード

diff #
raw source code

use itertools::Itertools;
use proconio::input;
fn main() {
    input!{
        x: usize,
        y: usize
    }
    let n = x*y;
    let m = x*y;
    println!("{} {}",n,m);
    let mut ans = vec![];
    for i in 1..x{
        ans.push((i,i+1))
    }
    if x != 1{
        ans.push((x,1))
    }
    for i in 1..=x{
        for j in 0..y-1{
            ans.push((i+x*j,i+x*(j+1)))
        }
    }
    for i in 0..ans.len(){
        println!("{} {}",ans[i].0,ans[i].1)
    }
}
0