結果
| 問題 | No.1432 Not Xor |
| コンテスト | |
| ユーザー |
Strorkis
|
| 提出日時 | 2021-03-20 09:19:31 |
| 言語 | Rust (1.83.0 + proconio) |
| 結果 |
AC
|
| 実行時間 | 1 ms / 2,000 ms |
| コード長 | 786 bytes |
| コンパイル時間 | 11,984 ms |
| コンパイル使用メモリ | 402,312 KB |
| 実行使用メモリ | 5,248 KB |
| 最終ジャッジ日時 | 2024-11-20 17:35:00 |
| 合計ジャッジ時間 | 12,788 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 |
| other | AC * 7 |
ソースコード
#[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);
}
Strorkis