結果
問題 | No.586 ダブルブッキング |
ユーザー |
![]() |
提出日時 | 2018-06-01 13:00:58 |
言語 | Java (openjdk 23) |
結果 |
AC
|
実行時間 | 142 ms / 2,000 ms |
コード長 | 449 bytes |
コンパイル時間 | 3,604 ms |
コンパイル使用メモリ | 75,992 KB |
実行使用メモリ | 54,272 KB |
最終ジャッジ日時 | 2024-06-30 08:49:19 |
合計ジャッジ時間 | 5,185 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 5 |
ソースコード
import java.util.ArrayList; import java.util.Scanner; public class No586 { public static void main(String[] args) { Scanner s = new Scanner(System.in); int P1 = s.nextInt(); int P2 = s.nextInt(); int N = s.nextInt(); int C = 0; ArrayList<Integer> room = new ArrayList<>(); for(int i=0;i<N;i++){ int R = s.nextInt(); if(!room.contains(R)){ room.add(R); }else{ C += P1 + P2; } } System.out.println(C); } }