結果

問題 No.586 ダブルブッキング
ユーザー yuasa0000yuasa0000
提出日時 2019-02-25 16:44:52
言語 C++11
(gcc 11.4.0)
結果
WA  
実行時間 -
コード長 372 bytes
コンパイル時間 409 ms
コンパイル使用メモリ 51,592 KB
実行使用メモリ 4,388 KB
最終ジャッジ日時 2023-08-27 02:25:24
合計ジャッジ時間 1,090 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,384 KB
testcase_01 WA -
testcase_02 AC 2 ms
4,380 KB
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 AC 2 ms
4,376 KB
testcase_07 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
int main() {
	int P,FP,N;
	std::cin >> P >> FP >> N;
	int* R = new int[N];

	for (int i = 0; i < N; i++) {
		std::cin >> R[i];
	}

	int LostMoney = 0;

	if (N >= 2) {
		for (int i = 1; i < N; i++) {
			for (int j = 0; j < i; j++) {
				if (R[i] == R[j]) {
					LostMoney += P + FP;
				}
			}
		}
	}

	std::cout << LostMoney << std::endl;

	return 0;
}
0