結果

問題 No.202 1円玉投げ
ユーザー Lay_ec
提出日時 2015-05-04 00:33:23
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
MLE  
実行時間 -
コード長 782 bytes
コンパイル時間 801 ms
コンパイル使用メモリ 87,768 KB
実行使用メモリ 1,629,056 KB
最終ジャッジ日時 2024-12-22 07:36:54
合計ジャッジ時間 105,751 ms
ジャッジサーバーID
(参考情報)
judge2 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1 MLE * 2
other AC * 14 TLE * 6 MLE * 18
権限があれば一括ダウンロードができます

ソースコード

diff #

#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()
{
	map<pair<int,int>,bool > coin;

	int n;
	cin>>n;
	long res=0;
	for(int i=0;i<n;i++){
		int x,y;
		cin>>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;
				//cout<<nx<<" "<<ny<<endl;
				if(coin[make_pair(nx,ny)]==false) continue;
				//cout<<"exist:"<<nx<<" "<<ny<<endl;
				ok=false; 
			}
		}
		if(ok){res++; coin[make_pair(x,y)]=true;}
		
	}
	
	cout<<res<<endl;

	return 0;
}
0