結果

問題 No.1432 Not Xor
ユーザー StrorkisStrorkis
提出日時 2021-03-20 09:19:31
言語 Rust
(1.77.0)
結果
AC  
実行時間 1 ms / 2,000 ms
コード長 786 bytes
コンパイル時間 704 ms
コンパイル使用メモリ 128,452 KB
実行使用メモリ 4,384 KB
最終ジャッジ日時 2023-08-13 01:25:35
合計ジャッジ時間 1,404 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ(β)

テストケース

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

ソースコード

diff #

#[allow(dead_code)]
mod io {
    use std::io::Read;
    use std::str::{FromStr, SplitWhitespace};

    pub struct Scanner<'a>(SplitWhitespace<'a>);

    impl<'a> Scanner<'a> {
        pub fn new(buf: &'a mut String) -> Self {
            std::io::stdin().read_to_string(buf).ok();
            Self(buf.split_whitespace())
        }

        pub fn next<T: FromStr>(&mut self) -> T {
            self.0.next().unwrap().parse().ok().unwrap()
        }
    }

    pub fn vec<T, F: FnMut() -> T>(f: F, n: usize) -> Vec<T> {
        std::iter::repeat_with(f).take(n).collect()
    }
}

fn main() {
    let ref mut buf = String::new();
    let mut sc = io::Scanner::new(buf);

    let (a, b) = (sc.next::<u32>(), sc.next::<u32>());

    let ans = (a | b) + (a & b);
    println!("{}", ans);
}
0