結果

問題 No.202 1円玉投げ
ユーザー kagasankagasan
提出日時 2019-07-20 12:27:57
言語 C++14
(gcc 13.2.0 + boost 1.83.0)
結果
AC  
実行時間 84 ms / 5,000 ms
コード長 1,023 bytes
コンパイル時間 1,627 ms
コンパイル使用メモリ 168,388 KB
実行使用メモリ 13,632 KB
最終ジャッジ日時 2023-08-24 00:03:50
合計ジャッジ時間 5,018 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 70 ms
12,504 KB
testcase_01 AC 77 ms
13,632 KB
testcase_02 AC 6 ms
10,704 KB
testcase_03 AC 6 ms
10,636 KB
testcase_04 AC 5 ms
10,556 KB
testcase_05 AC 10 ms
10,744 KB
testcase_06 AC 70 ms
12,816 KB
testcase_07 AC 77 ms
13,124 KB
testcase_08 AC 80 ms
13,060 KB
testcase_09 AC 45 ms
12,108 KB
testcase_10 AC 21 ms
11,300 KB
testcase_11 AC 37 ms
11,924 KB
testcase_12 AC 39 ms
11,820 KB
testcase_13 AC 24 ms
11,284 KB
testcase_14 AC 11 ms
10,776 KB
testcase_15 AC 43 ms
12,052 KB
testcase_16 AC 62 ms
12,680 KB
testcase_17 AC 62 ms
12,980 KB
testcase_18 AC 63 ms
12,684 KB
testcase_19 AC 39 ms
12,108 KB
testcase_20 AC 61 ms
12,572 KB
testcase_21 AC 40 ms
11,876 KB
testcase_22 AC 6 ms
10,588 KB
testcase_23 AC 6 ms
10,636 KB
testcase_24 AC 6 ms
10,556 KB
testcase_25 AC 6 ms
10,552 KB
testcase_26 AC 6 ms
10,664 KB
testcase_27 AC 6 ms
10,792 KB
testcase_28 AC 6 ms
10,548 KB
testcase_29 AC 6 ms
10,564 KB
testcase_30 AC 6 ms
10,656 KB
testcase_31 AC 6 ms
10,564 KB
testcase_32 AC 6 ms
10,720 KB
testcase_33 AC 6 ms
10,572 KB
testcase_34 AC 6 ms
10,660 KB
testcase_35 AC 63 ms
12,600 KB
testcase_36 AC 68 ms
12,596 KB
testcase_37 AC 84 ms
13,284 KB
testcase_38 AC 68 ms
12,824 KB
testcase_39 AC 6 ms
10,624 KB
testcase_40 AC 6 ms
10,552 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include "bits/stdc++.h"
using namespace std;
typedef long long ll;
void Say(bool say, string a = "Yes", string b = "No"){cout << (say ? a : b) << endl;};

typedef pair<ll, ll>P;
bool check(P a, P b){
    return (a.first - b.first)*(a.first - b.first) + (a.second - b.second)*(a.second - b.second) < 400;
}

vector<P>coins[555][555];

int main(){
    
    ll N, ans = 0;
    cin >> N;
    for(ll i = 0; i < N; i++){
        ll x, y;
        cin >> x >> y;
        x += 100;
        y += 100;
        P p(x, y);
        ll xidx = x / 40;
        ll yidx = y / 40;
        ll flg = 1;
        for(ll j = -1; j <= 1; j++){
            for(ll k = -1; k <= 1; k++){
                ll X = xidx + j;
                ll Y = yidx + k;
                for(ll l = 0; l < coins[X][Y].size(); l++){
                    if(check(coins[X][Y][l], p))flg = 0;
                }
            }
        }
        if(flg){
            ans++;
            coins[xidx][yidx].push_back(p);
        }
    }
    cout << ans << endl;

    return 0;
}
0