Submission #2866690
Source Code Expand
using System; using System.Linq; using System.Collections.Generic; using static System.Math; public class Program { public static void Main(string[] args) { List<int> number = Console.ReadLine().Split(' ').Select(int.Parse).ToList(); int answer = 0; if(number.Where(x => x % 2 == 1).Count() == 1) { List<int> idx1 = number.Select((n, m) => new {value = n, index = m}).Where(x => x.value % 2 == 0).Select(o => o.index).ToList(); foreach (int k in idx1) number[k]++; answer++; } if (number.Where(x => x % 2 == 1).Count() == 2) { List<int> idx1 = number.Select((n, m) => new { value = n, index = m }).Where(x => x.value % 2 == 0).Select(o => o.index).ToList(); foreach (int k in idx1) number[k]++; answer++; } while(number.GroupBy(x => x).Count() != 1) { if (number.Min() < number.Max()) { int idx; idx = number.IndexOf(number.Min()); number[idx] = number.Min() + 2; answer++; } } Console.WriteLine(answer); } }
Submission Info
Submission Time | |
---|---|
Task | C - Same Integers |
User | ftaka |
Language | C# (Mono 4.6.2.0) |
Score | 0 |
Code Size | 1374 Byte |
Status | WA |
Exec Time | 31 ms |
Memory | 13524 KB |
Judge Result
Set Name | Sample | All | ||||||
---|---|---|---|---|---|---|---|---|
Score / Max Score | 0 / 0 | 0 / 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 | 28 ms | 13524 KB |
02.txt | AC | 29 ms | 13408 KB |
03.txt | AC | 29 ms | 13408 KB |
04.txt | AC | 29 ms | 11360 KB |
05.txt | AC | 31 ms | 11604 KB |
06.txt | AC | 28 ms | 9428 KB |
07.txt | AC | 29 ms | 11360 KB |
08.txt | WA | 31 ms | 9440 KB |
09.txt | AC | 28 ms | 13408 KB |
10.txt | AC | 30 ms | 9556 KB |
11.txt | WA | 30 ms | 9556 KB |
12.txt | AC | 30 ms | 9440 KB |
13.txt | AC | 30 ms | 11604 KB |
s1.txt | AC | 30 ms | 11488 KB |
s2.txt | AC | 30 ms | 11604 KB |
s3.txt | AC | 28 ms | 11360 KB |