結果

問題 No.202 1円玉投げ
ユーザー TLwiegehttTLwiegehtt
提出日時 2015-07-21 04:33:08
言語 C90
(gcc 11.4.0)
結果
WA  
実行時間 -
コード長 1,248 bytes
コンパイル時間 234 ms
コンパイル使用メモリ 25,172 KB
実行使用メモリ 45,524 KB
最終ジャッジ日時 2023-08-23 23:06:13
合計ジャッジ時間 21,817 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1,993 ms
24,700 KB
testcase_01 AC 522 ms
45,444 KB
testcase_02 AC 1 ms
4,376 KB
testcase_03 AC 0 ms
4,376 KB
testcase_04 AC 1 ms
4,376 KB
testcase_05 AC 15 ms
43,064 KB
testcase_06 AC 334 ms
45,424 KB
testcase_07 WA -
testcase_08 AC 403 ms
45,412 KB
testcase_09 AC 162 ms
45,208 KB
testcase_10 AC 49 ms
43,140 KB
testcase_11 AC 119 ms
45,212 KB
testcase_12 AC 126 ms
43,172 KB
testcase_13 AC 55 ms
42,992 KB
testcase_14 AC 17 ms
43,016 KB
testcase_15 AC 155 ms
45,228 KB
testcase_16 AC 2,017 ms
8,792 KB
testcase_17 AC 2,022 ms
43,312 KB
testcase_18 AC 2,015 ms
43,228 KB
testcase_19 AC 138 ms
45,200 KB
testcase_20 WA -
testcase_21 AC 138 ms
45,300 KB
testcase_22 AC 1 ms
4,376 KB
testcase_23 AC 2 ms
6,024 KB
testcase_24 WA -
testcase_25 WA -
testcase_26 AC 9 ms
42,796 KB
testcase_27 AC 10 ms
44,928 KB
testcase_28 WA -
testcase_29 WA -
testcase_30 AC 9 ms
42,792 KB
testcase_31 AC 1 ms
4,376 KB
testcase_32 AC 10 ms
42,824 KB
testcase_33 AC 2 ms
5,900 KB
testcase_34 AC 2 ms
4,380 KB
testcase_35 AC 2,100 ms
43,132 KB
testcase_36 AC 2,020 ms
10,368 KB
testcase_37 WA -
testcase_38 AC 2,084 ms
43,216 KB
testcase_39 AC 1 ms
4,380 KB
testcase_40 AC 1 ms
4,376 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <stdio.h>

#define	CMAX	(100000)

#define WMAX	(32)
#define	HMAX	(32)

int field[HMAX+2][WMAX+2][10000];
int fCnt[HMAX+2][WMAX+2];

int coin[CMAX+2];

int main(void){
	int i,j,k,n;
	int cCnt=0;
	
	scanf("%d", &n);
	
	for(i=0;i<n;i++){
		int nx, ny;
		scanf("%d %d", &nx, &ny);
		coin[i] = nx*100000+ny;
	}
	
	for(i=0;i<n;i++){
		int noHit=1;
		int nx, ny;
		int px, py;
		
		nx = coin[i] / 100000;
		ny = coin[i] % 100000;
		
		px = nx/(20000/WMAX);
		py = ny/(20000/HMAX);
		
		
		for(j=-3;j<=3;j++){
			for(k=-3;k<=3;k++){
				int s;
				int fx = px+k;
				int fy = py+j;
				
				
				if(fx < 0 || (WMAX-1) < fx){continue;}
				if(fy < 0 || (HMAX-1) < fy){continue;}
				
//				printf("ff %d %d %d %d %d\n", nx, ny, fx, fy, fCnt[fy][fx]);
				
				for(s=0;s<fCnt[fy][fx];s++){
					int tx = field[fy][fx][s] / 100000;
					int ty = field[fy][fx][s] % 100000;
					int len = (nx-tx)*(nx-tx)+(ny-ty)*(ny-ty);
					
					if( len < 20*20){
						noHit = 0;
						j=k=10;
						break;
					}
				}
			}
		}
		
		if(noHit == 1){
			field[py][px][fCnt[py][px]] = nx*100000+ny;
			fCnt[py][px] += 1;
			
			cCnt += 1;
			
//			printf("Add px[%d], py[%d], fCnt[py][px]=[%d]\n", px, py, fCnt[py][px]);
		}
	}
	
	printf("%d\n", cCnt);
	return 0;
}
0