結果

問題 No.202 1円玉投げ
ユーザー cielciel
提出日時 2015-05-12 03:02:58
言語 C++11
(gcc 11.4.0)
結果
AC  
実行時間 594 ms / 5,000 ms
コード長 675 bytes
コンパイル時間 380 ms
コンパイル使用メモリ 54,672 KB
実行使用メモリ 10,088 KB
最終ジャッジ日時 2023-08-23 22:46:43
合計ジャッジ時間 6,630 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 594 ms
8,188 KB
testcase_01 AC 188 ms
10,088 KB
testcase_02 AC 2 ms
4,380 KB
testcase_03 AC 1 ms
4,380 KB
testcase_04 AC 1 ms
4,380 KB
testcase_05 AC 8 ms
4,380 KB
testcase_06 AC 264 ms
8,448 KB
testcase_07 AC 330 ms
8,976 KB
testcase_08 AC 329 ms
8,976 KB
testcase_09 AC 121 ms
7,224 KB
testcase_10 AC 35 ms
5,336 KB
testcase_11 AC 89 ms
6,656 KB
testcase_12 AC 95 ms
6,692 KB
testcase_13 AC 40 ms
5,500 KB
testcase_14 AC 10 ms
4,376 KB
testcase_15 AC 117 ms
7,008 KB
testcase_16 AC 105 ms
8,184 KB
testcase_17 AC 105 ms
8,172 KB
testcase_18 AC 106 ms
8,200 KB
testcase_19 AC 104 ms
6,872 KB
testcase_20 AC 218 ms
8,176 KB
testcase_21 AC 101 ms
6,840 KB
testcase_22 AC 2 ms
4,376 KB
testcase_23 AC 2 ms
4,376 KB
testcase_24 AC 2 ms
4,376 KB
testcase_25 AC 2 ms
4,376 KB
testcase_26 AC 2 ms
4,376 KB
testcase_27 AC 2 ms
4,380 KB
testcase_28 AC 2 ms
4,380 KB
testcase_29 AC 2 ms
4,376 KB
testcase_30 AC 2 ms
4,380 KB
testcase_31 AC 2 ms
4,380 KB
testcase_32 AC 2 ms
4,380 KB
testcase_33 AC 2 ms
4,376 KB
testcase_34 AC 2 ms
4,380 KB
testcase_35 AC 145 ms
8,260 KB
testcase_36 AC 197 ms
8,248 KB
testcase_37 AC 368 ms
9,304 KB
testcase_38 AC 146 ms
8,292 KB
testcase_39 AC 1 ms
4,380 KB
testcase_40 AC 1 ms
4,376 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <vector>
#include <set>
#include <cstdio>
using namespace std;
typedef pair<int,int> pii;

int main(){
	int N;
	scanf("%d",&N);
	vector<pair<int,int> >v(N);
	set<int>kindx,kindy;
	for(int i=0;i<N;i++){
		int x,y;
		scanf("%d%d",&x,&y);
		v[i]={x,y};
		kindx.insert(x),kindy.insert(y);
	}
	if(kindx.size()<kindy.size())for(int i=0;i<N;i++)swap(v[i].first,v[i].second);
	set<pii>se;
	for(int i=0;i<N;i++){
		int x=v[i].first,y=v[i].second;
		pii A={x-20,0},B={x+20,1<<30};
		auto a=se.lower_bound(A),b=se.upper_bound(B);
		for(;a!=b;++a)if((a->first-x)*(a->first-x) + (a->second-y)*(a->second-y) < 400)break;
		if(a==b)se.insert({x,y});
	}
	printf("%d\n",se.size());
}
0