結果

問題 No.202 1円玉投げ
ユーザー kzyKTkzyKT
提出日時 2015-05-07 12:04:04
言語 C++11
(gcc 11.4.0)
結果
RE  
実行時間 -
コード長 1,255 bytes
コンパイル時間 1,160 ms
コンパイル使用メモリ 145,304 KB
実行使用メモリ 394,156 KB
最終ジャッジ日時 2023-08-23 22:28:36
合計ジャッジ時間 50,958 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 RE -
testcase_01 RE -
testcase_02 AC 102 ms
394,036 KB
testcase_03 AC 100 ms
394,036 KB
testcase_04 AC 102 ms
394,016 KB
testcase_05 RE -
testcase_06 RE -
testcase_07 RE -
testcase_08 RE -
testcase_09 RE -
testcase_10 RE -
testcase_11 RE -
testcase_12 RE -
testcase_13 RE -
testcase_14 RE -
testcase_15 RE -
testcase_16 RE -
testcase_17 AC 183 ms
393,988 KB
testcase_18 AC 185 ms
394,088 KB
testcase_19 RE -
testcase_20 RE -
testcase_21 RE -
testcase_22 AC 103 ms
394,100 KB
testcase_23 RE -
testcase_24 AC 103 ms
393,992 KB
testcase_25 RE -
testcase_26 AC 102 ms
394,144 KB
testcase_27 RE -
testcase_28 RE -
testcase_29 RE -
testcase_30 RE -
testcase_31 AC 102 ms
393,988 KB
testcase_32 AC 103 ms
394,020 KB
testcase_33 RE -
testcase_34 AC 102 ms
393,984 KB
testcase_35 AC 172 ms
393,988 KB
testcase_36 RE -
testcase_37 RE -
testcase_38 AC 177 ms
394,036 KB
testcase_39 AC 101 ms
394,156 KB
testcase_40 AC 101 ms
394,028 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 || !v[x-j]) continue;
      REP(k,-20,21) {
        if(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