Submission #1591900
Source Code Expand
import java.util.*; public class Main { public static void main(String[] args) { Scanner reader= new Scanner(System.in); int num=reader.nextInt(); int[] A= new int[100000]; for(int i=0; i<num; i++){ int x= reader.nextInt(); if (x==0){ A[0]++; A[1]++; } else if(x==9999){ A[9999]++; A[9998]++; } else{ A[x]++; A[x+1]++; A[x-1]++; }} int max=A[0]; for (int j=1; j<10000; j++){ if (A[j]>max) max=A[j]; } System.out.println(max); } }
Submission Info
Submission Time | |
---|---|
Task | C - Together |
User | lucy2903 |
Language | Java8 (OpenJDK 1.8.0) |
Score | 0 |
Code Size | 793 Byte |
Status | RE |
Exec Time | 408 ms |
Memory | 47260 KB |
Judge Result
Set Name | Sample | All | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
Score / Max Score | 0 / 0 | 0 / 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 | 93 ms | 19796 KB |
0_001.txt | AC | 93 ms | 21332 KB |
0_002.txt | RE | 95 ms | 21716 KB |
1_003.txt | RE | 93 ms | 18764 KB |
1_004.txt | AC | 333 ms | 47260 KB |
1_005.txt | RE | 91 ms | 18644 KB |
1_006.txt | RE | 92 ms | 21844 KB |
1_007.txt | RE | 92 ms | 21844 KB |
1_008.txt | WA | 408 ms | 45668 KB |