結果

問題 No.202 1円玉投げ
ユーザー e-mone-mon
提出日時 2015-05-06 22:38:02
言語 C++11
(gcc 11.4.0)
結果
AC  
実行時間 119 ms / 5,000 ms
コード長 1,047 bytes
コンパイル時間 1,827 ms
コンパイル使用メモリ 159,612 KB
実行使用メモリ 6,496 KB
最終ジャッジ日時 2023-08-23 22:26:29
合計ジャッジ時間 5,078 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 93 ms
4,468 KB
testcase_01 AC 101 ms
6,444 KB
testcase_02 AC 1 ms
4,376 KB
testcase_03 AC 1 ms
4,380 KB
testcase_04 AC 2 ms
4,380 KB
testcase_05 AC 10 ms
4,380 KB
testcase_06 AC 97 ms
5,996 KB
testcase_07 AC 107 ms
6,140 KB
testcase_08 AC 109 ms
6,228 KB
testcase_09 AC 62 ms
5,576 KB
testcase_10 AC 28 ms
5,036 KB
testcase_11 AC 51 ms
5,448 KB
testcase_12 AC 52 ms
5,596 KB
testcase_13 AC 32 ms
5,076 KB
testcase_14 AC 10 ms
4,380 KB
testcase_15 AC 62 ms
5,604 KB
testcase_16 AC 81 ms
4,848 KB
testcase_17 AC 82 ms
4,844 KB
testcase_18 AC 83 ms
4,840 KB
testcase_19 AC 57 ms
5,484 KB
testcase_20 AC 88 ms
5,904 KB
testcase_21 AC 55 ms
5,540 KB
testcase_22 AC 3 ms
4,376 KB
testcase_23 AC 3 ms
4,380 KB
testcase_24 AC 2 ms
4,380 KB
testcase_25 AC 2 ms
4,376 KB
testcase_26 AC 2 ms
4,376 KB
testcase_27 AC 2 ms
4,380 KB
testcase_28 AC 2 ms
4,380 KB
testcase_29 AC 2 ms
4,376 KB
testcase_30 AC 2 ms
4,376 KB
testcase_31 AC 2 ms
4,376 KB
testcase_32 AC 3 ms
4,376 KB
testcase_33 AC 2 ms
4,376 KB
testcase_34 AC 2 ms
4,376 KB
testcase_35 AC 89 ms
4,624 KB
testcase_36 AC 89 ms
4,456 KB
testcase_37 AC 119 ms
6,496 KB
testcase_38 AC 92 ms
4,592 KB
testcase_39 AC 2 ms
4,376 KB
testcase_40 AC 1 ms
4,380 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>

using namespace std;

typedef vector<int> vi;
typedef pair<int, int> pii;
typedef long long ll;

#define FOR(i,a,b) for(int i=(a);i<(b);i++)
#define REP(i,n)  FOR(i,0,n)

int main(){
    map<pair<int,int>,vector<pair<int,int>> > sqrtMap;
    int N;
    int count = 0;
    cin >> N ;

    FOR(i,0,N){
        int x,y;
        cin >> x >> y ;
        bool add_flag = true;


        for(auto point_pare : (set<pair<int,int>> {make_pair((x+20)/150,(y+20)/150),make_pair((x-20)/150,(y-20)/150),make_pair((x+20)/150,(y-20)/150),make_pair((x-20)/150,(y+20)/150)})){
            for(auto points:sqrtMap[make_pair(point_pare.first,point_pare.second)]){
                if(sqrt(pow(abs(points.first - x),2) + pow(abs(points.second - y),2)) < 20){
                    add_flag = false;
                    break;
                }
            }
        }

        if(add_flag){
            sqrtMap[make_pair(x/150,y/150)].push_back(make_pair(x,y));
            count++;
        }
    }

    cout << count << endl;

    return 0;
}
0