結果

問題 No.202 1円玉投げ
ユーザー Lay_ecLay_ec
提出日時 2015-05-04 00:50:59
言語 C++11
(gcc 11.4.0)
結果
WA  
実行時間 -
コード長 916 bytes
コンパイル時間 832 ms
コンパイル使用メモリ 91,420 KB
実行使用メモリ 19,128 KB
最終ジャッジ日時 2023-08-23 22:06:55
合計ジャッジ時間 11,785 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 615 ms
18,508 KB
testcase_01 AC 625 ms
18,684 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 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
testcase_15 WA -
testcase_16 AC 587 ms
18,392 KB
testcase_17 AC 604 ms
18,612 KB
testcase_18 AC 599 ms
18,432 KB
testcase_19 WA -
testcase_20 WA -
testcase_21 WA -
testcase_22 AC 7 ms
4,396 KB
testcase_23 AC 8 ms
4,428 KB
testcase_24 WA -
testcase_25 WA -
testcase_26 AC 8 ms
4,632 KB
testcase_27 AC 8 ms
4,548 KB
testcase_28 WA -
testcase_29 WA -
testcase_30 AC 8 ms
4,632 KB
testcase_31 WA -
testcase_32 WA -
testcase_33 WA -
testcase_34 AC 9 ms
5,076 KB
testcase_35 AC 593 ms
18,304 KB
testcase_36 AC 613 ms
18,300 KB
testcase_37 WA -
testcase_38 AC 599 ms
18,424 KB
testcase_39 AC 6 ms
4,380 KB
testcase_40 WA -
権限があれば一括ダウンロードができます

ソースコード

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<int,vector<int> > t;
	for(int i=-19;i<=19;i++){
		for(int j=-19;j<=19;j++){
			if(i*i+j*j<400) t[i].push_back(j);
		}
	}
	
	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 j=0;j<t[i].size() && ok;j++){
				int nx=x+dx,ny=y+t[dx][j];
				//cout<<nx<<" "<<ny<<endl;
				if(coin[make_pair(nx,ny)]==false) continue;
				//cout<<"exist:"<<nx<<" "<<ny<<endl;
				if(dx*dx+t[dx][j]*t[dx][j]<400)ok=false; 
			}
		}
		if(ok){res++; coin[make_pair(x,y)]=true;}
		
	}
	
	cout<<res<<endl;

	return 0;
}
0