結果

問題 No.202 1円玉投げ
ユーザー IJMP320IJMP320
提出日時 2015-05-04 00:50:21
言語 C++11
(gcc 11.4.0)
結果
AC  
実行時間 1,269 ms / 5,000 ms
コード長 1,117 bytes
コンパイル時間 1,080 ms
コンパイル使用メモリ 145,220 KB
実行使用メモリ 394,308 KB
最終ジャッジ日時 2023-08-23 22:06:27
合計ジャッジ時間 24,237 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 837 ms
394,020 KB
testcase_01 AC 1,269 ms
394,060 KB
testcase_02 AC 103 ms
394,080 KB
testcase_03 AC 102 ms
394,176 KB
testcase_04 AC 102 ms
394,008 KB
testcase_05 AC 174 ms
394,144 KB
testcase_06 AC 1,011 ms
394,008 KB
testcase_07 AC 1,104 ms
394,212 KB
testcase_08 AC 1,248 ms
394,056 KB
testcase_09 AC 757 ms
394,060 KB
testcase_10 AC 389 ms
394,012 KB
testcase_11 AC 653 ms
394,024 KB
testcase_12 AC 651 ms
394,212 KB
testcase_13 AC 384 ms
394,028 KB
testcase_14 AC 183 ms
394,200 KB
testcase_15 AC 654 ms
394,204 KB
testcase_16 AC 754 ms
394,024 KB
testcase_17 AC 743 ms
394,204 KB
testcase_18 AC 736 ms
393,996 KB
testcase_19 AC 625 ms
394,052 KB
testcase_20 AC 915 ms
394,064 KB
testcase_21 AC 632 ms
394,020 KB
testcase_22 AC 107 ms
394,308 KB
testcase_23 AC 108 ms
394,204 KB
testcase_24 AC 105 ms
394,008 KB
testcase_25 AC 105 ms
394,144 KB
testcase_26 AC 108 ms
394,300 KB
testcase_27 AC 109 ms
394,012 KB
testcase_28 AC 104 ms
394,036 KB
testcase_29 AC 105 ms
394,064 KB
testcase_30 AC 111 ms
393,996 KB
testcase_31 AC 105 ms
394,020 KB
testcase_32 AC 114 ms
394,004 KB
testcase_33 AC 106 ms
394,076 KB
testcase_34 AC 108 ms
394,008 KB
testcase_35 AC 741 ms
394,204 KB
testcase_36 AC 809 ms
394,204 KB
testcase_37 AC 1,182 ms
393,996 KB
testcase_38 AC 751 ms
394,200 KB
testcase_39 AC 102 ms
394,200 KB
testcase_40 AC 102 ms
394,120 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int,int> pii;
#define FOR(i,a,n) for(int i=a;i<(int)(n);i++)
#define REP(i,n) FOR(i,0,n)
#define ALL(a) (a).begin(),(a).end()
#define MP(a,b) make_pair(a,b)
#define PB(a) push_back(a)
#define F first
#define S second
const int INF = 2000000000;
const int DX[4]={0,1,0,-1}, DY[4]={-1,0,1,0};
struct P{int x;int y;P(int X=0,int Y=0){x=X;y=Y;}};

bool p[20001][20001];
int main() {
    memset(p,false,sizeof(p));
    int N;
    cin >> N;
    ll ans = 0;
    REP(i,N) {
        int x,y;
        cin >> x >> y;
        bool f=true;
        FOR(a,y-30,y+30) {
            FOR(b,x-30,x+30) {
                if(a>=0 && a<=20000 && b>=0 && b<=20000 && p[a][b]) {
                    double d = sqrt(pow((double)(y-a),2.0)+pow((double)(x-b),2.0));
                    if(d<20.0) {
                        f=false;
                        goto next;
                    }
                }
            }
        }
        next:;
        if(f) {
            ans++;
            p[y][x]=true;
        }
    }
    cout << ans << endl;
    return 0;
}
0