Submission #38485661
Source Code Expand
Copy
use proconio::{input, marker::Usize1};fn main() {input! {h: usize,w: usize,};if h == 1 || w == 1 {println!("1");return;}let ans = match (h % 2, w % 2) {(0, 0) | (0, 1) | (1, 0) => (h * w) / 2,(1, 1) => (h * w) / 2 + 1,_ => unreachable!(),};println!("{}", ans);}
use proconio::{input, marker::Usize1}; fn main() { input! { h: usize, w: usize, }; if h == 1 || w == 1 { println!("1"); return; } let ans = match (h % 2, w % 2) { (0, 0) | (0, 1) | (1, 0) => (h * w) / 2, (1, 1) => (h * w) / 2 + 1, _ => unreachable!(), }; println!("{}", ans); }
Submission Info
Submission Time | |
---|---|
Task | B - Bishop |
User | bouzuya |
Language | Rust (1.42.0) |
Score | 200 |
Code Size | 364 Byte |
Status | AC |
Exec Time | 6 ms |
Memory | 2172 KB |
Compile Error
warning: unused import: `marker::Usize1` --> src/main.rs:1:23 | 1 | use proconio::{input, marker::Usize1}; | ^^^^^^^^^^^^^^ | = note: `#[warn(unused_imports)]` on by default
Judge Result
Set Name | Sample | All | ||||
---|---|---|---|---|---|---|
Score / Max Score | 0 / 0 | 200 / 200 | ||||
Status |
|
|
Set Name | Test Cases |
---|---|
Sample | example0.txt, example1.txt, example2.txt |
All | 000.txt, 001.txt, 002.txt, 003.txt, 004.txt, 005.txt, 006.txt, example0.txt, example1.txt, example2.txt |
Case Name | Status | Exec Time | Memory |
---|---|---|---|
000.txt | AC | 6 ms | 1984 KB |
001.txt | AC | 2 ms | 2036 KB |
002.txt | AC | 1 ms | 2028 KB |
003.txt | AC | 1 ms | 1960 KB |
004.txt | AC | 1 ms | 1908 KB |
005.txt | AC | 2 ms | 2024 KB |
006.txt | AC | 1 ms | 2172 KB |
example0.txt | AC | 2 ms | 2020 KB |
example1.txt | AC | 1 ms | 2076 KB |
example2.txt | AC | 2 ms | 1980 KB |