結果

問題 No.202 1円玉投げ
ユーザー tubo28tubo28
提出日時 2015-05-15 02:27:35
言語 C++11
(gcc 11.4.0)
結果
AC  
実行時間 83 ms / 5,000 ms
コード長 2,299 bytes
コンパイル時間 1,118 ms
コンパイル使用メモリ 149,872 KB
実行使用メモリ 38,220 KB
最終ジャッジ日時 2023-08-23 22:48:53
合計ジャッジ時間 4,712 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 83 ms
37,284 KB
testcase_01 AC 79 ms
38,220 KB
testcase_02 AC 15 ms
36,352 KB
testcase_03 AC 14 ms
36,564 KB
testcase_04 AC 14 ms
36,316 KB
testcase_05 AC 18 ms
36,500 KB
testcase_06 AC 70 ms
37,880 KB
testcase_07 AC 77 ms
37,924 KB
testcase_08 AC 79 ms
37,944 KB
testcase_09 AC 49 ms
37,440 KB
testcase_10 AC 28 ms
36,988 KB
testcase_11 AC 43 ms
37,436 KB
testcase_12 AC 43 ms
37,380 KB
testcase_13 AC 30 ms
37,192 KB
testcase_14 AC 19 ms
36,696 KB
testcase_15 AC 48 ms
37,452 KB
testcase_16 AC 74 ms
37,464 KB
testcase_17 AC 73 ms
37,468 KB
testcase_18 AC 73 ms
37,576 KB
testcase_19 AC 47 ms
37,444 KB
testcase_20 AC 64 ms
37,836 KB
testcase_21 AC 46 ms
37,552 KB
testcase_22 AC 15 ms
36,320 KB
testcase_23 AC 15 ms
36,380 KB
testcase_24 AC 15 ms
36,508 KB
testcase_25 AC 15 ms
36,392 KB
testcase_26 AC 15 ms
36,304 KB
testcase_27 AC 15 ms
36,320 KB
testcase_28 AC 15 ms
36,400 KB
testcase_29 AC 15 ms
36,320 KB
testcase_30 AC 15 ms
36,328 KB
testcase_31 AC 15 ms
36,352 KB
testcase_32 AC 15 ms
36,488 KB
testcase_33 AC 15 ms
36,312 KB
testcase_34 AC 15 ms
36,412 KB
testcase_35 AC 75 ms
37,296 KB
testcase_36 AC 79 ms
37,216 KB
testcase_37 AC 81 ms
38,040 KB
testcase_38 AC 80 ms
37,332 KB
testcase_39 AC 15 ms
36,356 KB
testcase_40 AC 15 ms
36,460 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#define _CRT_SECURE_NO_WARNINGS
//#define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
//#define int ll
//#define endl "\n"
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef pair<int,int> pii;
#define all(c) (c).begin(), (c).end()
#define loop(i,a,b) for(ll i=a; i<ll(b); i++)
#define rep(i,b) loop(i,0,b)
#define pb push_back
#define eb emplace_back
#define mp make_pair
#define mt make_tuple
template<class T> ostream & operator<<(ostream & os, vector<T> const &);
template<int n, class...T> typename enable_if<(n>=sizeof...(T))>::type _ot(ostream &, tuple<T...> const &){}
template<int n, class...T> typename enable_if<(n< sizeof...(T))>::type _ot(ostream & os, tuple<T...> const & t){ os << (n==0?"":" ") << get<n>(t); _ot<n+1>(os, t); }
template<class...T> ostream & operator<<(ostream & os, tuple<T...> const & t){ _ot<0>(os, t); return os; }
template<class T, class U> ostream & operator<<(ostream & os, pair<T,U> const & p){ return os << "(" << p.first << ", " << p.second << ") "; }
template<class T> ostream & operator<<(ostream & os, vector<T> const & v){ rep(i,v.size()) os << v[i] << (i+1==(int)v.size()?"":" "); return os; }
template<class T> inline bool chmax(T & x, T const & y){ return x<y ? x=y,true : false; }
template<class T> inline bool chmin(T & x, T const & y){ return x>y ? x=y,true : false; }
#ifdef DEBUG
#define dump(...) (cerr<<#__VA_ARGS__<<" = "<<mt(__VA_ARGS__)<<" ["<<__LINE__<<"]"<<endl)
#else
#define dump(...)
#endif
// ll const mod = 1000000007;
// ll const inf = 1LL<<60;

int N;
int const l = 80;
vector<pair<int,int>> baq[30010/l][300010/l];

bool check(int x, int y){
    int bx = x/l, by = y/l;
    for(int i=by-1;i<=by+1;i++){
        for(int j=bx-1;j<=bx+1;j++){
            for(auto & p : baq[i][j]){
                int cx, cy;
                tie(cx,cy) = p;
                int dx = x-cx, dy = y-cy;
                int d2 = dx*dx + dy*dy;
                if(d2 < 400) return false;
            }
        }
    }
    return true;
}

int main(){
    cin >> N;
    int ans = 0;
    rep(i,N){
        int x,y;
        cin >> x >> y;
        x += l;
        y += l;
        if(!check(x,y)) continue;
        baq[y/l][x/l].eb(x,y);
        ans++;
    }
    cout << ans << endl;
}
0