結果

問題 No.202 1円玉投げ
ユーザー kzyKTkzyKT
提出日時 2015-05-07 12:08:00
言語 C++11
(gcc 11.4.0)
結果
AC  
実行時間 814 ms / 5,000 ms
コード長 1,291 bytes
コンパイル時間 1,173 ms
コンパイル使用メモリ 145,192 KB
実行使用メモリ 394,336 KB
最終ジャッジ日時 2023-08-23 22:27:06
合計ジャッジ時間 13,319 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 182 ms
394,032 KB
testcase_01 AC 814 ms
394,132 KB
testcase_02 AC 103 ms
394,284 KB
testcase_03 AC 102 ms
394,044 KB
testcase_04 AC 104 ms
394,080 KB
testcase_05 AC 112 ms
394,160 KB
testcase_06 AC 631 ms
394,020 KB
testcase_07 AC 699 ms
394,032 KB
testcase_08 AC 702 ms
394,096 KB
testcase_09 AC 388 ms
394,224 KB
testcase_10 AC 186 ms
394,072 KB
testcase_11 AC 318 ms
394,040 KB
testcase_12 AC 327 ms
394,292 KB
testcase_13 AC 196 ms
394,100 KB
testcase_14 AC 117 ms
394,036 KB
testcase_15 AC 379 ms
394,040 KB
testcase_16 AC 160 ms
394,024 KB
testcase_17 AC 182 ms
394,088 KB
testcase_18 AC 183 ms
394,088 KB
testcase_19 AC 353 ms
394,160 KB
testcase_20 AC 559 ms
394,080 KB
testcase_21 AC 341 ms
394,024 KB
testcase_22 AC 101 ms
394,032 KB
testcase_23 AC 102 ms
394,036 KB
testcase_24 AC 101 ms
394,288 KB
testcase_25 AC 102 ms
394,024 KB
testcase_26 AC 103 ms
394,028 KB
testcase_27 AC 103 ms
394,028 KB
testcase_28 AC 102 ms
394,080 KB
testcase_29 AC 102 ms
394,076 KB
testcase_30 AC 103 ms
394,016 KB
testcase_31 AC 103 ms
394,036 KB
testcase_32 AC 103 ms
394,072 KB
testcase_33 AC 104 ms
394,020 KB
testcase_34 AC 102 ms
394,092 KB
testcase_35 AC 171 ms
394,212 KB
testcase_36 AC 178 ms
394,100 KB
testcase_37 AC 749 ms
394,028 KB
testcase_38 AC 174 ms
394,336 KB
testcase_39 AC 102 ms
394,016 KB
testcase_40 AC 101 ms
394,216 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
#define all(c) (c).begin(),(c).end()
#define rrep(i,n) for(int i=(int)(n)-1;i>=0;i--)
#define REP(i,m,n) for(int i=(int)(m);i<(int)(n);i++)
#define rep(i,n) REP(i,0,n)
#define iter(c) __typeof((c).begin())
#define tr(it,c) for(iter(c) it=(c).begin();it!=(c).end();it++)
#define pb(a) push_back(a)
#define pr(a) cout<<(a)<<endl
#define PR(a,b) cout<<(a)<<" "<<(b)<<endl
#define R cin>>
#define F first
#define S second
#define ll long long
bool check(int n,int m,int x,int y){return x>=0&&x<n&&y>=0&&y<m;}
const ll MAX=1000000007,MAXL=1LL<<60,dx[4]={-1,0,1,0},dy[4]={0,1,0,-1};
typedef pair<double,double> P;

bool m[20001][20001];

double D(double x1, double y1, double x2, double y2) {
  return sqrt((x1-x2)*(x1-x2)+(y1-y2)*(y1-y2));
}

int main() {
  int n;
  cin >> n;
  int ans=0;
  bool v[20001];
  memset(v,0,sizeof(v));
  memset(m,0,sizeof(m));
  rep(i,n) {
    int x,y;
    cin >> x >> y;
    bool ck=true;
    REP(j,-20,21) {
      if(x+j<0 || x+j>20000 || !v[x+j]) continue;
      REP(k,-20,21) {
        if(y+k>=0 && y+k<20001 && m[x+j][y+k]==1 && D(x+j,y+k,x,y)<20) {
          ck=false;
          break;
        }
      }
    }
    if(ck) {
      m[x][y]=1;
      v[x]=1;
      ans++;
    }
  }
  cout << ans << endl;
  return 0;
}
0