結果

問題 No.2706 One Nafmo
ユーザー ARCANA
提出日時 2024-04-06 13:55:06
言語 Rust
(1.83.0 + proconio)
結果
AC  
実行時間 1 ms / 2,000 ms
コード長 895 bytes
コンパイル時間 17,104 ms
コンパイル使用メモリ 388,564 KB
実行使用メモリ 6,820 KB
最終ジャッジ日時 2024-10-01 03:49:57
合計ジャッジ時間 18,036 ms
ジャッジサーバーID
(参考情報)
judge3 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 9
権限があれば一括ダウンロードができます
コンパイルメッセージ
warning: struct `Graph` is never constructed
 --> src/main.rs:3:8
  |
3 | struct Graph {
  |        ^^^^^
  |
  = note: `#[warn(dead_code)]` on by default

warning: struct `WeightGraph` is never constructed
 --> src/main.rs:7:8
  |
7 | struct WeightGraph {
  |        ^^^^^^^^^^^

warning: struct `Point` is never constructed
  --> src/main.rs:12:8
   |
12 | struct Point {
   |        ^^^^^

warning: struct `PointGroup` is never constructed
  --> src/main.rs:17:8
   |
17 | struct PointGroup{
   |        ^^^^^^^^^^

warning: structure field `adjMatrixs` should have a snake case name
 --> src/main.rs:5:5
  |
5 |     adjMatrixs: Vec<Vec<i32>>,
  |     ^^^^^^^^^^ help: convert the identifier to snake case: `adj_matrixs`
  |
  = note: `#[warn(non_snake_case)]` on by default

ソースコード

diff #

// graph
struct Graph {
    node: i32,
    adjMatrixs: Vec<Vec<i32>>,
}
struct WeightGraph {
    node: i32,
    weight: Vec<Vec<i32>>,
}
// points
struct Point {
    x: i32,
    y: i32,
}

struct PointGroup{
    n: i32,
    point:Point,
}

use std::io;

fn read_line() -> String {
    let mut s = String::new();
    io::stdin().read_line(&mut s).unwrap();
    s
}

macro_rules! from_line {
    ($($a:ident : $t:ty),+) => {
        $(let $a: $t;)+
        {
            let _line = read_line();
            let mut _it = _line.trim().split_whitespace();
            $($a = _it.next().unwrap().parse().unwrap();)+
            assert!(_it.next().is_none());
        }
    };
}

fn solve(){
    from_line!(a: i32,b:i32,x:i32);
    for i in 1..=1000{
        if a * i >= x {
            let ans = i*b;
            println!("{}",ans);
            return;
        }
    }
}
fn main() {
    solve();
}
0