結果

問題 No.202 1円玉投げ
ユーザー fiordfiord
提出日時 2016-02-04 22:53:57
言語 C++11
(gcc 11.4.0)
結果
WA  
実行時間 -
コード長 638 bytes
コンパイル時間 1,195 ms
コンパイル使用メモリ 151,404 KB
実行使用メモリ 8,684 KB
最終ジャッジ日時 2023-08-23 23:15:11
合計ジャッジ時間 6,864 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 93 ms
8,520 KB
testcase_01 AC 332 ms
8,520 KB
testcase_02 AC 2 ms
4,376 KB
testcase_03 AC 2 ms
4,376 KB
testcase_04 AC 2 ms
4,376 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 91 ms
8,556 KB
testcase_17 AC 98 ms
8,524 KB
testcase_18 AC 98 ms
8,532 KB
testcase_19 WA -
testcase_20 WA -
testcase_21 WA -
testcase_22 AC 2 ms
4,376 KB
testcase_23 AC 2 ms
4,380 KB
testcase_24 AC 2 ms
4,376 KB
testcase_25 AC 2 ms
4,380 KB
testcase_26 AC 2 ms
4,376 KB
testcase_27 AC 2 ms
4,380 KB
testcase_28 WA -
testcase_29 AC 2 ms
4,380 KB
testcase_30 AC 2 ms
4,376 KB
testcase_31 AC 2 ms
4,376 KB
testcase_32 AC 2 ms
4,380 KB
testcase_33 WA -
testcase_34 AC 2 ms
4,380 KB
testcase_35 AC 75 ms
8,584 KB
testcase_36 AC 87 ms
8,684 KB
testcase_37 WA -
testcase_38 AC 81 ms
8,560 KB
testcase_39 AC 1 ms
4,376 KB
testcase_40 AC 1 ms
4,380 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
int dist(int x1,int y1,int x2,int y2){
	return (x1-x2)*(x1-x2)+(y1-y2)*(y1-y2);
}
int main(){
	int n;	cin>>n;
	vector<int> x(n),y(n);
	for(int i=0;i<n;i++)	cin>>x[i]>>y[i];
	set<pair<int,int>> grd;
	int cnt=0;
	for(int i=0;i<n;i++){
		auto it=grd.lower_bound(make_pair(x[i]-19,y[i]-19));
		bool canput=true;
		while(it!=grd.end()&&it->first<x[i]+20){
			if(dist(x[i],y[i],it->first,it->second)<400){
				canput=false;
				break;
			}
			it=grd.lower_bound(make_pair(it->first+1,y[i]-19));
		}
		if(canput){
			grd.insert(make_pair(x[i],y[i]));
			cnt++;
		}
	}
	cout<<cnt<<endl;
	return 0;
}
0