結果

問題 No.202 1円玉投げ
ユーザー 👑 kmjpkmjp
提出日時 2015-05-03 23:36:54
言語 C++11
(gcc 11.4.0)
結果
AC  
実行時間 487 ms / 5,000 ms
コード長 1,053 bytes
コンパイル時間 1,314 ms
コンパイル使用メモリ 151,840 KB
実行使用メモリ 9,868 KB
最終ジャッジ日時 2023-08-23 21:34:26
合計ジャッジ時間 8,900 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 267 ms
9,868 KB
testcase_01 AC 446 ms
9,760 KB
testcase_02 AC 2 ms
4,376 KB
testcase_03 AC 3 ms
4,376 KB
testcase_04 AC 2 ms
4,380 KB
testcase_05 AC 16 ms
4,664 KB
testcase_06 AC 369 ms
8,372 KB
testcase_07 AC 438 ms
8,984 KB
testcase_08 AC 436 ms
8,996 KB
testcase_09 AC 197 ms
7,108 KB
testcase_10 AC 67 ms
5,544 KB
testcase_11 AC 153 ms
6,504 KB
testcase_12 AC 158 ms
6,588 KB
testcase_13 AC 75 ms
5,620 KB
testcase_14 AC 20 ms
4,672 KB
testcase_15 AC 191 ms
6,908 KB
testcase_16 AC 238 ms
9,792 KB
testcase_17 AC 299 ms
9,764 KB
testcase_18 AC 299 ms
9,772 KB
testcase_19 AC 174 ms
6,888 KB
testcase_20 AC 325 ms
8,028 KB
testcase_21 AC 173 ms
6,752 KB
testcase_22 AC 4 ms
4,656 KB
testcase_23 AC 4 ms
4,524 KB
testcase_24 AC 3 ms
4,452 KB
testcase_25 AC 3 ms
4,376 KB
testcase_26 AC 4 ms
4,628 KB
testcase_27 AC 4 ms
4,388 KB
testcase_28 AC 4 ms
4,380 KB
testcase_29 AC 4 ms
4,376 KB
testcase_30 AC 4 ms
4,400 KB
testcase_31 AC 3 ms
4,380 KB
testcase_32 AC 4 ms
4,380 KB
testcase_33 AC 4 ms
4,384 KB
testcase_34 AC 5 ms
4,380 KB
testcase_35 AC 257 ms
9,752 KB
testcase_36 AC 242 ms
9,844 KB
testcase_37 AC 487 ms
9,368 KB
testcase_38 AC 261 ms
9,792 KB
testcase_39 AC 3 ms
4,388 KB
testcase_40 AC 3 ms
4,380 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
typedef signed long long ll;

#undef _P
#define _P(...) (void)printf(__VA_ARGS__)
#define FOR(x,to) for(x=0;x<to;x++)
#define FORR(x,arr) for(auto& x:arr)
#define ITR(x,c) for(__typeof(c.begin()) x=c.begin();x!=c.end();x++)
#define ALL(a) (a.begin()),(a.end())
#define ZERO(a) memset(a,0,sizeof(a))
#define MINUS(a) memset(a,0xff,sizeof(a))
//-------------------------------------------------------

int N;
int X[101000],Y[101000];

set<int> S[20200];
int ret;

void solve() {
	int i,j,k,l,r,x,y; string s;
	
	cin>>N;
	FOR(i,N) {
		cin>>X[i]>>Y[i];
		int ok=1;
		for(x=max(0,X[i]-19);x<=min(20000,X[i]+19) && ok;x++) {
			int dy=sqrt(399-(x-X[i])*(x-X[i])+0.0001);
			for(y=max(0,Y[i]-dy);y<=min(20000,Y[i]+dy);y++) if(S[x].count(y)) ok=0;
		}
		if(ok) ret++, S[X[i]].insert(Y[i]);
	}
	cout<<ret<<endl;
	
}


int main(int argc,char** argv){
	string s;int i;
	if(argc==1) ios::sync_with_stdio(false);
	FOR(i,argc-1) s+=argv[i+1],s+='\n';
	FOR(i,s.size()) ungetc(s[s.size()-1-i],stdin);
	solve(); return 0;
}
0