結果

問題 No.21 平均の差
ユーザー Mcpu3
提出日時 2018-07-02 23:39:52
言語 Java
(openjdk 23)
結果
AC  
実行時間 135 ms / 5,000 ms
コード長 314 bytes
コンパイル時間 3,187 ms
コンパイル使用メモリ 74,172 KB
実行使用メモリ 54,180 KB
最終ジャッジ日時 2024-07-01 01:41:42
合計ジャッジ時間 4,493 ms
ジャッジサーバーID
(参考情報)
judge4 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 10
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

class no21{
	public static void main(String[] args) {
		Scanner stdIn=new Scanner(System.in);
		int n=stdIn.nextInt(),k=stdIn.nextInt(),a,i,min=1000,max=0;
		for(i=0;i<n;i++) {
			a=stdIn.nextInt();
			if(min>a)min=a;
			if(a>max)max=a;
		}
		System.out.print(max-min);
	}
}
0