結果

問題 No.1265 Balloon Survival
ユーザー kyoprounokyoprouno
提出日時 2020-10-23 22:19:00
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 1,180 bytes
コンパイル時間 1,916 ms
コンパイル使用メモリ 174,964 KB
実行使用メモリ 4,504 KB
最終ジャッジ日時 2023-09-28 16:10:57
合計ジャッジ時間 3,366 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,380 KB
testcase_01 AC 1 ms
4,380 KB
testcase_02 AC 1 ms
4,376 KB
testcase_03 AC 2 ms
4,380 KB
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 AC 1 ms
4,380 KB
testcase_08 WA -
testcase_09 AC 1 ms
4,376 KB
testcase_10 AC 2 ms
4,376 KB
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 AC 2 ms
4,380 KB
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
testcase_19 WA -
testcase_20 AC 2 ms
4,376 KB
testcase_21 WA -
testcase_22 WA -
testcase_23 WA -
testcase_24 AC 3 ms
4,380 KB
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
4,384 KB
testcase_35 AC 1 ms
4,380 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#pragma GCC optimize("O3")
#include <bits/stdc++.h>
#define ll long long
#define rep(i,n) for(int i=0;i<(n);i++)
#define pll pair<ll,ll>
#define pii pair<int,int>
#define pq priority_queue
#define pb push_back
#define eb emplace_back
#define fi first
#define se second
#define endl '\n'
#define ios ios_base::sync_with_stdio(0),cin.tie(0),cout.tie(0);
#define lb(c,x) distance(c.begin(),lower_bound(all(c),x))
#define ub(c,x) distance(c.begin(),upper_bound(all(c),x))

using namespace std;

const ll INF=1e9+10;

int main(){
    ll n;
    cin >> n;
    vector<ll> x(n),y(n);
    rep(i,n){
        cin >> x[i] >> y[i];
    }
    ll sx=x[0],xy=y[0];
    vector<ll> used(n);
    used[0]=1;
    ll ans=0;
    rep(i,n){
        if(used[i]) continue;
        ll ax=abs(x[i]-x[0]),ay=abs(y[i]-y[0]);
        ll ad=ax*ax+ay*ay;
        bool ok=false;
        for(ll j=i+1;j<n;j++){
            if(used[j]) continue;
            ll dx=abs(x[i]-x[j]),dy=abs(y[i]-y[j]);
            ll d=dx*dx+dy*dy;
            if(d<ad){
                used[j]=1;
                ok=true;
                break;
            }
        }
        if(!ok) ans++;
    }
    cout << ans << endl;
    return 0;
}
0