結果

問題 No.202 1円玉投げ
コンテスト
ユーザー srup٩(๑`н´๑)۶
提出日時 2016-10-04 23:02:21
言語 C++11
(gcc 15.3.0 + boost 1.92.0)
コンパイル:
g++-15 -O2 -lm -std=gnu++11 -Wuninitialized -DONLINE_JUDGE -o a.out _filename_
実行:
./a.out
結果
AC  
実行時間 151 ms / 5,000 ms
+ 746µs
コード長 688 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 366 ms
コンパイル使用メモリ 92,152 KB
実行使用メモリ 9,916 KB
最終ジャッジ日時 2026-10-05 23:20:51
合計ジャッジ時間 4,172 ms
ジャッジサーバーID
(参考情報)
judge3_0 / judge4_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 38
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

#include <iostream>
#include <cstdio>
#include <string>
#include <vector>
#include <algorithm>
#include <cmath>
using namespace std;
#define rep(i,n) for(int i=0;i<(n);i++)

vector<int> center[20100];

int main(void){
	int n; cin >> n;
	int ans = 0;
	rep(i, n){
		int cx, cy; cin >> cx >> cy;
		int xl = max(0, cx - 20);
		int xr = cx + 20;
		bool flag = true;
		for (int nx = xl; nx <= xr; ++nx){
			for(auto ny : center[nx]){
				int len = (nx - cx) * (nx - cx) + (ny - cy) * (ny - cy);
        		if(len < 400){//長さの二乗
        			flag = false;
        			break;
        		}
			}
		}
		if(flag){
			ans++;
			center[cx].push_back(cy);
		}
	}

	printf("%d\n", ans);
	return 0;
}
0