Submission #1368824
Source Code Expand
using System; using System.Collections; using System.Collections.Generic; using System.Diagnostics; using System.IO; using System.Linq; using System.Text; namespace ABC009 { class MainClass { public static void Main(string[] args) { new MainClass().solve(); } Scanner cin; int N; int[] A = new int[1001]; bool passMost = false; void solve() { cin = new Scanner(); N = cin.nextInt(); for (int i = 0; i < N; i++) A[i] = 0; for (int i = 0; i < N; i++) A[cin.nextInt()]++; for(int i = A.Length - 1; i >= 0; i--) { if (A[i] != 0) { if (!passMost) passMost = true; else { Console.WriteLine(i); break; } } } } } class Scanner { string[] nextBuffer; int BufferCnt; char[] cs = new char[] { ' ' }; public Scanner() { nextBuffer = new string[0]; BufferCnt = 0; } public string next() { if (BufferCnt < nextBuffer.Length) return nextBuffer[BufferCnt++]; string st = Console.ReadLine(); while (st == "") st = Console.ReadLine(); nextBuffer = st.Split(cs, StringSplitOptions.RemoveEmptyEntries); BufferCnt = 0; return nextBuffer[BufferCnt++]; } public int nextInt() { return int.Parse(next()); } public long nextLong() { return long.Parse(next()); } public double nextDouble() { return double.Parse(next()); } } }
Submission Info
Submission Time | |
---|---|
Task | B - 心配性な富豪、ファミリーレストランに行く。 |
User | rui0422 |
Language | C# (Mono 4.6.2.0) |
Score | 100 |
Code Size | 1901 Byte |
Status | AC |
Exec Time | 21 ms |
Memory | 13140 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, sample_1.txt, sample_2.txt, sample_3.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 | 20 ms | 9044 KB |
random_10.txt | AC | 21 ms | 11092 KB |
random_2.txt | AC | 20 ms | 11092 KB |
random_3.txt | AC | 21 ms | 11092 KB |
random_4.txt | AC | 20 ms | 9044 KB |
random_5.txt | AC | 20 ms | 9044 KB |
random_6.txt | AC | 21 ms | 11092 KB |
random_7.txt | AC | 21 ms | 13140 KB |
random_8.txt | AC | 21 ms | 11092 KB |
random_9.txt | AC | 20 ms | 9044 KB |
sample_1.txt | AC | 20 ms | 11092 KB |
sample_2.txt | AC | 20 ms | 9044 KB |
sample_3.txt | AC | 20 ms | 9172 KB |
small_1.txt | AC | 20 ms | 9172 KB |
small_2.txt | AC | 20 ms | 9044 KB |
small_3.txt | AC | 20 ms | 9044 KB |
small_4.txt | AC | 21 ms | 11092 KB |
small_5.txt | AC | 20 ms | 9044 KB |