結果

問題 No.3260 岩井スターグラフ
ユーザー fumin
提出日時 2025-09-07 00:50:45
言語 Rust
(1.83.0 + proconio)
結果
AC  
実行時間 46 ms / 2,000 ms
コード長 553 bytes
コンパイル時間 14,216 ms
コンパイル使用メモリ 385,368 KB
実行使用メモリ 10,008 KB
最終ジャッジ日時 2025-09-07 00:51:04
合計ジャッジ時間 18,653 ms
ジャッジサーバーID
(参考情報)
judge2 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 36
権限があれば一括ダウンロードができます
コンパイルメッセージ
warning: type `us` should have an upper camel case name
 --> src/main.rs:9:6
  |
9 | type us = usize;
  |      ^^ help: convert the identifier to upper camel case (notice the capitalization): `Us`
  |
  = note: `#[warn(non_camel_case_types)]` on by default

warning: unused variable: `x`
  --> src/main.rs:14:13
   |
14 |     input! {x:us,y:us,n:us,uv:[(us,us);n]}
   |             ^ help: if this is intentional, prefix it with an underscore: `_x`
   |
   = note: `#[warn(unused_variables)]` on by default

ソースコード

diff #

#![allow(unused_imports)]
use std::{*, collections::*, ops::*, cmp::*, iter::*};
use proconio::{input, fastout};

fn main() {
    solve();
}

type us = usize;

// CONTEST(abcXXX-a)
#[fastout]
fn solve() {
    input! {x:us,y:us,n:us,uv:[(us,us);n]}
    for (u,v) in uv {
        if u == 0 {
            println!("{}", (v-1)%y+1);
        } else if (u-1)/y == (v-1)/y {
            println!("{}", ((u-1)%y).abs_diff((v-1)%y));
        } else {
            println!("{}", (u-1)%y+1 + (v-1)%y+1);
        }
    }
}

// #CAP(fumin::modint)
pub mod fumin {
}
0