結果

問題 No.202 1円玉投げ
ユーザー srup٩(๑`н´๑)۶srup٩(๑`н´๑)۶
提出日時 2016-10-04 18:27:29
言語 C++11
(gcc 11.4.0)
結果
AC  
実行時間 1,115 ms / 5,000 ms
コード長 750 bytes
コンパイル時間 453 ms
コンパイル使用メモリ 67,836 KB
実行使用メモリ 4,924 KB
最終ジャッジ日時 2023-08-23 23:28:10
合計ジャッジ時間 7,796 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 360 ms
4,648 KB
testcase_01 AC 128 ms
4,912 KB
testcase_02 AC 2 ms
4,376 KB
testcase_03 AC 2 ms
4,380 KB
testcase_04 AC 2 ms
4,376 KB
testcase_05 AC 7 ms
4,376 KB
testcase_06 AC 99 ms
4,924 KB
testcase_07 AC 116 ms
4,820 KB
testcase_08 AC 118 ms
4,752 KB
testcase_09 AC 56 ms
4,572 KB
testcase_10 AC 22 ms
4,380 KB
testcase_11 AC 44 ms
4,452 KB
testcase_12 AC 46 ms
4,464 KB
testcase_13 AC 24 ms
4,376 KB
testcase_14 AC 7 ms
4,376 KB
testcase_15 AC 53 ms
4,520 KB
testcase_16 AC 102 ms
4,624 KB
testcase_17 AC 682 ms
4,560 KB
testcase_18 AC 681 ms
4,520 KB
testcase_19 AC 49 ms
4,548 KB
testcase_20 AC 86 ms
4,640 KB
testcase_21 AC 49 ms
4,548 KB
testcase_22 AC 3 ms
4,380 KB
testcase_23 AC 3 ms
4,376 KB
testcase_24 AC 2 ms
4,380 KB
testcase_25 AC 2 ms
4,380 KB
testcase_26 AC 7 ms
4,380 KB
testcase_27 AC 6 ms
4,380 KB
testcase_28 AC 3 ms
4,376 KB
testcase_29 AC 3 ms
4,380 KB
testcase_30 AC 3 ms
4,376 KB
testcase_31 AC 2 ms
4,380 KB
testcase_32 AC 3 ms
4,376 KB
testcase_33 AC 3 ms
4,376 KB
testcase_34 AC 3 ms
4,380 KB
testcase_35 AC 1,114 ms
4,380 KB
testcase_36 AC 162 ms
4,408 KB
testcase_37 AC 129 ms
4,776 KB
testcase_38 AC 1,115 ms
4,376 KB
testcase_39 AC 2 ms
4,376 KB
testcase_40 AC 2 ms
4,376 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <cstdio>
#include <string>
#include <vector>
#include <algorithm>
#include <cmath>

using namespace std;
#define rep(i,n) for(int i=0;i<(n);i++)
static const int mod = 1e9 + 7;

vector<int> center[20100];

int main(void){
	int n; cin >> n;
	int ans = 0;
	rep(i, n){
		int cx, cy; cin >> cx >> cy;
		int xl = max(0, cx - 20);
		int xr = cx + 20;
		bool flag = true;
		for (int nx = xl; nx <= xr; ++nx){
			for(auto ny : center[nx]){
				double len = sqrt((nx - cx) * (nx - cx) + (ny - cy) * (ny - cy));
        		// printf("len %f\n",len );
        		if(len < 20){
        			flag = false;
        			break;
        		}
			}
		}
		if(flag){
			ans++;
			center[cx].push_back(cy);
		}
	}

	printf("%d\n", ans);
	return 0;
}
0