結果

問題 No.202 1円玉投げ
コンテスト
ユーザー Lay_ec
提出日時 2015-05-04 00:59:00
言語 C++11
(gcc 15.2.0 + boost 1.89.0)
コンパイル:
g++-15 -O2 -lm -std=gnu++11 -Wuninitialized -DONLINE_JUDGE -o a.out _filename_
実行:
./a.out
結果
TLE  
(最新)
AC  
(最初)
実行時間 -
コード長 733 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 692 ms
コンパイル使用メモリ 104,820 KB
実行使用メモリ 8,576 KB
最終ジャッジ日時 2026-05-28 16:10:22
合計ジャッジ時間 47,131 ms
ジャッジサーバーID
(参考情報)
judge2_0 / judge1_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 37 TLE * 1
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

#include <iostream>
#include <string>
#include <vector>
#include <cmath>
#include <algorithm>
#include <cstdlib>
#include <ctime>
#include <cstdio>
#include <functional>
#include <set>
#include <sstream>
#include <map>
#include <queue>
#include <stack>

using namespace std;


int main()
{
		
	set<pair<int,int> > coin;

	int n;
	scanf("%d",&n);
	long res=0;
	for(int i=0;i<n;i++){
		int x,y;
		scanf("%d%d",&x,&y);
		
		bool ok=true;
		for(int dx=-19;dx<=19 && ok;dx++){
			for(int dy=-19 ; dy<=19 && ok;dy++){
				if(dx*dx+dy*dy>=400) continue;
				
				int nx=x+dx,ny=y+dy;
				if(coin.find(make_pair(nx,ny))!=coin.end()) ok=false;			

			}
		}
		if(ok){res++; coin.insert(make_pair(x,y));}
		
	}
	
	cout<<res<<endl;

	return 0;
}
0