Submission #174287
Source Code Expand
import java.util.*; import java.io.*; import static java.util.Arrays.*; import static java.util.Collections.*; import static java.lang.Math.*; public class Main { int INF = 1 << 28; //long INF = 1L << 62; double EPS = 1e-10; void run() { Scanner sc = new Scanner(System.in); int n = sc.nextInt(); HashSet<Integer> set = new HashSet<Integer>(); for (int i=0;i<n;i++) set.add(sc.nextInt()); Integer[] a = set.toArray(new Integer[]{}); sort(a); System.out.println(a[max(a.length-2, 0)]); } void debug(Object... os) { System.err.println(Arrays.deepToString(os)); } public static void main(String[] args) { new Main().run(); } }
Submission Info
Submission Time | |
---|---|
Task | B - 心配性な富豪、ファミリーレストランに行く。 |
User | nyama |
Language | Java (OpenJDK 1.7.0) |
Score | 100 |
Code Size | 690 Byte |
Status | AC |
Exec Time | 587 ms |
Memory | 23952 KB |
Judge Result
Set Name | All | ||
---|---|---|---|
Score / Max Score | 100 / 100 | ||
Status |
|
Set Name | Test Cases |
---|---|
All | random_1.txt, random_10.txt, random_2.txt, random_3.txt, random_4.txt, random_5.txt, random_6.txt, random_7.txt, random_8.txt, random_9.txt, small_1.txt, small_2.txt, small_3.txt, small_4.txt, small_5.txt |
Case Name | Status | Exec Time | Memory |
---|---|---|---|
random_1.txt | AC | 475 ms | 23860 KB |
random_10.txt | AC | 493 ms | 23848 KB |
random_2.txt | AC | 474 ms | 23728 KB |
random_3.txt | AC | 465 ms | 23824 KB |
random_4.txt | AC | 477 ms | 23952 KB |
random_5.txt | AC | 476 ms | 23852 KB |
random_6.txt | AC | 469 ms | 23852 KB |
random_7.txt | AC | 488 ms | 23900 KB |
random_8.txt | AC | 587 ms | 23856 KB |
random_9.txt | AC | 471 ms | 23720 KB |
sample_1.txt | AC | 464 ms | 23464 KB |
sample_2.txt | AC | 480 ms | 23336 KB |
sample_3.txt | AC | 477 ms | 23340 KB |
small_1.txt | AC | 452 ms | 23340 KB |
small_2.txt | AC | 517 ms | 23348 KB |
small_3.txt | AC | 462 ms | 23460 KB |
small_4.txt | AC | 504 ms | 23468 KB |
small_5.txt | AC | 502 ms | 23468 KB |