結果

問題 No.21 平均の差
ユーザー Mcpu3Mcpu3
提出日時 2018-07-02 23:39:52
言語 Java21
(openjdk 21)
結果
AC  
実行時間 121 ms / 5,000 ms
コード長 314 bytes
コンパイル時間 2,799 ms
コンパイル使用メモリ 71,832 KB
実行使用メモリ 56,308 KB
最終ジャッジ日時 2023-09-13 17:05:45
合計ジャッジ時間 4,811 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 121 ms
55,768 KB
testcase_01 AC 119 ms
54,252 KB
testcase_02 AC 119 ms
56,096 KB
testcase_03 AC 119 ms
55,484 KB
testcase_04 AC 120 ms
55,952 KB
testcase_05 AC 120 ms
56,308 KB
testcase_06 AC 120 ms
56,060 KB
testcase_07 AC 120 ms
55,840 KB
testcase_08 AC 120 ms
56,128 KB
testcase_09 AC 119 ms
56,048 KB
権限があれば一括ダウンロードができます

ソースコード

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