結果

問題 No.202 1円玉投げ
ユーザー 158b158b
提出日時 2015-06-11 02:33:34
言語 C++11
(gcc 11.4.0)
結果
RE  
実行時間 -
コード長 1,198 bytes
コンパイル時間 685 ms
コンパイル使用メモリ 84,260 KB
実行使用メモリ 5,596 KB
最終ジャッジ日時 2023-08-23 23:02:03
合計ジャッジ時間 6,153 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 RE -
testcase_01 RE -
testcase_02 AC 3 ms
4,380 KB
testcase_03 AC 2 ms
4,388 KB
testcase_04 AC 3 ms
4,376 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 WA -
testcase_15 RE -
testcase_16 AC 53 ms
5,556 KB
testcase_17 AC 53 ms
5,596 KB
testcase_18 AC 54 ms
5,508 KB
testcase_19 RE -
testcase_20 RE -
testcase_21 RE -
testcase_22 AC 3 ms
4,380 KB
testcase_23 RE -
testcase_24 RE -
testcase_25 RE -
testcase_26 AC 2 ms
4,596 KB
testcase_27 RE -
testcase_28 RE -
testcase_29 RE -
testcase_30 RE -
testcase_31 AC 3 ms
4,376 KB
testcase_32 AC 3 ms
4,420 KB
testcase_33 RE -
testcase_34 AC 3 ms
4,380 KB
testcase_35 AC 53 ms
5,384 KB
testcase_36 RE -
testcase_37 RE -
testcase_38 AC 56 ms
5,444 KB
testcase_39 AC 3 ms
4,380 KB
testcase_40 WA -
権限があれば一括ダウンロードができます

ソースコード

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