結果

問題 No.202 1円玉投げ
ユーザー latte0119latte0119
提出日時 2015-05-04 00:33:40
言語 C++11
(gcc 11.4.0)
結果
AC  
実行時間 137 ms / 5,000 ms
コード長 717 bytes
コンパイル時間 1,219 ms
コンパイル使用メモリ 149,604 KB
実行使用メモリ 9,416 KB
最終ジャッジ日時 2023-08-23 21:58:13
合計ジャッジ時間 4,434 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 70 ms
9,232 KB
testcase_01 AC 89 ms
9,096 KB
testcase_02 AC 2 ms
4,476 KB
testcase_03 AC 2 ms
4,468 KB
testcase_04 AC 2 ms
4,460 KB
testcase_05 AC 5 ms
4,664 KB
testcase_06 AC 107 ms
7,912 KB
testcase_07 AC 122 ms
8,272 KB
testcase_08 AC 123 ms
8,340 KB
testcase_09 AC 59 ms
6,700 KB
testcase_10 AC 20 ms
5,472 KB
testcase_11 AC 46 ms
6,420 KB
testcase_12 AC 47 ms
6,332 KB
testcase_13 AC 23 ms
5,512 KB
testcase_14 AC 6 ms
4,792 KB
testcase_15 AC 56 ms
6,664 KB
testcase_16 AC 45 ms
9,132 KB
testcase_17 AC 53 ms
9,136 KB
testcase_18 AC 53 ms
9,248 KB
testcase_19 AC 52 ms
6,480 KB
testcase_20 AC 93 ms
7,552 KB
testcase_21 AC 52 ms
6,564 KB
testcase_22 AC 2 ms
4,572 KB
testcase_23 AC 3 ms
4,460 KB
testcase_24 AC 2 ms
4,484 KB
testcase_25 AC 3 ms
4,492 KB
testcase_26 AC 2 ms
4,504 KB
testcase_27 AC 3 ms
4,424 KB
testcase_28 AC 2 ms
4,428 KB
testcase_29 AC 2 ms
4,484 KB
testcase_30 AC 2 ms
4,472 KB
testcase_31 AC 3 ms
4,504 KB
testcase_32 AC 2 ms
4,568 KB
testcase_33 AC 3 ms
4,612 KB
testcase_34 AC 3 ms
4,492 KB
testcase_35 AC 58 ms
9,416 KB
testcase_36 AC 52 ms
9,236 KB
testcase_37 AC 137 ms
8,736 KB
testcase_38 AC 59 ms
9,364 KB
testcase_39 AC 2 ms
4,392 KB
testcase_40 AC 3 ms
4,548 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<bits/stdc++.h>
using namespace std;
int N;
set<int>S[20001];
int main(){
    scanf("%d",&N);
    for(int _=0;_<N;_++){
        int x,y;
        scanf("%d%d",&x,&y);
        bool flag=true;
        for(int i=max(x-20,0);i<min(20001,x+21)&&flag;i++){
            set<int>::iterator it;
            it=S[i].lower_bound(y-20);
            for(;it!=S[i].end();it++){
                if(*it>y+20)break;
                if(hypot(i-x,*it-y)<20.0){
                    flag=false;
                    break;
                }
            }
        }

        if(flag){
            S[x].insert(y);
        }
    }

    int ans=0;
    for(int i=0;i<=20000;i++)ans+=S[i].size();
    printf("%d\n",ans);

    return 0;
}
0