Submission #1309659
Source Code Expand
//D using System; using System.Collections; using System.Collections.Generic; using System.Linq; using System.IO; using System.Text; using System.Globalization; using System.Diagnostics; class Myon { public Myon() { } public static int Main() { new Myon().calc(); return 0; } Scanner cin; void calc() { cin = new Scanner(); long N, A, B; N = cin.nextLong(); A = cin.nextLong(); B = cin.nextLong(); long ans = Math.Max(0, (A + B * (N - 1)) - (A * (N - 1) + B) + 1); Console.WriteLine(ans); } } class Scanner { string[] s; int i; char[] cs = new char[] { ' ' }; public Scanner() { s = new string[0]; i = 0; } public string next() { if (i < s.Length) return s[i++]; string st = Console.ReadLine(); while (st == "") st = Console.ReadLine(); s = st.Split(cs, StringSplitOptions.RemoveEmptyEntries); i = 0; return s[i++]; } public int nextInt() { return int.Parse(next()); } public long nextLong() { return long.Parse(next()); } public double nextDouble() { return double.Parse(next()); } }
Submission Info
Submission Time | |
---|---|
Task | A - A+...+B Problem |
User | chokudai |
Language | C# (Mono 4.6.2.0) |
Score | 200 |
Code Size | 1346 Byte |
Status | AC |
Exec Time | 21 ms |
Memory | 13140 KB |
Judge Result
Set Name | Sample | All | ||||
---|---|---|---|---|---|---|
Score / Max Score | 0 / 0 | 200 / 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 | AC | 21 ms | 11220 KB |
02.txt | AC | 20 ms | 11092 KB |
03.txt | AC | 20 ms | 11092 KB |
04.txt | AC | 20 ms | 11092 KB |
05.txt | AC | 20 ms | 11092 KB |
06.txt | AC | 20 ms | 9044 KB |
07.txt | AC | 20 ms | 9044 KB |
08.txt | AC | 20 ms | 9044 KB |
s1.txt | AC | 21 ms | 13140 KB |
s2.txt | AC | 20 ms | 9044 KB |
s3.txt | AC | 20 ms | 11092 KB |
s4.txt | AC | 20 ms | 9044 KB |