結果

問題 No.1623 三角形の制作
ユーザー atjh16atjh16
提出日時 2021-09-07 20:00:29
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 530 bytes
コンパイル時間 1,629 ms
コンパイル使用メモリ 164,132 KB
実行使用メモリ 4,388 KB
最終ジャッジ日時 2023-08-25 12:18:34
合計ジャッジ時間 4,585 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,380 KB
testcase_01 AC 1 ms
4,380 KB
testcase_02 AC 85 ms
4,380 KB
testcase_03 AC 81 ms
4,380 KB
testcase_04 AC 82 ms
4,380 KB
testcase_05 AC 137 ms
4,380 KB
testcase_06 AC 30 ms
4,376 KB
testcase_07 AC 81 ms
4,380 KB
testcase_08 AC 33 ms
4,380 KB
testcase_09 AC 77 ms
4,380 KB
testcase_10 AC 115 ms
4,380 KB
testcase_11 AC 93 ms
4,380 KB
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
testcase_19 WA -
testcase_20 AC 1 ms
4,380 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;

int n, t;
int r[3001], g[3001], b[3001];
long long m = 0;

int main()
{
	cin >> n;

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

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

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

	for (int i = 1; i <= 3000; i++) {
		b[i] = b[i] + b[i - 1];
	}

	for (int i = 1; i <= 3000; i++) {
		if (r[i] > 0) {
			for (int j = 1; j <= i; j++) {
				m += r[i] * g[j] * (b[i] - b[i - j]);
			}
		}
	}

	cout << m << endl;
}
0