結果

問題 No.1236 長針と短針
ユーザー Strorkis
提出日時 2020-09-25 21:33:07
言語 Rust
(1.83.0 + proconio)
結果
AC  
実行時間 1 ms / 2,000 ms
コード長 556 bytes
コンパイル時間 22,071 ms
コンパイル使用メモリ 378,348 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-06-28 06:10:10
合計ジャッジ時間 19,109 ms
ジャッジサーバーID
(参考情報)
judge5 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 20
権限があれば一括ダウンロードができます

ソースコード

diff #

macro_rules! read_line_to_tuple {
    ( $( $t:ty ),* ) => {{
        let mut input = String::new();
        std::io::stdin().read_line(&mut input).unwrap();
        let mut iter = input.split_whitespace();
        ( $( iter.next().unwrap().parse::<$t>().unwrap() ),* )
    }};
}

fn main() {
    let (a, b) = read_line_to_tuple!(i32, i32);

    let long_hand = a * 60 + b;
    let short_hand = b * 12;

    let mut diff = (long_hand - short_hand) % 720;
    if diff < 0 {
        diff += 720;
    }

    let ans = diff * 60 / 11;
    println!("{}", ans);
}
0