結果

問題 No.202 1円玉投げ
ユーザー FF256grhyFF256grhy
提出日時 2015-05-04 01:15:49
言語 C++11
(gcc 11.4.0)
結果
RE  
実行時間 -
コード長 858 bytes
コンパイル時間 183 ms
コンパイル使用メモリ 27,004 KB
実行使用メモリ 7,640 KB
最終ジャッジ日時 2023-08-23 22:09:06
合計ジャッジ時間 4,471 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 24 ms
5,348 KB
testcase_01 RE -
testcase_02 AC 2 ms
4,380 KB
testcase_03 AC 2 ms
4,376 KB
testcase_04 AC 1 ms
4,376 KB
testcase_05 RE -
testcase_06 WA -
testcase_07 RE -
testcase_08 RE -
testcase_09 RE -
testcase_10 WA -
testcase_11 RE -
testcase_12 RE -
testcase_13 RE -
testcase_14 WA -
testcase_15 RE -
testcase_16 AC 25 ms
6,772 KB
testcase_17 AC 21 ms
4,380 KB
testcase_18 AC 21 ms
4,380 KB
testcase_19 RE -
testcase_20 RE -
testcase_21 RE -
testcase_22 AC 7 ms
6,968 KB
testcase_23 AC 7 ms
6,936 KB
testcase_24 AC 2 ms
4,376 KB
testcase_25 AC 2 ms
4,380 KB
testcase_26 AC 2 ms
4,380 KB
testcase_27 AC 2 ms
4,376 KB
testcase_28 AC 2 ms
4,380 KB
testcase_29 AC 2 ms
4,380 KB
testcase_30 AC 7 ms
6,532 KB
testcase_31 AC 1 ms
4,376 KB
testcase_32 AC 5 ms
5,468 KB
testcase_33 WA -
testcase_34 WA -
testcase_35 AC 21 ms
4,380 KB
testcase_36 AC 27 ms
7,632 KB
testcase_37 RE -
testcase_38 AC 22 ms
4,376 KB
testcase_39 AC 3 ms
4,380 KB
testcase_40 AC 2 ms
4,380 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <stdio.h>

#define MAX 100000
int xlist[1002][4], ylist[1002][4]; // 20000/20 + 2, 5個は入らない
int num[1002][1002];

int main(void) {
	int n, x[MAX], y[MAX];
	scanf("%d", &n);
	int i, j, k, l;
	for(i = 0; i < n; i++) {
		scanf("%d %d", &x[i], &y[i]);
	}
	
	int answer = 0;
	for(i = 0; i < n; i++) {
		int xp = x[i] / 20 + 1;
		int yp = y[i] / 20 + 1;
		int flag = 0;
		for(j = xp - 1; j <= xp + 1; j++) {
		for(k = yp - 1; k <= yp + 1; k++) {
			for(l = 0; l < num[j][k]; l++) {
				if ( (x[i] - xlist[j][l]) * (x[i] - xlist[j][l]) + (y[i] - ylist[k][l]) * (y[i] - ylist[k][l]) < 400 ) {
					flag = 1;
					break;
				}
			}
		if(flag) { break; }
		}
		if(flag) { break; }
		}
		if(! flag) {
			xlist[xp][ num[xp][yp] ] = x[i];
			ylist[yp][ num[xp][yp] ] = y[i];
			num[xp][yp]++;
			answer++;
		}
	}
	printf("%d\n", answer);
	return 0;
}
0