結果

問題 No.202 1円玉投げ
ユーザー 158b
提出日時 2015-06-11 02:33:34
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
RE  
実行時間 -
コード長 1,198 bytes
コンパイル時間 804 ms
コンパイル使用メモリ 84,444 KB
実行使用メモリ 6,824 KB
最終ジャッジ日時 2024-12-22 09:31:20
合計ジャッジ時間 5,467 ms
ジャッジサーバーID
(参考情報)
judge1 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 11 WA * 2 RE * 25
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <algorithm>
#include <functional>
#include <string>
#include <climits>
#include <vector>
#include <numeric>
#include <complex>
#include <map>
#include <bitset>
#include <utility>
using namespace std;

//#define __int64 long long
#define long __int64
#define REP(i,a,b) for(int i=a;i<b;i++)
#define rep(i,n) REP(i,0,n)
const int Vecy[4] = {0,-1,0,1};
const int Vecx[4] = {1,0,-1,0};

const int Xy = 20000;
const int Pat = 100;
const int Kazu = Xy / Pat;
vector<vector<vector<pair<int,int> > > > field;
	
bool check(int testy, int testx){
	int fy = testy / Pat;
	int fx = testx / Pat;
	double kyori;
	
	for(int i=0; i<field[fy][fx].size(); i++){
		kyori = pow(testy - field[fy][fx][i].first , 2) + pow(testx - field[fy][fx][i].second , 2);
		if(kyori < 400){
			return false;
		}
	}
	//データ追加
	field[fy][fx].push_back(make_pair(testy, testx));
	
	return true;
}

int main(){
	int n;
	int ans = 0;
	int y,x;
	
	//vector
	field = vector<vector<vector<pair<int,int> > > >(Kazu, vector<vector<pair<int,int> > >(Kazu, vector<pair<int,int> >()));
	
	cin >> n;
	rep(i,n){
		cin >> x >> y;
		if(check(y,x)){
			ans ++;
		}
	}
	
	cout << ans << endl;
    
    return 0;
}
0