結果

問題 No.202 1円玉投げ
ユーザー srup٩(๑`н´๑)۶
提出日時 2016-10-04 18:27:29
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
AC  
実行時間 413 ms / 5,000 ms
コード長 750 bytes
コンパイル時間 669 ms
コンパイル使用メモリ 67,608 KB
実行使用メモリ 5,248 KB
最終ジャッジ日時 2024-12-22 10:42:31
合計ジャッジ時間 5,487 ms
ジャッジサーバーID
(参考情報)
judge4 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 38
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <cstdio>
#include <string>
#include <vector>
#include <algorithm>
#include <cmath>

using namespace std;
#define rep(i,n) for(int i=0;i<(n);i++)
static const int mod = 1e9 + 7;

vector<int> center[20100];

int main(void){
	int n; cin >> n;
	int ans = 0;
	rep(i, n){
		int cx, cy; cin >> cx >> cy;
		int xl = max(0, cx - 20);
		int xr = cx + 20;
		bool flag = true;
		for (int nx = xl; nx <= xr; ++nx){
			for(auto ny : center[nx]){
				double len = sqrt((nx - cx) * (nx - cx) + (ny - cy) * (ny - cy));
        		// printf("len %f\n",len );
        		if(len < 20){
        			flag = false;
        			break;
        		}
			}
		}
		if(flag){
			ans++;
			center[cx].push_back(cy);
		}
	}

	printf("%d\n", ans);
	return 0;
}
0