結果
問題 | No.1265 Balloon Survival |
ユーザー | sirogamichan1 |
提出日時 | 2020-10-23 23:33:59 |
言語 | C++14 (gcc 12.3.0 + boost 1.83.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 3,399 bytes |
コンパイル時間 | 4,920 ms |
コンパイル使用メモリ | 346,624 KB |
実行使用メモリ | 6,944 KB |
最終ジャッジ日時 | 2024-07-21 13:30:57 |
合計ジャッジ時間 | 6,577 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 2 ms
5,248 KB |
testcase_01 | AC | 2 ms
5,376 KB |
testcase_02 | AC | 2 ms
5,376 KB |
testcase_03 | AC | 2 ms
5,376 KB |
testcase_04 | WA | - |
testcase_05 | WA | - |
testcase_06 | WA | - |
testcase_07 | AC | 2 ms
5,376 KB |
testcase_08 | WA | - |
testcase_09 | AC | 2 ms
5,376 KB |
testcase_10 | WA | - |
testcase_11 | WA | - |
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 | WA | - |
testcase_21 | WA | - |
testcase_22 | WA | - |
testcase_23 | WA | - |
testcase_24 | WA | - |
testcase_25 | WA | - |
testcase_26 | WA | - |
testcase_27 | WA | - |
testcase_28 | WA | - |
testcase_29 | WA | - |
testcase_30 | WA | - |
testcase_31 | WA | - |
testcase_32 | WA | - |
testcase_33 | WA | - |
testcase_34 | AC | 2 ms
5,376 KB |
testcase_35 | WA | - |
ソースコード
////////////////////////////// // Check before you submit. // #define _ATCODER_LIBRARY const long long MOD = 1e9+7; // const long long MOD = 998244353; ///////////////////////////// #include <bits/stdc++.h> using namespace std; #include <boost/multiprecision/cpp_int.hpp> using namespace boost::multiprecision; #ifdef _ATCODER_LIBRARY #include <atcoder/all> using namespace atcoder; #endif // _ATCODER_LIBRARY const long long INF = 1LL << 60; using ll = long long; using P = pair<ll, ll>; #define FOR(i,a,b) for (ll i=(a);i<(ll)(b);++i) #define REP(i,n) FOR(i,0,n) #define ALL(v) (v).begin(),(v).end() #define SUM(v) accumulate(ALL(v),0ll) template<typename T>istream& operator>>(istream&i,vector<T>&v){REP(j,v.size())i>>v[j];return i;} template<typename T>string join(vector<T>&v){stringstream s;REP(i,v.size())s<<' '<<v[i];return s.str().substr(1);} template<typename T>ostream& operator<<(ostream&o,vector<T>&v){if(v.size())o<<join(v);return o;} template<typename T>string join(vector<vector<T>>&vv){string s="\n";REP(i,vv.size())s+=join(vv[i])+"\n";return s;} template<typename T>ostream& operator<<(ostream&o,vector<vector<T>>&vv){if(vv.size())o<<join(vv);return o;} template<typename T1,typename T2>istream& operator>>(istream&i,pair<T1,T2>&v){return i>>v.first>>v.second;} template<typename T1,typename T2>ostream& operator<<(ostream&o,pair<T1,T2>&v){return o<<v.first<<","<<v.second;} #define DEBUG(x); #ifdef _DEBUG #define DEBUG(x) std::cerr << #x << " : " << (x) << std::endl; #define GLIBCXX_DEBUG #define GLIBCXX_DEBUG_PEDANTIC #endif // _DEBUG int dx[4]{0, 1, 0, -1}; int dy[4]{1, 0, -1, 0}; void init_init_init() {ios_base::sync_with_stdio(false);cin.tie(NULL);std::cout<<fixed<<setprecision(10);} template<class T>T up(T a, T b){assert(b);return (a+b-1)/b;} template<typename... A>bool eq(A const&... a){auto t={a...};assert(t.size());auto tar=*t.begin();for(const auto&e:t)if(tar!=e)return false;return true;} template<class T>bool chmin(T &a, T b){if(a>b){a=b;return false;}return true;} template<class T>bool chmax(T &a, T b){if(a<b){a=b;return false;}return true;} template<class T>bool chmax(T &a, initializer_list<T>l){return chmax(a,max(l));} template<class T>bool chmin(T &a, initializer_list<T>l){return chmin(a,min(l));} ////////////////////////////////////////////////////////////////// // My Library ////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////// // Contest Code ////////////////////////////////////////////////////////////////// int main(int argc, char **argv) { init_init_init(); ll N; cin >> N; vector<ll> x(N), y(N); REP(i, N) cin >> x[i] >> y[i]; ll res{0}; auto f = [](ll x1, ll x2, ll y1, ll y2) { return sqrt(pow(x1-x2, 2) + pow(y1-y2, 2)); }; set<ll> is; set<ll> del; while (true) { ll j{-1}; double ma{INF}; REP(i, N) { if (del.count(i)) continue; if (is.count(i)) continue; if (i == 0) continue; long double t = f(x[0], x[i], y[0], y[i]); if (ma >= t) { j = i; ma = t; } DEBUG(ma); } if (j == -1) break; double mmi{INF}; REP(i, N) { if (del.count(i)) continue; if (i == 0) continue; if (i == j) continue; chmin(mmi, f(x[j], x[i], y[j], y[i])); DEBUG(mmi); } if (ma <= mmi) del.insert(j); is.insert(j); } std::cout << del.size() << std::endl; }