Submission #1591902
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<100000; j++){ if (A[j]>max) max=A[j]; } System.out.println(max); } }
Submission Info
Submission Time | |
---|---|
Task | C - Together |
User | lucy2903 |
Language | Java7 (OpenJDK 1.7.0) |
Score | 0 |
Code Size | 794 Byte |
Status | RE |
Exec Time | 407 ms |
Memory | 48852 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 | 118 ms | 19156 KB |
0_001.txt | AC | 108 ms | 19284 KB |
0_002.txt | RE | 95 ms | 19028 KB |
1_003.txt | RE | 93 ms | 18772 KB |
1_004.txt | AC | 387 ms | 48852 KB |
1_005.txt | RE | 94 ms | 19028 KB |
1_006.txt | RE | 94 ms | 18900 KB |
1_007.txt | RE | 94 ms | 17108 KB |
1_008.txt | AC | 407 ms | 47944 KB |