結果

問題 No.240 ナイト散歩
ユーザー tonyu0tonyu0
提出日時 2020-04-29 01:03:41
言語 Rust
(1.83.0 + proconio)
結果
WA  
実行時間 -
コード長 523 bytes
コンパイル時間 20,473 ms
コンパイル使用メモリ 385,692 KB
実行使用メモリ 6,820 KB
最終ジャッジ日時 2024-11-26 08:09:31
合計ジャッジ時間 15,063 ms
ジャッジサーバーID
(参考情報)
judge1 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 21 WA * 9
権限があれば一括ダウンロードができます

ソースコード

diff #

use std::io::*;

fn main() {
    let mut s: String = String::new();
    std::io::stdin().read_to_string(&mut s).ok();
    let mut itr = s.trim().split_whitespace();
    let x: i64 = itr.next().unwrap().parse::<i64>().unwrap().abs();
    let y: i64 = itr.next().unwrap().parse::<i64>().unwrap().abs();
    // 2a +  b = x
    //  a + 2b = y
    let a = ((2 * x - y) / 3).abs();
    let b = ((x - y * 2) / 3).abs();
    if (x + y) % 3 == 0 && a + b <= 3 {
        println!("YES",)
    } else {
        println!("NO",)
    }
}
0