結果

問題 No.202 1円玉投げ
ユーザー kotatsugamekotatsugame
提出日時 2020-03-01 17:33:52
言語 C++14
(gcc 13.2.0 + boost 1.83.0)
結果
AC  
実行時間 90 ms / 5,000 ms
コード長 553 bytes
コンパイル時間 634 ms
コンパイル使用メモリ 73,672 KB
実行使用メモリ 30,220 KB
最終ジャッジ日時 2023-08-24 00:06:55
合計ジャッジ時間 3,955 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 79 ms
30,040 KB
testcase_01 AC 87 ms
30,068 KB
testcase_02 AC 12 ms
27,024 KB
testcase_03 AC 12 ms
26,884 KB
testcase_04 AC 12 ms
26,828 KB
testcase_05 AC 17 ms
27,028 KB
testcase_06 AC 78 ms
29,120 KB
testcase_07 AC 84 ms
29,492 KB
testcase_08 AC 84 ms
29,440 KB
testcase_09 AC 52 ms
28,412 KB
testcase_10 AC 28 ms
27,616 KB
testcase_11 AC 44 ms
28,132 KB
testcase_12 AC 46 ms
28,120 KB
testcase_13 AC 30 ms
27,844 KB
testcase_14 AC 17 ms
27,040 KB
testcase_15 AC 52 ms
28,296 KB
testcase_16 AC 68 ms
29,984 KB
testcase_17 AC 73 ms
30,220 KB
testcase_18 AC 73 ms
30,028 KB
testcase_19 AC 47 ms
28,340 KB
testcase_20 AC 69 ms
28,908 KB
testcase_21 AC 48 ms
28,192 KB
testcase_22 AC 12 ms
27,156 KB
testcase_23 AC 12 ms
26,860 KB
testcase_24 AC 13 ms
27,132 KB
testcase_25 AC 12 ms
26,904 KB
testcase_26 AC 12 ms
26,852 KB
testcase_27 AC 12 ms
27,160 KB
testcase_28 AC 13 ms
27,132 KB
testcase_29 AC 12 ms
26,900 KB
testcase_30 AC 13 ms
26,996 KB
testcase_31 AC 12 ms
26,828 KB
testcase_32 AC 13 ms
26,848 KB
testcase_33 AC 13 ms
26,840 KB
testcase_34 AC 12 ms
26,900 KB
testcase_35 AC 72 ms
29,944 KB
testcase_36 AC 79 ms
29,948 KB
testcase_37 AC 90 ms
29,540 KB
testcase_38 AC 77 ms
29,956 KB
testcase_39 AC 12 ms
26,864 KB
testcase_40 AC 13 ms
26,900 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp:7:1: 警告: ISO C++ では型の無い ‘main’ の宣言を禁止しています [-Wreturn-type]
    7 | main()
      | ^~~~

ソースコード

diff #

#include<iostream>
#include<vector>
#include<algorithm>
using namespace std;
int N;
vector<pair<int,int> >A[1001][1001];
main()
{
	cin>>N;
	int ans=0;
	for(;N--;)
	{
		int x,y;cin>>x>>y;
		bool ok=true;
		for(int lx=max(0,x/20-1),rx=min(1000,x/20+1);lx<=rx;lx++)
		{
			for(int ly=max(0,y/20-1),ry=min(1000,y/20+1);ly<=ry;ly++)
			{
				for(pair<int,int>p:A[lx][ly])
				{
					int dx=p.first-x,dy=p.second-y;
					if(dx*dx+dy*dy<400)ok=false;
				}
			}
		}
		if(ok)
		{
			ans++;
			A[x/20][y/20].push_back(make_pair(x,y));
		}
	}
	cout<<ans<<endl;
}
0