Submission #2866213
Source Code Expand
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace test { class Program { static void Main(string[] args) { var input = Console.ReadLine().Split(' ').Select(s => int.Parse(s)).ToArray(); var A = input[0]; var B = input[1]; var C = input[2]; var max = Math.Max(A, Math.Max(B, C)); var min = Math.Min(A, Math.Max(B, C)); var mid = A + B + C - max - min; var even = new bool[] { max % 2 == 0 ? true : false, min % 2 == 0 ? true : false, mid % 2 == 0 ? true : false }; var ans = 0; if (even[0] == even[1] && even[1] == even[2]) { ans += (2 * max - min - mid) / 2; } else if (even[1] == even[2]) { ans++; ans += (2 * max - min - mid - 2) / 2; } else { ans++; ans += (2 * max - min - mid + 1) / 2; } Console.WriteLine(ans); } } }
Submission Info
Submission Time | |
---|---|
Task | C - Same Integers |
User | mochiii |
Language | C# (Mono 4.6.2.0) |
Score | 300 |
Code Size | 1249 Byte |
Status | AC |
Exec Time | 24 ms |
Memory | 13268 KB |
Judge Result
Set Name | Sample | All | ||||
---|---|---|---|---|---|---|
Score / Max Score | 0 / 0 | 300 / 300 | ||||
Status |
|
|
Set Name | Test Cases |
---|---|
Sample | s1.txt, s2.txt, s3.txt |
All | 01.txt, 02.txt, 03.txt, 04.txt, 05.txt, 06.txt, 07.txt, 08.txt, 09.txt, 10.txt, 11.txt, 12.txt, 13.txt, s1.txt, s2.txt, s3.txt |
Case Name | Status | Exec Time | Memory |
---|---|---|---|
01.txt | AC | 23 ms | 9172 KB |
02.txt | AC | 23 ms | 11220 KB |
03.txt | AC | 23 ms | 11220 KB |
04.txt | AC | 23 ms | 9172 KB |
05.txt | AC | 23 ms | 11220 KB |
06.txt | AC | 23 ms | 9300 KB |
07.txt | AC | 23 ms | 13268 KB |
08.txt | AC | 23 ms | 11348 KB |
09.txt | AC | 23 ms | 9172 KB |
10.txt | AC | 22 ms | 11220 KB |
11.txt | AC | 24 ms | 11220 KB |
12.txt | AC | 23 ms | 11220 KB |
13.txt | AC | 23 ms | 11220 KB |
s1.txt | AC | 24 ms | 13268 KB |
s2.txt | AC | 23 ms | 11220 KB |
s3.txt | AC | 23 ms | 11220 KB |