結果

問題 No.202 1円玉投げ
ユーザー 158b158b
提出日時 2015-06-11 02:39:52
言語 C++11
(gcc 11.4.0)
結果
WA  
実行時間 -
コード長 1,205 bytes
コンパイル時間 673 ms
コンパイル使用メモリ 83,908 KB
実行使用メモリ 6,068 KB
最終ジャッジ日時 2023-08-23 23:01:56
合計ジャッジ時間 3,457 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 61 ms
5,456 KB
testcase_01 AC 66 ms
6,068 KB
testcase_02 AC 3 ms
4,380 KB
testcase_03 AC 2 ms
4,444 KB
testcase_04 AC 2 ms
4,380 KB
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
testcase_15 WA -
testcase_16 AC 55 ms
5,564 KB
testcase_17 AC 54 ms
5,520 KB
testcase_18 AC 55 ms
5,504 KB
testcase_19 WA -
testcase_20 WA -
testcase_21 WA -
testcase_22 AC 4 ms
4,380 KB
testcase_23 AC 3 ms
4,380 KB
testcase_24 AC 3 ms
4,376 KB
testcase_25 WA -
testcase_26 AC 3 ms
4,552 KB
testcase_27 AC 3 ms
4,376 KB
testcase_28 AC 3 ms
4,376 KB
testcase_29 WA -
testcase_30 AC 3 ms
4,380 KB
testcase_31 AC 3 ms
4,380 KB
testcase_32 AC 3 ms
4,376 KB
testcase_33 WA -
testcase_34 AC 3 ms
4,376 KB
testcase_35 AC 54 ms
5,528 KB
testcase_36 AC 59 ms
5,464 KB
testcase_37 WA -
testcase_38 AC 59 ms
5,436 KB
testcase_39 AC 2 ms
4,508 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 + 1;
vector<vector<vector<pair<int,int> > > > field;
	
bool check(int testy, int testx){
	int fy = testy / Pat;
	int fx = testx / Pat;
	int 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) + 0.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