結果

問題 No.1265 Balloon Survival
ユーザー tyonbokuntyonbokun
提出日時 2020-10-23 22:59:46
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 1,390 bytes
コンパイル時間 1,017 ms
コンパイル使用メモリ 109,956 KB
実行使用メモリ 4,504 KB
最終ジャッジ日時 2023-09-28 17:29:41
合計ジャッジ時間 2,633 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

#include <algorithm>
#include <bitset>
#include <chrono>
#include <cmath>
#include <functional>
#include <iomanip>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <unordered_map>
#include <unordered_set>
#include <vector>

using ll = long long;
using vll = std::vector<ll>;
using namespace std;
#define REP(i, x, n) for(int i = x; i < (n); i++)
#define rep(i, n) REP(i, 0, n)
const ll MOD = 1000000007;
template<class T> void gi(T &x){
  int minus=0; x=0; char c=getchar();
  for(;c<'0'||c>'9'; c=getchar()) minus|=(c=='-');
  for(;c>='0'&&c<='9'; c=getchar()) x=(x<<1)+(x<<3)+(c^48);
  if(minus) x=-x;
}
int main() {
  int n; gi(n);
  vector<pair<int,int>> xy;
  rep(i,n){
    int x,y; gi(x);gi(y);
    xy.push_back({x,y});
  }
  vector<bool> chk(n);
  REP(i,1,n){
    if(chk[i]) continue;
    double d0 = sqrt((xy[0].first-xy[i].first)*(xy[0].first-xy[i].first)
      +(xy[0].second-xy[i].second)*(xy[0].second-xy[i].second));
    REP(j,i+1,n){
      if(chk[j]) continue;
      double d = sqrt((xy[j].first-xy[i].first)*(xy[j].first-xy[i].first)
      +(xy[j].second-xy[i].second)*(xy[j].second-xy[i].second));
      if(d < d0){
        chk[i] = true;
        chk[j] = true;
        break;
      }
    }
  }
  int cnt=0;
  REP(i,1,n){
    if(chk[i]==false) cnt++;
  }
  printf( "%d\n", cnt );
  return 0;
}
0