Submission #3043702
Source Code Expand
use std::io; fn main() { let (w, a, b) = { let i = read::<isize>(); (i[0], i[1], i[2]) }; if (a - b).abs() <= w { println!("0"); } else { println!("{}", (a - b).abs() - w); } } #[allow(dead_code)] fn read<T>() -> Vec<T> where T: std::str::FromStr, T::Err: std::fmt::Debug { let mut buf = String::new(); io::stdin().read_line(&mut buf).unwrap(); buf.split_whitespace() .map(|s| s.trim().parse().unwrap()) .collect() } #[allow(dead_code)] fn read_one<T>() -> T where T: std::str::FromStr, T::Err: std::fmt::Debug { let mut buf = String::new(); io::stdin().read_line(&mut buf).unwrap(); buf.trim().parse().unwrap() }
Submission Info
Submission Time | |
---|---|
Task | B - NarrowRectanglesEasy |
User | koka |
Language | Rust (1.15.1) |
Score | 200 |
Code Size | 745 Byte |
Status | AC |
Exec Time | 2 ms |
Memory | 4352 KB |
Judge Result
Set Name | Sample | All | ||||
---|---|---|---|---|---|---|
Score / Max Score | 0 / 0 | 200 / 200 | ||||
Status |
|
|
Set Name | Test Cases |
---|---|
Sample | 0_000.txt, 0_001.txt, 0_002.txt, 0_003.txt |
All | 0_000.txt, 0_001.txt, 0_002.txt, 0_003.txt, 1_004.txt, 1_005.txt, 1_006.txt, 1_007.txt, 1_008.txt, 1_009.txt |
Case Name | Status | Exec Time | Memory |
---|---|---|---|
0_000.txt | AC | 2 ms | 4352 KB |
0_001.txt | AC | 2 ms | 4352 KB |
0_002.txt | AC | 2 ms | 4352 KB |
0_003.txt | AC | 2 ms | 4352 KB |
1_004.txt | AC | 2 ms | 4352 KB |
1_005.txt | AC | 2 ms | 4352 KB |
1_006.txt | AC | 2 ms | 4352 KB |
1_007.txt | AC | 2 ms | 4352 KB |
1_008.txt | AC | 2 ms | 4352 KB |
1_009.txt | AC | 2 ms | 4352 KB |