結果

問題 No.202 1円玉投げ
ユーザー らっしー(raccy)
提出日時 2015-05-04 00:42:39
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
TLE  
実行時間 -
コード長 730 bytes
コンパイル時間 606 ms
コンパイル使用メモリ 57,960 KB
実行使用メモリ 13,860 KB
最終ジャッジ日時 2024-12-22 07:48:12
合計ジャッジ時間 111,695 ms
ジャッジサーバーID
(参考情報)
judge4 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 25 TLE * 13
権限があれば一括ダウンロードができます

ソースコード

diff #

#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