結果

問題 No.586 ダブルブッキング
ユーザー joe_tb_joejoe_tb_joe
提出日時 2017-11-22 23:36:07
言語 C++11
(gcc 11.4.0)
結果
WA  
実行時間 -
コード長 356 bytes
コンパイル時間 421 ms
コンパイル使用メモリ 54,616 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-05-04 21:10:04
合計ジャッジ時間 923 ms
ジャッジサーバーID
(参考情報)
judge3 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

#include <iostream>

using namespace std;

int main(){
	int a, b, n;
	cin >> a;
	cin >> b;
	cin >> n;

	int c[n];

	for(int i = 0; i < n; i++){
		cin >> c[i];
	}

	int count = 0;
	for(int i = 0; i < n; i++){
		for(int j = i + 1; j < n; j++){
			if(c[i] == c[j]) count++;
		}		
	}

	cout << (a + b) * count / 2 << endl;
	return 0;
}
0