結果

問題 No.2706 One Nafmo
ユーザー ARCANAARCANA
提出日時 2024-04-06 13:55:06
言語 Rust
(1.77.0)
結果
AC  
実行時間 1 ms / 2,000 ms
コード長 895 bytes
コンパイル時間 799 ms
コンパイル使用メモリ 174,072 KB
実行使用メモリ 6,676 KB
最終ジャッジ日時 2024-04-06 13:55:09
合計ジャッジ時間 2,603 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
6,676 KB
testcase_01 AC 1 ms
6,676 KB
testcase_02 AC 1 ms
6,676 KB
testcase_03 AC 1 ms
6,676 KB
testcase_04 AC 1 ms
6,676 KB
testcase_05 AC 1 ms
6,676 KB
testcase_06 AC 1 ms
6,676 KB
testcase_07 AC 0 ms
6,676 KB
testcase_08 AC 1 ms
6,676 KB
testcase_09 AC 1 ms
6,676 KB
testcase_10 AC 1 ms
6,676 KB
testcase_11 AC 1 ms
6,676 KB
testcase_12 AC 1 ms
6,676 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
warning: struct `Graph` is never constructed
 --> Main.rs:3:8
  |
3 | struct Graph {
  |        ^^^^^
  |
  = note: `#[warn(dead_code)]` on by default

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

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

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

warning: structure field `adjMatrixs` should have a snake case name
 --> 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

warning: 5 warnings emitted

ソースコード

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