結果

問題 No.202 1円玉投げ
ユーザー hiro71687khiro71687k
提出日時 2023-04-07 15:57:44
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
TLE  
実行時間 -
コード長 1,116 bytes
コンパイル時間 4,238 ms
コンパイル使用メモリ 261,356 KB
実行使用メモリ 13,728 KB
最終ジャッジ日時 2024-04-10 16:19:11
合計ジャッジ時間 16,767 ms
ジャッジサーバーID
(参考情報)
judge4 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

#include <bits/stdc++.h>
#include <atcoder/all>
using namespace std;
using namespace atcoder;
using ll=int;
using ld=long double;
ld pie=3.141592653589793;
ll inf=144494;
ll mod=1000000007;
int main(){
    ll n;
    cin >>n;
    vector<ll>x(n),y(n);
    for (ll i = 0; i < n; i++)
    {
        cin >> x[i]>> y[i];
    }
    map<pair<ll,ll>,ll>memo;
    ll ans=0;
    for (ll i = 0; i < n; i++)
    {
        bool ok=true;
        for (ll j = max(x[i]-20,0); j <=x[i]+20; j++)
        {
            for (ll k = max(y[i]-20,0); k <=y[i]+20; k++)
            {
                ll z=(x[i]-j)*(x[i]-j)+(y[i]-k)*(y[i]-k);
                if (z<400)
                {
                    if (memo[{j,k}]==1)
                    {
                        ok=false;
                        break;
                    }else{
                        memo.erase({j,k});
                    }
                }
            }
            if (!ok)
            {
                break;
            }
        }
        if (ok)
        {
            memo[{x[i],y[i]}]=1;
            ans+=1;
        }
    }
    cout << ans << endl;
}
0