結果

問題 No.373 かけ算と割った余り
ユーザー AyachiGinAyachiGin
提出日時 2016-06-21 20:13:10
言語 Rust
(1.77.0)
結果
WA  
実行時間 -
コード長 487 bytes
コンパイル時間 1,131 ms
コンパイル使用メモリ 157,356 KB
実行使用メモリ 6,944 KB
最終ジャッジ日時 2024-04-19 23:47:15
合計ジャッジ時間 1,183 ms
ジャッジサーバーID
(参考情報)
judge3 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
5,248 KB
testcase_01 AC 1 ms
5,376 KB
testcase_02 AC 1 ms
5,376 KB
testcase_03 AC 0 ms
5,376 KB
testcase_04 AC 0 ms
5,376 KB
testcase_05 WA -
testcase_06 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

use std::io;

fn main() {
    let mut input = String::new();
    io::stdin().read_line(&mut input)
        .expect("Read Error");
    let numbers: Vec<i64> = input.split_whitespace()
        .map(|w| w.parse().unwrap())
        .collect();

    println!("{}", solve(numbers[0],  numbers[1], numbers[2], numbers[3]));
}

fn solve(a: i64, b: i64, c: i64, d: i64) -> i64 {
    a * b * c % d
}

#[test]
fn it_works() {
    assert_eq!(2, solve(1,2,3,4));
    assert_eq!(0, solve(2,2,2,2));
}
0