Submission #2243571
Source Code Expand
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Diagnostics; using System.IO; namespace AtCoder { class Program { private static string Read() { return Console.ReadLine(); } private static int ReadInt() { return int.Parse(Read()); } private static long ReadLong() { return long.Parse(Read()); } private static double ReadDouble() { return double.Parse(Read()); } private static int[] ReadInts() { return Array.ConvertAll(Read().Split(), int.Parse); } private static long[] ReadLongs() { return Array.ConvertAll(Read().Split(), long.Parse); } private static double[] ReadDoubles() { return Array.ConvertAll(Read().Split(), double.Parse); } static int Solve(int[] A) { int[] counts = new int[100002]; foreach (int a in A) { ++counts[a + 0]; ++counts[a + 1]; ++counts[a + 2]; } return counts.Max(); } static void Main(string[] args) { int N = ReadInt(); Console.WriteLine(Solve(ReadInts())); } } }
Submission Info
Submission Time | |
---|---|
Task | C - Together |
User | M_Saito |
Language | C# (Mono 4.6.2.0) |
Score | 300 |
Code Size | 1235 Byte |
Status | AC |
Exec Time | 57 ms |
Memory | 19296 KB |
Judge Result
Set Name | Sample | All | ||||
---|---|---|---|---|---|---|
Score / Max Score | 0 / 0 | 300 / 300 | ||||
Status |
|
|
Set Name | Test Cases |
---|---|
Sample | 0_000.txt, 0_001.txt, 0_002.txt |
All | 0_000.txt, 0_001.txt, 0_002.txt, 1_003.txt, 1_004.txt, 1_005.txt, 1_006.txt, 1_007.txt, 1_008.txt |
Case Name | Status | Exec Time | Memory |
---|---|---|---|
0_000.txt | AC | 23 ms | 13252 KB |
0_001.txt | AC | 23 ms | 11360 KB |
0_002.txt | AC | 23 ms | 9312 KB |
1_003.txt | AC | 23 ms | 11360 KB |
1_004.txt | AC | 46 ms | 16224 KB |
1_005.txt | AC | 56 ms | 15328 KB |
1_006.txt | AC | 55 ms | 15328 KB |
1_007.txt | AC | 56 ms | 15328 KB |
1_008.txt | AC | 57 ms | 19296 KB |