結果

問題 No.202 1円玉投げ
ユーザー kk
提出日時 2021-03-08 03:15:57
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 95 ms / 5,000 ms
コード長 809 bytes
コンパイル時間 1,966 ms
コンパイル使用メモリ 199,424 KB
実行使用メモリ 254,212 KB
最終ジャッジ日時 2023-08-24 00:20:20
合計ジャッジ時間 6,932 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 89 ms
254,128 KB
testcase_01 AC 95 ms
254,136 KB
testcase_02 AC 65 ms
253,584 KB
testcase_03 AC 66 ms
253,512 KB
testcase_04 AC 65 ms
253,456 KB
testcase_05 AC 68 ms
253,452 KB
testcase_06 AC 90 ms
254,008 KB
testcase_07 AC 93 ms
254,128 KB
testcase_08 AC 94 ms
254,196 KB
testcase_09 AC 81 ms
253,816 KB
testcase_10 AC 73 ms
253,636 KB
testcase_11 AC 78 ms
253,684 KB
testcase_12 AC 80 ms
253,868 KB
testcase_13 AC 74 ms
253,596 KB
testcase_14 AC 68 ms
253,672 KB
testcase_15 AC 81 ms
254,052 KB
testcase_16 AC 85 ms
254,136 KB
testcase_17 AC 87 ms
254,212 KB
testcase_18 AC 87 ms
254,156 KB
testcase_19 AC 80 ms
254,016 KB
testcase_20 AC 88 ms
254,028 KB
testcase_21 AC 81 ms
253,720 KB
testcase_22 AC 66 ms
253,372 KB
testcase_23 AC 66 ms
253,456 KB
testcase_24 AC 66 ms
253,468 KB
testcase_25 AC 66 ms
253,664 KB
testcase_26 AC 66 ms
253,460 KB
testcase_27 AC 66 ms
253,372 KB
testcase_28 AC 66 ms
253,428 KB
testcase_29 AC 66 ms
253,364 KB
testcase_30 AC 66 ms
253,364 KB
testcase_31 AC 65 ms
253,412 KB
testcase_32 AC 67 ms
253,444 KB
testcase_33 AC 65 ms
253,532 KB
testcase_34 AC 66 ms
253,360 KB
testcase_35 AC 86 ms
254,132 KB
testcase_36 AC 88 ms
254,176 KB
testcase_37 AC 95 ms
254,128 KB
testcase_38 AC 86 ms
254,188 KB
testcase_39 AC 65 ms
253,520 KB
testcase_40 AC 65 ms
253,592 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>

using namespace std;

int bd[8000][8000];
int xs[100000];
int ys[100000];

int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);

  memset(bd, -1, sizeof(bd));  
  int n;
  cin >> n;

  int ret = 0;
  for (int i = 0; i < n; i++) {
    cin >> xs[i] >> ys[i];

    bool hit = false;
    for (int bx = xs[i]/14 - 2; bx <= xs[i]/14 + 2; bx++) {
      for (int by = ys[i]/14 - 2; by <= ys[i]/14 + 2; by++) {
        if (bx < 0 || by < 0) continue;
        int j = bd[bx][by];
        if (j != -1) {
          int dist = (xs[i] - xs[j]) * (xs[i] - xs[j]) + (ys[i] - ys[j]) * (ys[i] - ys[j]);
          if (dist < 20 * 20)
            hit = true;
        }
      }
    }
    if (!hit) {
      ++ret;
      bd[xs[i]/14][ys[i]/14] = i;
    }
  }

  cout << ret << endl;
  
  return 0;
}
0