結果
| 問題 | 
                            No.202 1円玉投げ
                             | 
                    
| コンテスト | |
| ユーザー | 
                             TLwiegehtt
                         | 
                    
| 提出日時 | 2015-07-21 04:33:08 | 
| 言語 | C90  (gcc 12.3.0)  | 
                    
| 結果 | 
                             
                                WA
                                 
                             
                            
                         | 
                    
| 実行時間 | - | 
| コード長 | 1,248 bytes | 
| コンパイル時間 | 1,200 ms | 
| コンパイル使用メモリ | 21,888 KB | 
| 実行使用メモリ | 6,400 KB | 
| 最終ジャッジ日時 | 2024-12-22 09:41:30 | 
| 合計ジャッジ時間 | 23,827 ms | 
| 
                            ジャッジサーバーID (参考情報)  | 
                        judge2 / judge5 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 3 | 
| other | AC * 31 WA * 7 | 
コンパイルメッセージ
main.c: In function ‘main’:
main.c:17:9: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
   17 |         scanf("%d", &n);
      |         ^~~~~~~~~~~~~~~
main.c:21:17: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
   21 |                 scanf("%d %d", &nx, &ny);
      |                 ^~~~~~~~~~~~~~~~~~~~~~~~
            
            ソースコード
#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;
}
            
            
            
        
            
TLwiegehtt