結果
問題 |
No.1957 Xor Min
|
ユーザー |
![]() |
提出日時 | 2023-02-12 18:56:10 |
言語 | Rust (1.83.0 + proconio) |
結果 |
AC
|
実行時間 | 1 ms / 2,000 ms |
コード長 | 430 bytes |
コンパイル時間 | 17,188 ms |
コンパイル使用メモリ | 385,872 KB |
実行使用メモリ | 6,944 KB |
最終ジャッジ日時 | 2024-07-16 06:30:00 |
合計ジャッジ時間 | 18,858 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 25 |
ソースコード
fn main() { let mut s = String::new(); std::io::stdin().read_line(&mut s).ok(); let mut itr = s.trim().split_ascii_whitespace(); let mut a: usize = itr.next().unwrap().parse().unwrap(); let mut b: usize = itr.next().unwrap().parse().unwrap(); if a < b { std::mem::swap(&mut a , &mut b); } let mut bit = 1; while bit * 2 <= a { bit *= 2; } println!("{}", std::cmp::min(bit - 1, b)); }