結果

問題 No.586 ダブルブッキング
ユーザー Mcpu3Mcpu3
提出日時 2018-07-02 23:43:56
言語 Java21
(openjdk 21)
結果
AC  
実行時間 129 ms / 2,000 ms
コード長 359 bytes
コンパイル時間 4,320 ms
コンパイル使用メモリ 72,772 KB
実行使用メモリ 56,172 KB
最終ジャッジ日時 2023-09-13 17:06:11
合計ジャッジ時間 3,528 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 122 ms
55,928 KB
testcase_01 AC 121 ms
56,036 KB
testcase_02 AC 126 ms
55,740 KB
testcase_03 AC 129 ms
55,600 KB
testcase_04 AC 121 ms
56,172 KB
testcase_05 AC 129 ms
55,584 KB
testcase_06 AC 120 ms
53,608 KB
testcase_07 AC 119 ms
55,504 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

class no586{
	public static void main(String[] args) {
		Scanner stdIn=new Scanner(System.in);
		int p1=stdIn.nextInt(),p2=stdIn.nextInt(),n=stdIn.nextInt(),r,a[]=new int[999],i,s=0;
		for(i=0;i<n;i++) {
			r=stdIn.nextInt();
			a[r-1]++;
		}
		for(i=0;i<999;i++)if(a[i]>0)s+=a[i]-1;
		System.out.print((p1+p2)*s);
	}
}
0