結果

問題 No.202 1円玉投げ
ユーザー fura
提出日時 2020-06-08 09:13:51
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
TLE  
実行時間 -
コード長 428 bytes
コンパイル時間 2,501 ms
コンパイル使用メモリ 197,304 KB
最終ジャッジ日時 2025-01-11 00:09:54
ジャッジサーバーID
(参考情報)
judge4 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 35 TLE * 3
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp: In function ‘int main()’:
main.cpp:8:21: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
    8 |         int n; scanf("%d",&n);
      |                ~~~~~^~~~~~~~~
main.cpp:12:31: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
   12 |                 int x,y; scanf("%d%d",&x,&y);
      |                          ~~~~~^~~~~~~~~~~~~~

ソースコード

diff #

#include <bits/stdc++.h>

#define rep(i,n) for(int i=0;i<(n);i++)

using namespace std;

int main(){
	int n; scanf("%d",&n);

	set<pair<int,int>> S;
	rep(i,n){
		int x,y; scanf("%d%d",&x,&y);
		bool ok=true;
		for(int y2=y-20;y2<=y+20;y2++) for(int x2=x-20;x2<=x+20;x2++) {
			if((x-x2)*(x-x2)+(y-y2)*(y-y2)<400 && S.count({x2,y2})>0){
				ok=false;
			}
		}
		if(ok) S.emplace(x,y);
	}
	printf("%ld\n",S.size());

	return 0;
}
0