結果

問題 No.202 1円玉投げ
ユーザー 👑 kmjpkmjp
提出日時 2022-09-24 13:59:35
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 494 ms / 5,000 ms
コード長 1,053 bytes
コンパイル時間 2,371 ms
コンパイル使用メモリ 205,572 KB
実行使用メモリ 10,048 KB
最終ジャッジ日時 2023-08-24 00:27:55
合計ジャッジ時間 10,058 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 220 ms
9,868 KB
testcase_01 AC 483 ms
9,836 KB
testcase_02 AC 2 ms
4,380 KB
testcase_03 AC 2 ms
4,376 KB
testcase_04 AC 2 ms
4,376 KB
testcase_05 AC 14 ms
4,700 KB
testcase_06 AC 378 ms
8,520 KB
testcase_07 AC 452 ms
8,996 KB
testcase_08 AC 453 ms
9,028 KB
testcase_09 AC 203 ms
7,016 KB
testcase_10 AC 63 ms
5,464 KB
testcase_11 AC 154 ms
6,504 KB
testcase_12 AC 158 ms
6,560 KB
testcase_13 AC 70 ms
5,596 KB
testcase_14 AC 17 ms
4,792 KB
testcase_15 AC 191 ms
6,876 KB
testcase_16 AC 188 ms
9,908 KB
testcase_17 AC 258 ms
10,048 KB
testcase_18 AC 258 ms
9,756 KB
testcase_19 AC 173 ms
6,960 KB
testcase_20 AC 335 ms
8,244 KB
testcase_21 AC 170 ms
6,728 KB
testcase_22 AC 4 ms
4,456 KB
testcase_23 AC 3 ms
4,472 KB
testcase_24 AC 2 ms
4,420 KB
testcase_25 AC 3 ms
4,376 KB
testcase_26 AC 4 ms
4,380 KB
testcase_27 AC 3 ms
4,456 KB
testcase_28 AC 3 ms
4,380 KB
testcase_29 AC 4 ms
4,380 KB
testcase_30 AC 4 ms
4,524 KB
testcase_31 AC 3 ms
4,380 KB
testcase_32 AC 4 ms
4,468 KB
testcase_33 AC 4 ms
4,380 KB
testcase_34 AC 4 ms
4,656 KB
testcase_35 AC 213 ms
9,868 KB
testcase_36 AC 192 ms
9,768 KB
testcase_37 AC 494 ms
9,140 KB
testcase_38 AC 212 ms
9,772 KB
testcase_39 AC 3 ms
4,388 KB
testcase_40 AC 3 ms
4,612 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