Submission #1800630
Source Code Expand
use std::io; fn next_vec() -> Vec<i64> { let mut buf = String::new(); io::stdin().read_line(&mut buf).unwrap(); buf.split_whitespace().map(|n| n.parse().unwrap()).collect() } fn main() { let v = next_vec(); let n = v[0]; let a = v[1]; let b = v[2]; let minimum = a * (n - 1) + b; let maximum = a + b * (n - 1); let ans = maximum - minimum + 1; println!("{:?}", if ans < 0 {0} else {ans}); }
Submission Info
Submission Time | |
---|---|
Task | A - A+...+B Problem |
User | nicklaw296 |
Language | C++14 (GCC 5.4.1) |
Score | 0 |
Code Size | 457 Byte |
Status | CE |
Compile Error
./Main.cpp:1:1: error: ‘use’ does not name a type use std::io; ^ ./Main.cpp:3:1: error: ‘fn’ does not name a type fn next_vec() -> Vec<i64> { ^ ./Main.cpp:9:1: error: ‘fn’ does not name a type fn main() { ^