結果

問題 No.202 1円玉投げ
コンテスト
ユーザー らっしー(raccy)
提出日時 2015-05-04 00:42:39
言語 C++11
(gcc 15.2.0 + boost 1.89.0)
コンパイル:
g++-15 -O2 -lm -std=gnu++11 -Wuninitialized -DONLINE_JUDGE -o a.out _filename_
実行:
./a.out
結果
TLE  
実行時間 -
コード長 730 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 424 ms
コンパイル使用メモリ 74,368 KB
実行使用メモリ 13,824 KB
最終ジャッジ日時 2026-05-28 15:59:21
合計ジャッジ時間 13,358 ms
ジャッジサーバーID
(参考情報)
judge1_0 / judge3_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample -- * 3
other TLE * 1 -- * 37
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

#include <iostream>
#include <list>

class Ichien {
	long long x;
	long long y;
public:
	Ichien(long long x, long long y) : x(x), y(y) {};
	bool kasanaru(Ichien *other) {
		long long x_diff = this->x - other->x;
		long long y_diff = this->y - other->y;
		return x_diff * x_diff + y_diff * y_diff < 400;
	}
};

int main() {
	int n;
	double x, y;
	Ichien *ichi;
	std::list<Ichien *> list;

	std::cin >> n;
	for (int i = 0; i < n; ++i) {
		std::cin >> x >> y;
		ichi = new Ichien(x, y);
		bool okeru = true;
		for (auto other: list) {
			if (ichi->kasanaru(other)) {
				okeru = false;
				break;
			}
		}
		if (okeru) {
			list.push_back(ichi);
		} else {
			delete ichi;
		}
	}
	std::cout << list.size() << std::endl;
	return 0;
}
0