結果

問題 No.202 1円玉投げ
ユーザー ゆにぽけゆにぽけ
提出日時 2023-10-21 03:13:50
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 3,307 ms / 5,000 ms
コード長 1,167 bytes
コンパイル時間 1,368 ms
コンパイル使用メモリ 137,252 KB
実行使用メモリ 9,184 KB
最終ジャッジ日時 2023-10-21 03:14:24
合計ジャッジ時間 30,041 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 251 ms
8,304 KB
testcase_01 AC 3,307 ms
9,184 KB
testcase_02 AC 2 ms
4,348 KB
testcase_03 AC 2 ms
4,348 KB
testcase_04 AC 1 ms
4,348 KB
testcase_05 AC 36 ms
4,348 KB
testcase_06 AC 2,495 ms
7,948 KB
testcase_07 AC 2,987 ms
8,312 KB
testcase_08 AC 3,022 ms
8,344 KB
testcase_09 AC 1,301 ms
6,708 KB
testcase_10 AC 317 ms
5,200 KB
testcase_11 AC 955 ms
6,288 KB
testcase_12 AC 981 ms
6,344 KB
testcase_13 AC 377 ms
5,336 KB
testcase_14 AC 46 ms
4,348 KB
testcase_15 AC 1,222 ms
6,628 KB
testcase_16 AC 255 ms
8,320 KB
testcase_17 AC 516 ms
8,300 KB
testcase_18 AC 502 ms
8,300 KB
testcase_19 AC 1,116 ms
6,488 KB
testcase_20 AC 2,147 ms
7,624 KB
testcase_21 AC 1,103 ms
6,472 KB
testcase_22 AC 3 ms
4,348 KB
testcase_23 AC 2 ms
4,348 KB
testcase_24 AC 2 ms
4,348 KB
testcase_25 AC 3 ms
4,348 KB
testcase_26 AC 3 ms
4,348 KB
testcase_27 AC 3 ms
4,348 KB
testcase_28 AC 2 ms
4,348 KB
testcase_29 AC 3 ms
4,348 KB
testcase_30 AC 3 ms
4,348 KB
testcase_31 AC 2 ms
4,348 KB
testcase_32 AC 3 ms
4,348 KB
testcase_33 AC 6 ms
4,348 KB
testcase_34 AC 5 ms
4,348 KB
testcase_35 AC 234 ms
8,288 KB
testcase_36 AC 235 ms
8,332 KB
testcase_37 AC 3,038 ms
8,576 KB
testcase_38 AC 249 ms
8,288 KB
testcase_39 AC 2 ms
4,348 KB
testcase_40 AC 2 ms
4,348 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<iostream>
#include<vector>
#include<algorithm>
#include<cstring>
#include<cassert>
#include<cmath>
#include<ctime>
#include<iomanip>
#include<numeric>
#include<stack>
#include<queue>
#include<map>
#include<unordered_map>
#include<set>
#include<unordered_set>
#include<bitset>
#include<random>
using namespace std;
void solve()
{
	int N;
	cin >> N;
	set<pair<int,int>> S;
	set<int> X;
	for(int i = 0;i < N;i++)
	{
		int x,y;
		cin >> x >> y;
		bool fn = false;
		for(int i = -19;i < 20;i++)
		{
			int nx = x+i;
			if(!X.count(nx)) continue;
			int ok = y,ng = y+30;
			while(ng-ok > 1)
			{
				int mid = (ok+ng)/2;
				if(i*i + (mid-y)*(mid-y) < 400) ok = mid;
				else ng = mid;
			}
			int uy = ok;
			ok = y,ng = y-30;
			while(ok-ng > 1)
			{
				int mid = (ok+ng)/2;
				if(i*i + (mid-y)*(mid-y) < 400) ok = mid;
				else ng = mid;
			}
			int ly = ok;
			for(int j = ly;j <= uy;j++) if(S.count(make_pair(nx,j))) fn = true;
			if(fn) break;
		}
		if(fn) continue;
		S.insert(make_pair(x,y));
		X.insert(x);
	}
	cout << S.size() << endl;
}
int main()
{
	ios::sync_with_stdio(false);
	cin.tie(nullptr);
	int tt = 1;
	//cin >> tt;
	while(tt--) solve();
}
0