結果
問題 | No.1432 Not Xor |
ユーザー |
|
提出日時 | 2021-04-21 07:21:17 |
言語 | Rust (1.83.0 + proconio) |
結果 |
AC
|
実行時間 | 1 ms / 2,000 ms |
コード長 | 791 bytes |
コンパイル時間 | 11,722 ms |
コンパイル使用メモリ | 384,076 KB |
実行使用メモリ | 6,944 KB |
最終ジャッジ日時 | 2024-07-04 05:53:29 |
合計ジャッジ時間 | 12,489 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 1 |
other | AC * 7 |
コンパイルメッセージ
warning: unused imports: `max`, `min` --> src/main.rs:1:16 | 1 | use std::cmp::{max, min}; | ^^^ ^^^ | = note: `#[warn(unused_imports)]` on by default warning: unused imports: `HashMap`, `HashSet`, `VecDeque` --> src/main.rs:2:24 | 2 | use std::collections::{HashMap, HashSet, VecDeque}; | ^^^^^^^ ^^^^^^^ ^^^^^^^^ warning: unused imports: `BufWriter`, `stdout` --> src/main.rs:3:22 | 3 | use std::io::{stdin, stdout, BufWriter}; | ^^^^^^ ^^^^^^^^^
ソースコード
use std::cmp::{max, min};use std::collections::{HashMap, HashSet, VecDeque};use std::io::{stdin, stdout, BufWriter};fn main() {let mut scan = Scanner::default();let a = scan.next::<usize>();let b = scan.next::<usize>();let ans = (a | b) + (a & b);println!("{}", ans);}#[derive(Default)]struct Scanner {buffer: Vec<String>,}impl Scanner {fn next<T: std::str::FromStr>(&mut self) -> T {loop {if let Some(token) = self.buffer.pop() {return token.parse().ok().expect("Failed parse");}let mut input = String::new();stdin().read_line(&mut input).expect("Failed read");self.buffer = input.split_whitespace().rev().map(String::from).collect();}}}