Submission #174279
Source Code Expand
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner in = new Scanner(System.in); int n = in.nextInt(); int first = 0, second = 0; for (int i = 0; i < n; i++) { int a = in.nextInt(); if (a > first) { second = first; first = a; } else if (a < first && a > second) { second = a; } } System.out.println(second); } }
Submission Info
Submission Time | |
---|---|
Task | B - 心配性な富豪、ファミリーレストランに行く。 |
User | sugim48 |
Language | Java (OpenJDK 1.7.0) |
Score | 100 |
Code Size | 411 Byte |
Status | AC |
Exec Time | 539 ms |
Memory | 23728 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 | 485 ms | 23608 KB |
random_10.txt | AC | 492 ms | 23352 KB |
random_2.txt | AC | 481 ms | 23600 KB |
random_3.txt | AC | 475 ms | 23604 KB |
random_4.txt | AC | 480 ms | 23600 KB |
random_5.txt | AC | 482 ms | 23668 KB |
random_6.txt | AC | 495 ms | 23604 KB |
random_7.txt | AC | 539 ms | 23372 KB |
random_8.txt | AC | 500 ms | 23728 KB |
random_9.txt | AC | 495 ms | 23476 KB |
sample_1.txt | AC | 491 ms | 23224 KB |
sample_2.txt | AC | 521 ms | 23220 KB |
sample_3.txt | AC | 501 ms | 23184 KB |
small_1.txt | AC | 490 ms | 23216 KB |
small_2.txt | AC | 489 ms | 23092 KB |
small_3.txt | AC | 488 ms | 23216 KB |
small_4.txt | AC | 480 ms | 23084 KB |
small_5.txt | AC | 495 ms | 23088 KB |