結果
問題 |
No.2923 Mayor's Job
|
ユーザー |
![]() |
提出日時 | 2024-10-17 00:28:21 |
言語 | C++23 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 9 ms / 2,000 ms |
コード長 | 641 bytes |
コンパイル時間 | 3,036 ms |
コンパイル使用メモリ | 249,060 KB |
実行使用メモリ | 6,824 KB |
最終ジャッジ日時 | 2024-10-17 00:28:26 |
合計ジャッジ時間 | 4,335 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 17 |
ソースコード
#include <bits/stdc++.h> using namespace std; #ifdef LOCAL #include "settings/debug.cpp" #else #define Debug(...) void(0) #endif #define rep(i, n) for (int i = 0; i < (n); ++i) using ll = long long; using ull = unsigned long long; int main() { ll n, k; cin >> n >> k; vector<ll> a(n); rep(i, n) cin >> a[i]; vector<pair<ll, ll>> v(n); rep(i, n) cin >> v[i].first >> v[i].second; int ans = n; rep(i, n) rep(j, n) { auto [x1, y1] = v[i]; auto [x2, y2] = v[j]; if ((x1 - x2) * (x1 - x2) + (y1 - y2) * (y1 - y2) <= k * k && a[i] < a[j]) { ans--; break; } } cout << ans << endl; return 0; }