結果
問題 |
No.586 ダブルブッキング
|
ユーザー |
|
提出日時 | 2018-07-02 23:43:56 |
言語 | Java (openjdk 23) |
結果 |
AC
|
実行時間 | 143 ms / 2,000 ms |
コード長 | 359 bytes |
コンパイル時間 | 2,017 ms |
コンパイル使用メモリ | 73,852 KB |
実行使用メモリ | 54,188 KB |
最終ジャッジ日時 | 2024-07-01 01:42:03 |
合計ジャッジ時間 | 3,757 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 5 |
ソースコード
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); } }