Submission #174283


Source Code Expand

using System;
using System.Collections;
using System.Collections.Generic;
 
class TEST{
	static void Main(){
		Sol mySol =new Sol();
		mySol.Solve();
	}
}

class Sol{
	public void Solve(){
		Array.Sort(A);
		int ans=0;
		for(int j=N-2;j>=0;j--){
			if(A[j]!=A[N-1]){
				ans=A[j];
				break;
			}
		}
		Console.WriteLine("{0}",ans);
	}
	int N;
	int[] A;
	public Sol(){
		N=ri();
		A=new int[N];
		for(int i=0;i<N;i++)A[i]=ri();
	}




	static String rs(){return Console.ReadLine();}
	static int ri(){return int.Parse(Console.ReadLine());}
	static long rl(){return long.Parse(Console.ReadLine());}
	static double rd(){return double.Parse(Console.ReadLine());}
	static String[] rsa(){return Console.ReadLine().Split(' ');}
	static int[] ria(){return Array.ConvertAll(Console.ReadLine().Split(' '),e=>int.Parse(e));}
	static long[] rla(){return Array.ConvertAll(Console.ReadLine().Split(' '),e=>long.Parse(e));}
	static double[] rda(){return Array.ConvertAll(Console.ReadLine().Split(' '),e=>double.Parse(e));}
}

Submission Info

Submission Time
Task B - 心配性な富豪、ファミリーレストランに行く。
User kuuso
Language C# (Mono 2.10.8.1)
Score 100
Code Size 1053 Byte
Status AC
Exec Time 155 ms
Memory 7864 KB

Judge Result

Set Name All
Score / Max Score 100 / 100
Status
AC × 15
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 150 ms 7856 KB
random_10.txt AC 138 ms 7864 KB
random_2.txt AC 141 ms 7784 KB
random_3.txt AC 139 ms 7852 KB
random_4.txt AC 142 ms 7856 KB
random_5.txt AC 155 ms 7776 KB
random_6.txt AC 146 ms 7856 KB
random_7.txt AC 153 ms 7856 KB
random_8.txt AC 149 ms 7816 KB
random_9.txt AC 143 ms 7860 KB
sample_1.txt AC 152 ms 7860 KB
sample_2.txt AC 138 ms 7864 KB
sample_3.txt AC 146 ms 7864 KB
small_1.txt AC 145 ms 7852 KB
small_2.txt AC 145 ms 7864 KB
small_3.txt AC 153 ms 7776 KB
small_4.txt AC 146 ms 7856 KB
small_5.txt AC 139 ms 7860 KB