結果
| 問題 |
No.2923 Mayor's Job
|
| コンテスト | |
| ユーザー |
Andrew8128
|
| 提出日時 | 2024-10-12 14:45:48 |
| 言語 | C++23 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 18 ms / 2,000 ms |
| コード長 | 816 bytes |
| コンパイル時間 | 2,876 ms |
| コンパイル使用メモリ | 248,900 KB |
| 実行使用メモリ | 5,248 KB |
| 最終ジャッジ日時 | 2024-10-12 14:45:58 |
| 合計ジャッジ時間 | 3,714 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 17 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define REP(i, x, y) for (auto i = (x); i < (y); i++)
#define RREP(i, x, y) for (auto i = (y) - 1; (x) <= i; i--)
#define ALL(x) (x).begin(), (x).end()
#pragma GCC optimize("O3")
int main(){
ios::sync_with_stdio(false);
cin.tie(nullptr);
ll N, K;
cin >> N >> K;
vector<int> H(N);
REP(i, 0, N){
cin >> H[i];
}
vector<ll> X(N), Y(N);
REP(i, 0, N){
cin >> X[i] >> Y[i];
}
vector<int> ans(N, 1);
REP(i, 0, N){
REP(j, 0, N){
if(H[i] < H[j]){
if((X[i] - X[j])*(X[i] - X[j]) + (Y[i] - Y[j])*(Y[i] - Y[j]) <= K*K){
ans[i] = 0;
}
}
}
}
cout << accumulate(ALL(ans), 0) << "\n";
return 0;
}
/*
File : ~/yukicoder/midoriika_3rd/E.cpp
Date : 2024/10/12
Time : 14:41:33
*/
Andrew8128