結果

問題 No.1623 三角形の制作
ユーザー ohreitetsuohreitetsu
提出日時 2021-09-15 17:19:38
言語 C++14
(gcc 13.2.0 + boost 1.83.0)
結果
TLE  
実行時間 -
コード長 613 bytes
コンパイル時間 581 ms
コンパイル使用メモリ 71,796 KB
実行使用メモリ 11,472 KB
最終ジャッジ日時 2023-09-11 03:33:06
合計ジャッジ時間 5,776 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ(β)

テストケース

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

ソースコード

diff #

#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
int main()
{
	int n,i,j,k;
	cin >> n;
	vector<int> r(n), g(n), b(n);
	for (i = 0; i < n; i++) {
		cin >> r[i];
	}
	for (i = 0; i < n; i++) {
		cin >> g[i];
	}
	for (i = 0; i < n; i++) {
		cin >> b[i];
	}
	int ans = 0;
	for (i = 0; i < n; i++) {
		for (j = 0; j < n; j++) {
			for (k = 0; k < n; k++) {
				int x = g[j] - b[k];
				if (x < 0) {
					x = -x;
				}
				int y = g[j] + b[k];
				if (r[i] > x && r[i] < y) {
					if (r[i] >= g[j] && r[i] >= b[k]) {
						ans++;
					}
				}
			}
		}
	}
	cout << ans << endl;
	return 0;
}
0