結果

問題 No.1121 Social Distancing in Cinema
ユーザー e869120e869120
提出日時 2020-07-02 17:39:35
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 813 bytes
コンパイル時間 649 ms
コンパイル使用メモリ 72,804 KB
実行使用メモリ 6,852 KB
最終ジャッジ日時 2023-10-14 23:34:40
合計ジャッジ時間 5,908 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,348 KB
testcase_01 AC 2 ms
4,348 KB
testcase_02 AC 3 ms
4,348 KB
testcase_03 AC 2 ms
4,352 KB
testcase_04 AC 2 ms
4,348 KB
testcase_05 AC 2 ms
4,352 KB
testcase_06 AC 2 ms
4,352 KB
testcase_07 AC 2 ms
4,352 KB
testcase_08 AC 2 ms
4,352 KB
testcase_09 AC 2 ms
4,348 KB
testcase_10 AC 2 ms
4,348 KB
testcase_11 AC 2 ms
4,352 KB
testcase_12 AC 3 ms
4,352 KB
testcase_13 AC 3 ms
4,348 KB
testcase_14 AC 3 ms
4,348 KB
testcase_15 AC 5 ms
4,348 KB
testcase_16 AC 14 ms
4,352 KB
testcase_17 AC 45 ms
5,252 KB
testcase_18 AC 83 ms
6,388 KB
testcase_19 AC 100 ms
6,532 KB
testcase_20 AC 5 ms
4,348 KB
testcase_21 AC 4 ms
4,352 KB
testcase_22 AC 4 ms
4,352 KB
testcase_23 AC 3 ms
4,348 KB
testcase_24 AC 2 ms
4,348 KB
testcase_25 AC 30 ms
5,076 KB
testcase_26 AC 38 ms
5,292 KB
testcase_27 AC 5 ms
4,692 KB
testcase_28 AC 86 ms
6,492 KB
testcase_29 AC 36 ms
5,252 KB
testcase_30 AC 27 ms
4,408 KB
testcase_31 AC 98 ms
6,852 KB
testcase_32 AC 75 ms
6,224 KB
testcase_33 AC 33 ms
5,304 KB
testcase_34 AC 33 ms
5,284 KB
testcase_35 AC 79 ms
6,320 KB
testcase_36 AC 95 ms
6,504 KB
testcase_37 AC 25 ms
5,088 KB
testcase_38 AC 38 ms
5,328 KB
testcase_39 AC 84 ms
6,340 KB
testcase_40 AC 20 ms
4,908 KB
testcase_41 AC 8 ms
4,564 KB
testcase_42 AC 94 ms
6,744 KB
testcase_43 AC 94 ms
6,424 KB
testcase_44 WA -
testcase_45 WA -
testcase_46 WA -
testcase_47 AC 3 ms
4,352 KB
testcase_48 AC 2 ms
4,348 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;

int N, X[250009], Y[250009];
int col[509][509];
bool used[509][509];
vector<int> ans;

int main() {
	cin >> N;
	for (int i = 1; i <= N; i++) {
		cin >> X[i] >> Y[i]; col[X[i]][Y[i]] = i;
	}
	for (int i = 1; i <= 500; i++) {
		for (int j = 1; j <= 500; j++) {
			if (col[i][j] == 0 || used[i][j] == true) continue;
			ans.push_back(col[i][j]);
			for (int k = -10; k <= 10; k++) {
				for (int l = -10; l <= 10; l++) {
					if (k * k + l * l >= 100) continue;
					int sx = i + k, sy = j + l; if (sx <= 0 || sx > 500 || sy <= 0 || sy > 500) continue;
					used[sx][sy] = true;
				}
			}
		}
	}

	cout << ans.size() << endl;
	for (int i = 0; i < ans.size(); i++) {
		if (i) cout << " "; cout << ans[i];
	}
	cout << endl;
	return 0;
}
0