結果

問題 No.202 1円玉投げ
ユーザー srjywrdnprktsrjywrdnprkt
提出日時 2022-12-29 04:06:50
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
RE  
実行時間 -
コード長 986 bytes
コンパイル時間 1,283 ms
コンパイル使用メモリ 114,008 KB
実行使用メモリ 8,588 KB
最終ジャッジ日時 2023-08-15 21:25:40
合計ジャッジ時間 8,069 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 104 ms
8,556 KB
testcase_01 RE -
testcase_02 RE -
testcase_03 RE -
testcase_04 AC 2 ms
4,380 KB
testcase_05 RE -
testcase_06 RE -
testcase_07 RE -
testcase_08 RE -
testcase_09 RE -
testcase_10 RE -
testcase_11 RE -
testcase_12 RE -
testcase_13 RE -
testcase_14 RE -
testcase_15 RE -
testcase_16 RE -
testcase_17 RE -
testcase_18 RE -
testcase_19 RE -
testcase_20 RE -
testcase_21 RE -
testcase_22 RE -
testcase_23 AC 3 ms
4,376 KB
testcase_24 AC 3 ms
4,384 KB
testcase_25 AC 3 ms
4,376 KB
testcase_26 RE -
testcase_27 AC 3 ms
4,380 KB
testcase_28 RE -
testcase_29 AC 3 ms
4,380 KB
testcase_30 RE -
testcase_31 AC 3 ms
4,380 KB
testcase_32 RE -
testcase_33 RE -
testcase_34 RE -
testcase_35 RE -
testcase_36 AC 91 ms
8,588 KB
testcase_37 RE -
testcase_38 RE -
testcase_39 AC 2 ms
4,384 KB
testcase_40 AC 3 ms
4,376 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <vector>
#include <cmath>
#include <map>
#include <set>
#include <iomanip>
#include <queue>
#include <algorithm>
#include <numeric>
#include <deque>
#include <complex>
#include <cassert>

using namespace std;

int main(){

    long long N, X, Y, mi, mx, d, cnt=0;
    cin >> N;
    vector<set<long long>> st(20001);

    for (int i=0; i<N; i++){
        cin >> X >> Y;
        bool f=1;
        mi = max(Y-20, 0LL);
        mx = min(Y+20, 20000LL);
        for (long long j=Y-20; j<=Y+20; j++){
            auto it = st[j].lower_bound(X-20);
            auto it2 = st[j].lower_bound(X+20);
            for (auto k=it; k!=it2; k++){
                d = (j-Y)*(j-Y) + (*k-X)*(*k-X);
                if (d < 400){
                    f = 0;
                    break;
                }
            }
            if (!f) break;
        }
        if (f){
            st[Y].insert(X);
            cnt++;
        }
    }

    cout << cnt << endl;

    return 0;
}
0