結果
問題 | No.586 ダブルブッキング |
ユーザー | Ffalconoke |
提出日時 | 2017-12-09 15:21:33 |
言語 | Java21 (openjdk 21) |
結果 |
WA
|
実行時間 | - |
コード長 | 650 bytes |
コンパイル時間 | 3,614 ms |
コンパイル使用メモリ | 72,952 KB |
実行使用メモリ | 57,424 KB |
最終ジャッジ日時 | 2023-08-20 03:15:38 |
合計ジャッジ時間 | 4,704 ms |
ジャッジサーバーID (参考情報) |
judge11 / judge12 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 118 ms
55,884 KB |
testcase_01 | WA | - |
testcase_02 | AC | 119 ms
55,992 KB |
testcase_03 | WA | - |
testcase_04 | WA | - |
testcase_05 | WA | - |
testcase_06 | AC | 123 ms
55,856 KB |
testcase_07 | WA | - |
ソースコード
import java.util.Scanner; import java.util.*; public class slove{ public static void main(String[] args){ Scanner stdIn = new Scanner(System.in); int P1 = stdIn.nextInt(); int P2 = stdIn.nextInt(); int N = stdIn.nextInt(); int[] R = new int[N]; List<Integer> list = new ArrayList<Integer>(); int count = 0; int loss = 0; for(int i = 0; i < N; i++){ R[i] = stdIn.nextInt(); } for(int i = 0; i < N; i++){ for(int j = i+1; j < N; j++){ if(!list.contains(R[i])){ list.add(R[i]); if(R[i] == R[j]) count++; }else continue; } } loss = P1 * count + P2 * count; System.out.println(loss); } }