結果
問題 | No.586 ダブルブッキング |
ユーザー |
![]() |
提出日時 | 2018-04-14 16:08:48 |
言語 | Java (openjdk 23) |
結果 |
AC
|
実行時間 | 142 ms / 2,000 ms |
コード長 | 600 bytes |
コンパイル時間 | 2,268 ms |
コンパイル使用メモリ | 75,744 KB |
実行使用メモリ | 54,320 KB |
最終ジャッジ日時 | 2024-06-26 22:17:17 |
合計ジャッジ時間 | 4,012 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 5 |
ソースコード
import java.util.*; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); StringBuilder sb = new StringBuilder(); int p1 = sc.nextInt(); int p2 = sc.nextInt(); int n = sc.nextInt(); int count = 0; List<Integer> list = new ArrayList<>(); for(int i = 0 ; i < n; i++) { int r = sc.nextInt(); if(list.contains(r)) { count++; } else { list.add(r); } } System.out.println( count*(p1+p2) ); } }