Submission #1591905
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 | 811 Byte |
Status | RE |
Exec Time | 386 ms |
Memory | 48416 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 | 97 ms | 19028 KB |
0_001.txt | AC | 108 ms | 20948 KB |
0_002.txt | RE | 94 ms | 20820 KB |
1_003.txt | RE | 94 ms | 20948 KB |
1_004.txt | AC | 386 ms | 48356 KB |
1_005.txt | RE | 94 ms | 20820 KB |
1_006.txt | RE | 97 ms | 20564 KB |
1_007.txt | RE | 95 ms | 22740 KB |
1_008.txt | AC | 380 ms | 48416 KB |