結果

問題 No.202 1円玉投げ
ユーザー h_nosonh_noson
提出日時 2016-06-17 09:51:54
言語 C++11
(gcc 11.4.0)
結果
AC  
実行時間 765 ms / 5,000 ms
コード長 1,020 bytes
コンパイル時間 1,759 ms
コンパイル使用メモリ 71,220 KB
実行使用メモリ 9,204 KB
最終ジャッジ日時 2023-08-23 23:24:18
合計ジャッジ時間 10,555 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 367 ms
9,204 KB
testcase_01 AC 685 ms
9,040 KB
testcase_02 AC 2 ms
4,472 KB
testcase_03 AC 2 ms
4,424 KB
testcase_04 AC 2 ms
4,376 KB
testcase_05 AC 17 ms
4,768 KB
testcase_06 AC 572 ms
7,800 KB
testcase_07 AC 706 ms
8,280 KB
testcase_08 AC 673 ms
8,228 KB
testcase_09 AC 270 ms
6,744 KB
testcase_10 AC 78 ms
5,380 KB
testcase_11 AC 201 ms
6,444 KB
testcase_12 AC 212 ms
6,416 KB
testcase_13 AC 92 ms
5,520 KB
testcase_14 AC 21 ms
4,688 KB
testcase_15 AC 262 ms
6,588 KB
testcase_16 AC 229 ms
9,044 KB
testcase_17 AC 369 ms
9,052 KB
testcase_18 AC 365 ms
9,076 KB
testcase_19 AC 236 ms
6,628 KB
testcase_20 AC 467 ms
7,552 KB
testcase_21 AC 234 ms
6,436 KB
testcase_22 AC 4 ms
4,520 KB
testcase_23 AC 5 ms
4,560 KB
testcase_24 AC 4 ms
4,404 KB
testcase_25 AC 4 ms
4,380 KB
testcase_26 AC 4 ms
4,568 KB
testcase_27 AC 5 ms
4,476 KB
testcase_28 AC 4 ms
4,568 KB
testcase_29 AC 4 ms
4,568 KB
testcase_30 AC 5 ms
4,628 KB
testcase_31 AC 4 ms
4,460 KB
testcase_32 AC 4 ms
4,400 KB
testcase_33 AC 5 ms
4,496 KB
testcase_34 AC 5 ms
4,472 KB
testcase_35 AC 331 ms
9,052 KB
testcase_36 AC 315 ms
9,084 KB
testcase_37 AC 765 ms
8,444 KB
testcase_38 AC 334 ms
9,116 KB
testcase_39 AC 3 ms
4,380 KB
testcase_40 AC 3 ms
4,476 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <vector>
#include <map>
#include <algorithm>
#include <set>
using namespace std;

#define REP(i,s,e) for (i = s; i <= e; i++)
#define rep(i,n) REP (i,0,(int)(n)-1)
#define RREP(i,s,e) for (i = s; i >= e; i--)
#define rrep(i,n) RREP (i,(int)(n)-1,0)
#define INF (int)1e8
#define MOD (int)(1e9+7)

typedef long long ll;

set<int> coin[20001];

int main(void) {
    int i, n;
    scanf("%d",&n);
    rep (i,n) {
        int X, Y;
        scanf("%d%d",&X,&Y);
        int x;
        bool ok = true;
        REP (x,max(X-20,0),min(X+20,20000)) {
            for (int j = max(Y-20,0); j <= min(Y + 20,20000); j++) {
                auto py = coin[x].lower_bound(j);
                if (py != coin[x].end()) {
                    int y = *py;
                    ok &= (x - X) * (x - X) + (y - Y) * (y - Y) >= 400;
                }
            }
        }
        if (ok) coin[X].insert(Y);
    }
    int ans = 0;
    REP (i,0,20000) ans += coin[i].size();
    printf("%d\n",ans);
    return 0;
}
0