Submission #1799392
Source Code Expand
use std::io::*; use std::str::*; const MOD: i32 = 1000000007; fn read<T: FromStr>() -> Option<T> { let stdin = stdin(); let s = stdin .bytes() .map(|c| c.unwrap() as char) .take_while(|c| !c.is_whitespace()) .collect::<String>(); s.parse::<T>().ok() } fn main() { let n: u64 = read().unwrap(); let a: u64 = read().unwrap(); let b: u64 = read().unwrap(); if a > b { println!("{}", 0); return; } if (b - a + 1) > n { println!("{}", 0); return; } println!("{}", (b * (n - 1) + a) - (a * (n - 1) + b) + 1); }
Submission Info
Submission Time | |
---|---|
Task | A - A+...+B Problem |
User | nak3 |
Language | Rust (1.15.1) |
Score | 0 |
Code Size | 649 Byte |
Status | WA |
Exec Time | 2 ms |
Memory | 4352 KB |
Compile Error
warning: constant item is never used: `MOD`, #[warn(dead_code)] on by default --> ./Main.rs:4:1 | 4 | const MOD: i32 = 1000000007; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Judge Result
Set Name | Sample | All | ||||||
---|---|---|---|---|---|---|---|---|
Score / Max Score | 0 / 0 | 0 / 200 | ||||||
Status |
|
|
Set Name | Test Cases |
---|---|
Sample | s1.txt, s2.txt, s3.txt, s4.txt |
All | 01.txt, 02.txt, 03.txt, 04.txt, 05.txt, 06.txt, 07.txt, 08.txt, s1.txt, s2.txt, s3.txt, s4.txt |
Case Name | Status | Exec Time | Memory |
---|---|---|---|
01.txt | WA | 2 ms | 4352 KB |
02.txt | AC | 2 ms | 4352 KB |
03.txt | AC | 2 ms | 4352 KB |
04.txt | AC | 2 ms | 4352 KB |
05.txt | AC | 2 ms | 4352 KB |
06.txt | AC | 2 ms | 4352 KB |
07.txt | AC | 2 ms | 4352 KB |
08.txt | AC | 2 ms | 4352 KB |
s1.txt | AC | 2 ms | 4352 KB |
s2.txt | AC | 2 ms | 4352 KB |
s3.txt | AC | 2 ms | 4352 KB |
s4.txt | AC | 2 ms | 4352 KB |