結果

問題 No.202 1円玉投げ
ユーザー Lay_ecLay_ec
提出日時 2015-05-04 00:59:00
言語 C++11
(gcc 11.4.0)
結果
TLE  
(最新)
AC  
(最初)
実行時間 -
コード長 733 bytes
コンパイル時間 1,208 ms
コンパイル使用メモリ 80,628 KB
実行使用メモリ 8,184 KB
最終ジャッジ日時 2023-08-23 22:08:29
合計ジャッジ時間 36,963 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 3,418 ms
8,184 KB
testcase_01 AC 3,284 ms
8,104 KB
testcase_02 AC 1 ms
4,380 KB
testcase_03 AC 2 ms
4,376 KB
testcase_04 AC 1 ms
4,376 KB
testcase_05 AC 133 ms
4,380 KB
testcase_06 AC 3,008 ms
7,036 KB
testcase_07 AC 3,202 ms
7,268 KB
testcase_08 AC 3,237 ms
7,300 KB
testcase_09 AC 1,622 ms
5,728 KB
testcase_10 AC 587 ms
4,404 KB
testcase_11 AC 1,292 ms
5,256 KB
testcase_12 AC 1,331 ms
5,464 KB
testcase_13 AC 660 ms
4,560 KB
testcase_14 AC 158 ms
4,380 KB
testcase_15 AC 1,561 ms
5,656 KB
testcase_16 TLE -
testcase_17 -- -
testcase_18 -- -
testcase_19 -- -
testcase_20 -- -
testcase_21 -- -
testcase_22 -- -
testcase_23 -- -
testcase_24 -- -
testcase_25 -- -
testcase_26 -- -
testcase_27 -- -
testcase_28 -- -
testcase_29 -- -
testcase_30 -- -
testcase_31 -- -
testcase_32 -- -
testcase_33 -- -
testcase_34 -- -
testcase_35 -- -
testcase_36 -- -
testcase_37 -- -
testcase_38 -- -
testcase_39 -- -
testcase_40 -- -
権限があれば一括ダウンロードができます

ソースコード

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()
{
		
	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