結果

問題 No.202 1円玉投げ
ユーザー らっしー(raccy)らっしー(raccy)
提出日時 2015-05-04 00:42:39
言語 C++11
(gcc 11.4.0)
結果
TLE  
実行時間 -
コード長 730 bytes
コンパイル時間 650 ms
コンパイル使用メモリ 58,300 KB
実行使用メモリ 13,596 KB
最終ジャッジ日時 2024-06-01 19:32:30
合計ジャッジ時間 13,286 ms
ジャッジサーバーID
(参考情報)
judge1 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 TLE -
testcase_01 -- -
testcase_02 -- -
testcase_03 -- -
testcase_04 -- -
testcase_05 -- -
testcase_06 -- -
testcase_07 -- -
testcase_08 -- -
testcase_09 -- -
testcase_10 -- -
testcase_11 -- -
testcase_12 -- -
testcase_13 -- -
testcase_14 -- -
testcase_15 -- -
testcase_16 -- -
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 <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