結果

問題 No.202 1円玉投げ
ユーザー kk
提出日時 2021-03-08 03:01:46
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 2,638 ms / 5,000 ms
コード長 683 bytes
コンパイル時間 2,100 ms
コンパイル使用メモリ 204,036 KB
実行使用メモリ 8,336 KB
最終ジャッジ日時 2023-08-24 00:20:45
合計ジャッジ時間 15,961 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 628 ms
8,124 KB
testcase_01 AC 149 ms
8,228 KB
testcase_02 AC 1 ms
4,376 KB
testcase_03 AC 2 ms
4,380 KB
testcase_04 AC 2 ms
4,376 KB
testcase_05 AC 6 ms
4,376 KB
testcase_06 AC 233 ms
6,780 KB
testcase_07 AC 304 ms
7,232 KB
testcase_08 AC 311 ms
7,220 KB
testcase_09 AC 94 ms
5,676 KB
testcase_10 AC 21 ms
4,412 KB
testcase_11 AC 66 ms
5,240 KB
testcase_12 AC 69 ms
5,384 KB
testcase_13 AC 25 ms
4,588 KB
testcase_14 AC 6 ms
4,380 KB
testcase_15 AC 88 ms
5,736 KB
testcase_16 AC 92 ms
8,336 KB
testcase_17 AC 1,725 ms
8,032 KB
testcase_18 AC 1,502 ms
8,180 KB
testcase_19 AC 77 ms
5,420 KB
testcase_20 AC 190 ms
6,616 KB
testcase_21 AC 77 ms
5,404 KB
testcase_22 AC 2 ms
4,380 KB
testcase_23 AC 2 ms
4,376 KB
testcase_24 AC 2 ms
4,376 KB
testcase_25 AC 2 ms
4,376 KB
testcase_26 AC 5 ms
4,376 KB
testcase_27 AC 5 ms
4,380 KB
testcase_28 AC 2 ms
4,376 KB
testcase_29 AC 2 ms
4,380 KB
testcase_30 AC 2 ms
4,380 KB
testcase_31 AC 2 ms
4,376 KB
testcase_32 AC 2 ms
4,376 KB
testcase_33 AC 2 ms
4,380 KB
testcase_34 AC 2 ms
4,376 KB
testcase_35 AC 2,622 ms
8,124 KB
testcase_36 AC 230 ms
8,068 KB
testcase_37 AC 347 ms
7,496 KB
testcase_38 AC 2,638 ms
8,100 KB
testcase_39 AC 1 ms
4,376 KB
testcase_40 AC 2 ms
4,376 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>

using namespace std;

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

  int n;
  cin >> n;

  set<pair<int, int> > st;
  for (int i = 0; i < n; i++) {
    int x, y;
    cin >> x >> y;
    bool hit = false;
    if (st.size()) {
      auto itr = st.lower_bound(make_pair(x - 20, 0));
      while (itr != st.end()) {
        int xt = itr->first;
        int yt = itr->second;
        if (xt > x + 20)
          break;
        int dist = (x - xt) * (x - xt) + (y - yt) * (y - yt);
        if (dist < 20 * 20)
          hit = true;
        ++itr;
      }
    }
    if (!hit)
      st.emplace(x, y);
  }

  cout << st.size() << endl;
  
  return 0;
}
0