結果

問題 No.2923 Mayor's Job
ユーザー may17may17
提出日時 2024-10-12 15:18:29
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 841 bytes
コンパイル時間 2,451 ms
コンパイル使用メモリ 210,484 KB
実行使用メモリ 5,248 KB
最終ジャッジ日時 2024-10-12 15:18:36
合計ジャッジ時間 3,286 ms
ジャッジサーバーID
(参考情報)
judge4 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

#include <bits/stdc++.h>
//#include<atcoder/all>
using namespace std;
//using namespace atcoder;
using ll = long long;
const ll mod = 1000000007;
//const ll mod = 998244353;
int dx[4] = { 0,1,0,-1 }, dy[4] = { -1,0,1,0 };
ll n,k, h[2009], x[2009], y[2009];
vector < tuple <ll, ll, ll>>T;
int main() {
	cin >> n >> k;
	for (int i = 1; i <= n; i++)cin >> h[i];
	for (int i = 1; i <= n; i++) {
		cin >> x[i] >> y[i];
		T.emplace_back(h[i], x[i], y[i]);
	}
	sort(T.begin(), T.end());
	ll ans = n;
	for (int i = 0; i < n; i++) {
		bool ok = false;
		for (int j = i + 1; j < n; j++) {
			if (get<0>(T[i]) >=get<0>(T[j]))continue;
			ll len = (get<1>(T[j]) - get<1>(T[i])) * (get<1>(T[j]) - get<1>(T[i])) + (get<2>(T[j]) - get<1>(T[2])) * (get<2>(T[j]) - get<2>(T[i]));
			if (len <= k * k)ok = true;
		}
		if (ok)ans--;
	}
	cout << ans << endl;
}
0