結果
問題 | No.586 ダブルブッキング |
ユーザー | sudo_yum |
提出日時 | 2018-05-25 14:37:35 |
言語 | Java21 (openjdk 21) |
結果 |
AC
|
実行時間 | 135 ms / 2,000 ms |
コード長 | 630 bytes |
コンパイル時間 | 1,978 ms |
コンパイル使用メモリ | 71,800 KB |
実行使用メモリ | 56,512 KB |
最終ジャッジ日時 | 2023-09-11 03:26:12 |
合計ジャッジ時間 | 3,755 ms |
ジャッジサーバーID (参考情報) |
judge15 / judge14 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 126 ms
56,056 KB |
testcase_01 | AC | 123 ms
53,892 KB |
testcase_02 | AC | 124 ms
56,512 KB |
testcase_03 | AC | 135 ms
55,728 KB |
testcase_04 | AC | 126 ms
55,816 KB |
testcase_05 | AC | 132 ms
56,232 KB |
testcase_06 | AC | 124 ms
56,224 KB |
testcase_07 | AC | 123 ms
55,840 KB |
ソースコード
import java.util.*; public class Main{ static StringBuilder sb = new StringBuilder(""); public static void main(String[] args) { Scanner sc = new Scanner(System.in); int P1 = sc.nextInt(); int P2 = sc.nextInt(); int nin = sc.nextInt(); int[] heya = new int[nin]; for (int i=0;i<nin ;i++ ) { heya[i] = sc.nextInt(); } sc.close(); Arrays.sort(heya); int temp = heya[0]; int cnt = 0; for (int i=1;i<nin ;i++ ) { if (temp==heya[i]) { cnt++; }else{ temp=heya[i]; } } int result = (P1+P2)*cnt; System.out.println(result); } }