Submission #1780290


Source Code Expand

import java.util.*;

class Main {

    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();
        int[] freq = new int[100002];
        for (int i = 0; i < n; i++) {
            int a = scanner.nextInt() + 1;
            freq[a - 1]++;
            freq[a]++;
            freq[a + 1]++;
        }
        System.out.println(Arrays.stream(freq).max().getAsInt());
    }
}

Submission Info

Submission Time
Task C - Together
User cmplxXyttmt
Language Java8 (OpenJDK 1.8.0)
Score 300
Code Size 462 Byte
Status AC
Exec Time 548 ms
Memory 50560 KB

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 300 / 300
Status
AC × 3
AC × 9
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 324 ms 25296 KB
0_001.txt AC 182 ms 23508 KB
0_002.txt AC 178 ms 24276 KB
1_003.txt AC 179 ms 27092 KB
1_004.txt AC 509 ms 49644 KB
1_005.txt AC 513 ms 50560 KB
1_006.txt AC 529 ms 50316 KB
1_007.txt AC 548 ms 46816 KB
1_008.txt AC 504 ms 49636 KB