結果

問題 No.202 1円玉投げ
ユーザー ゆにぽけゆにぽけ
提出日時 2023-10-21 03:11:05
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
TLE  
実行時間 -
コード長 1,091 bytes
コンパイル時間 1,335 ms
コンパイル使用メモリ 132,184 KB
実行使用メモリ 8,284 KB
最終ジャッジ日時 2023-10-21 03:11:45
合計ジャッジ時間 36,317 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 3,186 ms
8,284 KB
testcase_01 AC 3,142 ms
8,248 KB
testcase_02 AC 2 ms
4,348 KB
testcase_03 AC 2 ms
4,348 KB
testcase_04 AC 2 ms
4,348 KB
testcase_05 AC 125 ms
4,348 KB
testcase_06 AC 2,836 ms
7,032 KB
testcase_07 AC 3,173 ms
7,392 KB
testcase_08 AC 3,212 ms
7,424 KB
testcase_09 AC 1,607 ms
5,852 KB
testcase_10 AC 595 ms
4,588 KB
testcase_11 AC 1,310 ms
5,476 KB
testcase_12 AC 1,324 ms
5,524 KB
testcase_13 AC 633 ms
4,688 KB
testcase_14 AC 157 ms
4,348 KB
testcase_15 AC 1,507 ms
5,780 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<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;
	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;
			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) continue;
		S.insert(make_pair(x,y));
	}
	cout << S.size() << endl;
}
int main()
{
	ios::sync_with_stdio(false);
	cin.tie(nullptr);
	int tt = 1;
	//cin >> tt;
	while(tt--) solve();
}
0